summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4d7785)
raw | patch | inline | side by side (parent: b4d7785)
author | Florian Forster <octo@collectd.org> | |
Wed, 20 Feb 2013 13:36:15 +0000 (14:36 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 20 Feb 2013 13:36:15 +0000 (14:36 +0100) |
src/collectd.conf.in | patch | blob | history | |
src/snort.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 0c80ac645713b790b609ef3427df2456363a3203..8065b0304f24b08fcaa0cdd06277d75c10f5ef8a 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
#<Plugin "snort">
# <Metric "dropped">
-# Type "pkt_drop_percent"
+# Type "percent"
+# Instance "dropped"
# Index 1
# </Metric>
# <Metric "mbps">
-# Type "wire_mbits_per_sec.realtime"
+# Type "bytes"
+# Instance "wire-realtime"
# Index 2
# </Metric>
# <Metric "alerts">
diff --git a/src/snort.c b/src/snort.c
index bf804f705538d8789f4ad785bf2e69c93873eefd..3fb48b6bf6323fa544413b3939ecddd1c1786757 100644 (file)
--- a/src/snort.c
+++ b/src/snort.c
struct metric_definition_s {
char *name;
char *type;
+ char *instance;
int data_source_type;
int index;
struct metric_definition_s *next;
sstrncpy(vl.plugin, "snort", sizeof(vl.plugin));
sstrncpy(vl.plugin_instance, id->name, sizeof(vl.plugin_instance));
sstrncpy(vl.type, md->type, sizeof(vl.type));
+ if (md->instance != NULL)
+ sstrncpy(vl.type_instance, md->instance, sizeof(vl.type_instance));
vl.time = id->last;
vl.interval = id->interval;
if (strcasecmp("Type", option->key) == 0)
status = cf_util_get_string(option, &md->type);
+ else if (strcasecmp("Instance", option->key) == 0)
+ status = cf_util_get_string(option, &md->instance);
else if (strcasecmp("Index", option->key) == 0)
status = snort_config_add_metric_index(md, option);
else {