]> arthur.barton.de Git - netdata.git/commitdiff
added node.d.conf and node.d markdown files to explain configuration
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 13 Oct 2016 19:33:22 +0000 (22:33 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 13 Oct 2016 19:33:22 +0000 (22:33 +0300)
conf.d/Makefile.am
conf.d/node.d.conf [new file with mode: 0644]
conf.d/node.d/named.conf.md [new file with mode: 0644]
conf.d/node.d/sma_webbox.conf.md [new file with mode: 0644]
conf.d/node.d/snmp.conf.md [new file with mode: 0644]
node.d/named.node.js
node.d/sma_webbox.node.js
node.d/snmp.node.js
plugins.d/node.d.plugin

index 066744cab721b9c3dad5ab5c56fa0814971d8a24..7806818e3baefddaeffd1389a22d7ee865c389d4 100644 (file)
@@ -6,6 +6,7 @@ MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
 dist_config_DATA = \
        apps_groups.conf \
        charts.d.conf \
+       node.d.conf \
        python.d.conf \
        health_alarm_notify.conf \
        health_email_recipients.conf \
@@ -17,6 +18,9 @@ dist_chartsconfig_DATA = \
 
 nodeconfigdir=$(configdir)/node.d
 dist_nodeconfig_DATA = \
+       node.d/named.conf.md \
+       node.d/sma_webbox.conf.md \
+       node.d/snmp.conf.md \
        $(NULL)
 
 pythonconfigdir=$(configdir)/python.d
diff --git a/conf.d/node.d.conf b/conf.d/node.d.conf
new file mode 100644 (file)
index 0000000..95aec99
--- /dev/null
@@ -0,0 +1,39 @@
+{\r
+       "___help_1": "Default options for node.d.plugin - this is a JSON file.",\r
+       "___help_2": "Use http://jsonlint.com/ to verify it is valid JSON.",\r
+       "___help_3": "------------------------------------------------------------",\r
+\r
+       "___help_update_every": "Minimum data collection frequency for all node.d/*.node.js modules. Set it to 0 to inherit it from netdata.",\r
+       "update_every": 0,\r
+\r
+       "___help_modules_enable_autodetect": "Enable/disable auto-detection for node.d/*.node.js modules that support it.",\r
+       "modules_enable_autodetect": true,\r
+\r
+       "___help_modules_enable_all": "Enable all node.d/*.node.js modules by default.",\r
+       "modules_enable_all": true,\r
+\r
+       "___help_modules": "Enable/disable the following modules. Give only XXX for node.d/XXX.node.js",\r
+       "modules": {\r
+               "named": {\r
+                       "enabled": true\r
+               },\r
+               "sma_webbox": {\r
+                       "enabled": true\r
+               },\r
+               "snmp": {\r
+                       "enabled": true\r
+               }\r
+       },\r
+\r
+       "___help_paths": "Paths that control the operation of node.d.plugin",\r
+       "paths": {\r
+               "___help_plugins": "The full path to the modules javascript node.d/ directory",\r
+               "plugins": null,\r
+\r
+               "___help_config": "The full path to the modules configs node.d/ directory",\r
+               "config": null,\r
+\r
+               "___help_modules": "Array of paths to add to node.js when searching for node_modules",\r
+               "modules": []\r
+       }\r
+}\r
diff --git a/conf.d/node.d/named.conf.md b/conf.d/node.d/named.conf.md
new file mode 100644 (file)
index 0000000..fa843dd
--- /dev/null
@@ -0,0 +1,344 @@
+# ISC Bind Statistics\r
+\r
+Using this netdata collector, you can monitor one or more ISC Bind servers.\r
+\r
+The source code for this plugin in [here](https://github.com/firehol/netdata/blob/master/node.d/named.node.js).\r
+\r
+## Example netdata charts\r
+\r
+Depending on the number of views your bind has, you may get a large number of charts.\r
+Here this is with just one view:\r
+\r
+![image](https://cloud.githubusercontent.com/assets/2662304/12765473/879b8e04-ca07-11e5-817d-b0651996c42b.png)\r
+![image](https://cloud.githubusercontent.com/assets/2662304/12766538/12b272fa-ca0d-11e5-81e1-6a9f8ff488ff.png)\r
+\r
+## How it works\r
+\r
+The plugin will execute (from within node.js) the equivalent of:\r
+\r
+```sh\r
+curl "http://localhost:8888/json/v1/server"\r
+```\r
+\r
+Here is a sample of the output this command produces.\r
+\r
+```js\r
+{\r
+  "json-stats-version":"1.0",\r
+  "boot-time":"2016-01-31T08:20:48Z",\r
+  "config-time":"2016-01-31T09:28:03Z",\r
+  "current-time":"2016-02-02T22:22:20Z",\r
+  "opcodes":{\r
+    "QUERY":247816,\r
+    "IQUERY":0,\r
+    "STATUS":0,\r
+    "RESERVED3":0,\r
+    "NOTIFY":0,\r
+    "UPDATE":3813,\r
+    "RESERVED6":0,\r
+    "RESERVED7":0,\r
+    "RESERVED8":0,\r
+    "RESERVED9":0,\r
+    "RESERVED10":0,\r
+    "RESERVED11":0,\r
+    "RESERVED12":0,\r
+    "RESERVED13":0,\r
+    "RESERVED14":0,\r
+    "RESERVED15":0\r
+  },\r
+  "qtypes":{\r
+    "A":89519,\r
+    "NS":863,\r
+    "CNAME":1,\r
+    "SOA":1,\r
+    "PTR":116779,\r
+    "MX":276,\r
+    "TXT":198,\r
+    "AAAA":39324,\r
+    "SRV":850,\r
+    "ANY":5\r
+  },\r
+  "nsstats":{\r
+    "Requestv4":251630,\r
+    "ReqEdns0":1255,\r
+    "ReqTSIG":3813,\r
+    "ReqTCP":57,\r
+    "AuthQryRej":1455,\r
+    "RecQryRej":122,\r
+    "Response":245918,\r
+    "TruncatedResp":44,\r
+    "RespEDNS0":1255,\r
+    "RespTSIG":3813,\r
+    "QrySuccess":205159,\r
+    "QryAuthAns":119495,\r
+    "QryNoauthAns":120770,\r
+    "QryNxrrset":32711,\r
+    "QrySERVFAIL":262,\r
+    "QryNXDOMAIN":2395,\r
+    "QryRecursion":40885,\r
+    "QryDuplicate":5712,\r
+    "QryFailure":1577,\r
+    "UpdateDone":2514,\r
+    "UpdateFail":1299,\r
+    "UpdateBadPrereq":1276,\r
+    "QryUDP":246194,\r
+    "QryTCP":45,\r
+    "OtherOpt":101\r
+  },\r
+  "views":{\r
+    "local":{\r
+      "resolver":{\r
+        "stats":{\r
+          "Queryv4":74577,\r
+          "Responsev4":67032,\r
+          "NXDOMAIN":601,\r
+          "SERVFAIL":5,\r
+          "FORMERR":7,\r
+          "EDNS0Fail":7,\r
+          "Truncated":3071,\r
+          "Lame":4,\r
+          "Retry":11826,\r
+          "QueryTimeout":1838,\r
+          "GlueFetchv4":6864,\r
+          "GlueFetchv4Fail":30,\r
+          "QryRTT10":112,\r
+          "QryRTT100":42900,\r
+          "QryRTT500":23275,\r
+          "QryRTT800":534,\r
+          "QryRTT1600":97,\r
+          "QryRTT1600+":20,\r
+          "BucketSize":31,\r
+          "REFUSED":13\r
+        },\r
+        "qtypes":{\r
+          "A":64931,\r
+          "NS":870,\r
+          "CNAME":185,\r
+          "PTR":5,\r
+          "MX":49,\r
+          "TXT":149,\r
+          "AAAA":7972,\r
+          "SRV":416\r
+        },\r
+        "cache":{\r
+          "A":40356,\r
+          "NS":8032,\r
+          "CNAME":14477,\r
+          "PTR":2,\r
+          "MX":21,\r
+          "TXT":32,\r
+          "AAAA":3301,\r
+          "SRV":94,\r
+          "DS":237,\r
+          "RRSIG":2301,\r
+          "NSEC":126,\r
+          "!A":52,\r
+          "!NS":4,\r
+          "!TXT":1,\r
+          "!AAAA":3797,\r
+          "!SRV":9,\r
+          "NXDOMAIN":590\r
+        },\r
+        "cachestats":{\r
+          "CacheHits":1085188,\r
+          "CacheMisses":109,\r
+          "QueryHits":464755,\r
+          "QueryMisses":55624,\r
+          "DeleteLRU":0,\r
+          "DeleteTTL":42615,\r
+          "CacheNodes":5188,\r
+          "CacheBuckets":2079,\r
+          "TreeMemTotal":2326026,\r
+          "TreeMemInUse":1508075,\r
+          "HeapMemMax":132096,\r
+          "HeapMemTotal":393216,\r
+          "HeapMemInUse":132096\r
+        },\r
+        "adb":{\r
+          "nentries":1021,\r
+          "entriescnt":3157,\r
+          "nnames":1021,\r
+          "namescnt":3022\r
+        }\r
+      }\r
+    },\r
+    "public":{\r
+      "resolver":{\r
+        "stats":{\r
+          "BucketSize":31\r
+        },\r
+        "qtypes":{\r
+        },\r
+        "cache":{\r
+        },\r
+        "cachestats":{\r
+          "CacheHits":0,\r
+          "CacheMisses":0,\r
+          "QueryHits":0,\r
+          "QueryMisses":0,\r
+          "DeleteLRU":0,\r
+          "DeleteTTL":0,\r
+          "CacheNodes":0,\r
+          "CacheBuckets":64,\r
+          "TreeMemTotal":287392,\r
+          "TreeMemInUse":29608,\r
+          "HeapMemMax":1024,\r
+          "HeapMemTotal":262144,\r
+          "HeapMemInUse":1024\r
+        },\r
+        "adb":{\r
+          "nentries":1021,\r
+          "nnames":1021\r
+        }\r
+      }\r
+    },\r
+    "_bind":{\r
+      "resolver":{\r
+        "stats":{\r
+          "BucketSize":31\r
+        },\r
+        "qtypes":{\r
+        },\r
+        "cache":{\r
+        },\r
+        "cachestats":{\r
+          "CacheHits":0,\r
+          "CacheMisses":0,\r
+          "QueryHits":0,\r
+          "QueryMisses":0,\r
+          "DeleteLRU":0,\r
+          "DeleteTTL":0,\r
+          "CacheNodes":0,\r
+          "CacheBuckets":64,\r
+          "TreeMemTotal":287392,\r
+          "TreeMemInUse":29608,\r
+          "HeapMemMax":1024,\r
+          "HeapMemTotal":262144,\r
+          "HeapMemInUse":1024\r
+        },\r
+        "adb":{\r
+          "nentries":1021,\r
+          "nnames":1021\r
+        }\r
+      }\r
+    }\r
+  }\r
+}\r
+```\r
+\r
+\r
+From this output it collects:\r
+\r
+- Global Received Requests by IP version (IPv4, IPv6)\r
+- Global Successful Queries\r
+- Current Recursive Clients\r
+- Global Queries by IP Protocol (TCP, UDP)\r
+- Global Queries Analysis\r
+- Global Received Updates\r
+- Global Query Failures\r
+- Global Query Failures Analysis\r
+- Other Global Server Statistics\r
+- Global Incoming Requests by OpCode\r
+- Global Incoming Requests by Query Type\r
+- Global Socket Statistics (will only work if the url is `http://127.0.0.1:8888/json/v1`, i.e. without `/server`, but keep in mind this produces a very long output and probably will account for 0.5% CPU overhead alone, per bind server added)\r
+- Per View Statistics (the following set will be added for each bind view):\r
+   - View, Resolver Active Queries\r
+   - View, Resolver Statistics\r
+   - View, Resolver Round Trip Timings\r
+   - View, Requests by Query Type\r
+\r
+## Configuration\r
+\r
+The collector (optionally) reads a configuration file named `/etc/netdata/node.d/named.conf`, with the following contents:\r
+\r
+```js\r
+{\r
+    "enable_autodetect": true,\r
+    "update_every": 5,\r
+    "servers": [\r
+        {\r
+            "name": "bind1",\r
+            "url": "http://127.0.0.1:8888/json/v1/server",\r
+            "update_every": 1\r
+        },\r
+        {\r
+            "name": "bind2",\r
+            "url": "http://10.1.2.3:8888/json/v1/server",\r
+            "update_every": 2\r
+        }\r
+    ]\r
+}\r
+```\r
+\r
+You can add any number of bind servers.\r
+\r
+If the configuration file is missing, or the key `enable_autodetect` is `true`, the collector will also attempt to fetch `http://localhost:8888/json/v1/server` which, if successful will be added too.\r
+\r
+### XML instead of JSON, from bind\r
+\r
+The collector can also accept bind URLs that return XML output. This might required if you cannot have bind 9.10+ with JSON but you have an version of bind that supports XML statistics v3. Check [this](https://www.isc.org/blogs/bind-9-10-statistics-troubleshooting-and-zone-configuration/) for versions supported.\r
+\r
+In such cases, use a URL like this:\r
+\r
+```sh\r
+curl "http://localhost:8888/xml/v3/server"\r
+```\r
+\r
+Only `xml` and `v3` has been tested.\r
+\r
+Keep in mind though, that XML parsing is done using javascript code, which requires a triple conversion:\r
+\r
+1. from XML to JSON using a javascript XML parser (**CPU intensive**),\r
+2. which is then transformed to emulate the output of the JSON output of bind (**CPU intensive** - and yes the converted JSON from XML is different to the native JSON - even bind produces different names for various attributes),\r
+3. which is then processed to generate the data for the charts (this will happen even if bind is producing JSON).\r
+\r
+In general, expect XML parsing to be 2 to 3 times more CPU intensive than JSON.\r
+\r
+**So, if you can use the JSON output of bind, prefer it over XML**. Keep also in mind that even bind will use more CPU when generating XML instead of JSON.\r
+\r
+The XML interface of bind is not autodetected.\r
+You will have to provide the config file `/etc/netdata/node.d/named.conf`, like this:\r
+\r
+```js\r
+{\r
+    "enable_autodetect": false,\r
+    "update_every": 1,\r
+    "servers": [\r
+        {\r
+            "name": "local",\r
+            "url": "http://localhost:8888/xml/v3/server",\r
+            "update_every": 1\r
+        }\r
+    ]\r
+}\r
+```\r
+\r
+Of course, you can monitor more than one bind servers. Each one can be configured with either JSON or XML output.\r
+\r
+## Auto-detection\r
+\r
+Auto-detection is controlled by `enable_autodetect` in the config file. The default is enabled, so that if the collector can connect to `http://localhost:8888/json/v1/server` to receive bind statistics, it will automatically enable it.\r
+\r
+## Bind (named) configuration\r
+\r
+To use this plugin, you have to have bind v9.10+ properly compiled to provide statistics in `JSON` format.\r
+\r
+For more information on how to get your bind installation ready, please refer to the [bind statistics channel developer comments](http://jpmens.net/2013/03/18/json-in-bind-9-s-statistics-server/) and to [bind documentation](https://ftp.isc.org/isc/bind/9.10.3/doc/arm/Bv9ARM.ch06.html#statistics) or [bind Knowledge Base article AA-01123](https://kb.isc.org/article/AA-01123/0).\r
+\r
+Normally, you will need something like this in your `named.conf`:\r
+\r
+```\r
+statistics-channels {\r
+        inet 127.0.0.1 port 8888 allow { 127.0.0.1; };\r
+        inet ::1 port 8888 allow { ::1; };\r
+};\r
+```\r
+\r
+(use the IPv4 or IPv6 line depending on what you are using, you can also use both)\r
+\r
+Verify it works by running the following command (the collector is written in node.js and will query your bind server directly, but if this command works, the collector should be able to work too):\r
+\r
+```sh\r
+curl "http://localhost:8888/json/v1/server"\r
+```\r
+\r
diff --git a/conf.d/node.d/sma_webbox.conf.md b/conf.d/node.d/sma_webbox.conf.md
new file mode 100644 (file)
index 0000000..b729385
--- /dev/null
@@ -0,0 +1,25 @@
+\r
+Example netdata configuration for node.d/sma_webbox.conf\r
+The module supports any number of name servers, like this:\r
+\r
+WHEN PLACED AS node.d/sma_webbox.conf THIS FILE SHOULD BE VALID JSON.\r
+YOU CAN CHECK JSON VALIDITY AT http://jsonlint.com/\r
+\r
+YOU HAVE TO DELETE THE COMMENTS - JSON DOES NOT SUPPORT COMMENTS.\r
+\r
+{\r
+    "enable_autodetect": false,\r
+    "update_every": 5,\r
+    "servers": [\r
+        {\r
+            "name": "plant1",\r
+            "hostname": "10.0.1.1",\r
+            "update_every": 10\r
+        },\r
+        {\r
+            "name": "plant2",\r
+            "hostname": "10.0.2.1",\r
+            "update_every": 15\r
+        }\r
+    ]\r
+}\r
diff --git a/conf.d/node.d/snmp.conf.md b/conf.d/node.d/snmp.conf.md
new file mode 100644 (file)
index 0000000..bae5bf2
--- /dev/null
@@ -0,0 +1,341 @@
+# SNMP Data Collector\r
+\r
+Using this collector, netdata can collect data from any SNMP device.\r
+\r
+This collector supports:\r
+\r
+- any number of SNMP devices\r
+- each SNMP device can be used to collect data for any number of charts\r
+- each chart may have any number of dimensions\r
+- each SNMP device may have a different update frequency\r
+- each SNMP device will accept one or more batches to report values (you can set `max_request_size` per SNMP server, to control the size of batches).\r
+\r
+The source code of the plugin is [here](https://github.com/firehol/netdata/blob/master/node.d/snmp.node.js).\r
+\r
+## Configuration\r
+\r
+You will need to create the file `/etc/netdata/node.d/snmp.conf` with data like the following.\r
+\r
+In this example:\r
+\r
+ - the SNMP device is `10.11.12.8`.\r
+ - the SNMP community is `public`.\r
+ - we will update the values every 10 seconds (`update_every: 10` under the server `10.11.12.8`).\r
+ - we define 2 charts `snmp_switch.bandwidth_port1` and `snmp_switch.bandwidth_port2`, each having 2 dimensions: `in` and `out`.\r
+\r
+```js\r
+{\r
+    "enable_autodetect": false,\r
+    "update_every": 5,\r
+    "max_request_size": 100,\r
+    "servers": [\r
+        {\r
+            "hostname": "10.11.12.8",\r
+            "community": "public",\r
+            "update_every": 10,\r
+            "max_request_size": 50,\r
+            "options": { "timeout": 10000 },\r
+            "charts": {\r
+                "snmp_switch.bandwidth_port1": {\r
+                    "title": "Switch Bandwidth for port 1",\r
+                    "units": "kilobits/s",\r
+                    "type": "area",\r
+                    "priority": 1,\r
+                    "family": "ports",\r
+                    "dimensions": {\r
+                        "in": {\r
+                            "oid": "1.3.6.1.2.1.2.2.1.10.1",\r
+                            "algorithm": "incremental",\r
+                            "multiplier": 8,\r
+                            "divisor": 1024\r
+                        },\r
+                        "out": {\r
+                            "oid": "1.3.6.1.2.1.2.2.1.16.1",\r
+                            "algorithm": "incremental",\r
+                            "multiplier": -8,\r
+                            "divisor": 1024\r
+                        }\r
+                    }\r
+                },\r
+                "snmp_switch.bandwidth_port2": {\r
+                    "title": "Switch Bandwidth for port 2",\r
+                    "units": "kilobits/s",\r
+                    "type": "area",\r
+                    "priority": 1,\r
+                    "family": "ports",\r
+                    "dimensions": {\r
+                        "in": {\r
+                            "oid": "1.3.6.1.2.1.2.2.1.10.2",\r
+                            "algorithm": "incremental",\r
+                            "multiplier": 8,\r
+                            "divisor": 1024\r
+                        },\r
+                        "out": {\r
+                            "oid": "1.3.6.1.2.1.2.2.1.16.2",\r
+                            "algorithm": "incremental",\r
+                            "multiplier": -8,\r
+                            "divisor": 1024\r
+                        }\r
+                    }\r
+                }\r
+            }\r
+        }\r
+    ]\r
+}\r
+```\r
+\r
+`update_every` is the update frequency for each server, in seconds.\r
+\r
+`max_request_size` limits the maximum number of OIDs that will be requested in a single call. The default is 50. Lower this number of you get `TooBig` errors in netdata error.log.\r
+\r
+`family` sets the name of the submenu of the dashboard each chart will appear under.\r
+\r
+If you need to define many charts using incremental OIDs, you can use something like this:\r
+\r
+This is like the previous, but the option `multiply_range` given, will multiply the current chart from `1` to `24` inclusive, producing 24 charts in total for the 24 ports of the switch `10.11.12.8`.\r
+\r
+Each of the 24 new charts will have its id (1-24) appended at:\r
+\r
+1. its chart unique id, i.e. `snmp_switch.bandwidth_port1` to `snmp_switch.bandwidth_port24`\r
+2. its `title`, i.e. `Switch Bandwidth for port 1` to `Switch Bandwidth for port 24`\r
+3. its `oid` (for all dimensions), i.e. dimension `in` will be `1.3.6.1.2.1.2.2.1.10.1` to `1.3.6.1.2.1.2.2.1.10.24`\r
+3. its priority (which will be incremented for each chart so that the charts will appear on the dashboard in this order)\r
+\r
+```js\r
+{\r
+    "enable_autodetect": false,\r
+    "update_every": 10,\r
+    "servers": [\r
+        {\r
+            "hostname": "10.11.12.8",\r
+            "community": "public",\r
+            "update_every": 10,\r
+            "options": { "timeout": 20000 },\r
+            "charts": {\r
+                "snmp_switch.bandwidth_port": {\r
+                    "title": "Switch Bandwidth for port ",\r
+                    "units": "kilobits/s",\r
+                    "type": "area",\r
+                    "priority": 1,\r
+                    "family": "ports",\r
+                    "multiply_range": [ 1, 24 ],\r
+                    "dimensions": {\r
+                        "in": {\r
+                            "oid": "1.3.6.1.2.1.2.2.1.10.",\r
+                            "algorithm": "incremental",\r
+                            "multiplier": 8,\r
+                            "divisor": 1024\r
+                        },\r
+                        "out": {\r
+                            "oid": "1.3.6.1.2.1.2.2.1.16.",\r
+                            "algorithm": "incremental",\r
+                            "multiplier": -8,\r
+                            "divisor": 1024\r
+                        }\r
+                    }\r
+                }\r
+            }\r
+        }\r
+    ]\r
+}\r
+```\r
+\r
+The `options` given for each server, are:\r
+\r
+ - `timeout`, the time to wait for the SNMP device to respond. The default is 5000 ms.\r
+ - `version`, the SNMP version to use. `0` is Version 1, `1` is Version 2c. The default is Version 1 (`0`).\r
+ - `transport`, the default is `udp4`.\r
+ - `port`, the port of the SNMP device to connect to. The default is `161`.\r
+ - `retries`, the number of attempts to make to fetch the data. The default is `1`.\r
+\r
+## Retreiving names from snmp\r
+\r
+You can append a value retrieved from SNMP to the title, by adding `titleoid` to the chart.\r
+\r
+You can set a dimension name to a value retrieved from SNMP, by adding `oidname` to the dimension.\r
+\r
+Both of the above will participate in `multiply_range`.\r
+\r
+\r
+## Testing the configuration\r
+\r
+To test it, you can run:\r
+\r
+```sh\r
+/usr/libexec/netdata/plugins.d/node.d.plugin 1 snmp\r
+```\r
+\r
+The above will run it on your console and you will be able to see what netdata sees, but also errors. You can get a very detailed output by appending `debug` to the command line.\r
+\r
+If it works, restart netdata to activate the snmp collector and refresh the dashboard (if your SNMP device responds with a delay, you may need to refresh the dashboard in a few seconds).\r
+\r
+## Data collection speed\r
+\r
+Keep in mind that many SNMP switches are routers are very slow. They may not be able to report values per second. If you run `node.d.plugin` in `debug` mode, it will report the time it took for the SNMP device to respond. My switch, for example, needs 7-8 seconds to respond for the traffic on 24 ports (48 OIDs, in/out).\r
+\r
+Also, if you use many SNMP clients on the same SNMP device at the same time, values may be skipped. This is a problem of the SNMP device, not this collector.\r
+\r
+## Finding OIDs\r
+\r
+Use `snmpwalk`, like this:\r
+\r
+```sh\r
+snmpwalk -t 20 -v 1 -O fn -c public 10.11.12.8\r
+```\r
+\r
+- `-t 20` is the timeout in seconds\r
+- `-v 1` is the SNMP version\r
+- `-O fn` will display full OIDs in numeric format (you may want to run it also without this option to see human readable output of OIDs)\r
+- `-c public` is the SNMP community\r
+- `10.11.12.8` is the SNMP device\r
+\r
+Keep in mind that `snmpwalk` outputs the OIDs with a dot in front them. You should remove this dot when adding OIDs to the configuration file of this collector.\r
+\r
+## Example: Linksys SRW2024P\r
+\r
+This is what I use for my Linksys SRW2024P. It creates:\r
+\r
+1. A chart for power consumption (it is a PoE switch)\r
+2. Two charts for packets received (total packets received and packets received with errors)\r
+3. One chart for packets output\r
+4. 24 charts, one for each port of the switch. It also appends the port names, as defined at the switch, to the chart titles.\r
+\r
+This switch also reports various other metrics, like snmp, packets per port, etc. Unfortunately it does not report CPU utilization or backplane utilization.\r
+\r
+This switch has a very slow SNMP processors. To respond, it needs about 8 seconds, so I have set the refresh frequency (`update_every`) to 15 seconds.\r
+\r
+```js\r
+{\r
+        "enable_autodetect": false,\r
+        "update_every": 5,\r
+        "servers": [\r
+                {\r
+                        "hostname": "10.11.12.8",\r
+                        "community": "public",\r
+                        "update_every": 15,\r
+                        "options": { "timeout": 20000, "version": 1 },\r
+                        "charts": {\r
+                                "snmp_switch.power": {\r
+                                        "title": "Switch Power Supply",\r
+                                        "units": "watts",\r
+                                        "type": "line",\r
+                                        "priority": 10,\r
+                                        "family": "power",\r
+                                        "dimensions": {\r
+                                                "supply": {\r
+                                                        "oid": ".1.3.6.1.2.1.105.1.3.1.1.2.1",\r
+                                                        "algorithm": "absolute",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                },\r
+                                                "used": {\r
+                                                        "oid": ".1.3.6.1.2.1.105.1.3.1.1.4.1",\r
+                                                        "algorithm": "absolute",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                        }\r
+                                }\r
+                                , "snmp_switch.input": {\r
+                                        "title": "Switch Packets Input",\r
+                                        "units": "packets/s",\r
+                                        "type": "area",\r
+                                        "priority": 20,\r
+                                        "family": "IP",\r
+                                        "dimensions": {\r
+                                                "receives": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.3.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                                , "discards": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.8.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                        }\r
+                                }\r
+                                , "snmp_switch.input_errors": {\r
+                                        "title": "Switch Received Packets with Errors",\r
+                                        "units": "packets/s",\r
+                                        "type": "line",\r
+                                        "priority": 30,\r
+                                        "family": "IP",\r
+                                        "dimensions": {\r
+                                                "bad_header": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.4.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                                , "bad_address": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.5.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                                , "unknown_protocol": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.7.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                        }\r
+                                }\r
+                                , "snmp_switch.output": {\r
+                                        "title": "Switch Output Packets",\r
+                                        "units": "packets/s",\r
+                                        "type": "line",\r
+                                        "priority": 40,\r
+                                        "family": "IP",\r
+                                        "dimensions": {\r
+                                                "requests": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.10.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": 1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                                , "discards": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.11.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": -1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                                , "no_route": {\r
+                                                        "oid": ".1.3.6.1.2.1.4.12.0",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": -1,\r
+                                                        "divisor": 1\r
+                                                }\r
+                                        }\r
+                                }\r
+                                , "snmp_switch.bandwidth_port": {\r
+                                        "title": "Switch Bandwidth for port ",\r
+                                        "titleoid": ".1.3.6.1.2.1.31.1.1.1.18.",\r
+                                        "units": "kilobits/s",\r
+                                        "type": "area",\r
+                                        "priority": 100,\r
+                                        "family": "ports",\r
+                                        "multiply_range": [ 1, 24 ],\r
+                                        "dimensions": {\r
+                                                "in": {\r
+                                                        "oid": ".1.3.6.1.2.1.2.2.1.10.",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": 8,\r
+                                                        "divisor": 1024\r
+                                                }\r
+                                                , "out": {\r
+                                                        "oid": ".1.3.6.1.2.1.2.2.1.16.",\r
+                                                        "algorithm": "incremental",\r
+                                                        "multiplier": -8,\r
+                                                        "divisor": 1024\r
+                                                }\r
+                                        }\r
+                                }\r
+                        }\r
+                }\r
+        ]\r
+}\r
+```\r
index 19b8ce29bdf10ade8596d18dde36ae8ae7482932..54e80388a333b909f695664c28aa5f506c005977 100644 (file)
@@ -6,8 +6,8 @@
 // http://jpmens.net/2013/03/18/json-in-bind-9-s-statistics-server/
 // https://ftp.isc.org/isc/bind/9.10.3/doc/arm/Bv9ARM.ch06.html#statistics
 
-// example configuration in /etc/netdata/named.conf
-// the module supports auto-detection if bind is running in localhost
+// example configuration in /etc/netdata/node.d/named.conf
+// the module supports auto-detection if bind is running at localhost
 
 /*
 {
index 3dd17a5c123172ff1732b636c431bf34b79df258..3d99943d4d0cadee643f3e31cef2f2cc89a25a9f 100644 (file)
@@ -3,7 +3,7 @@
 // This program will connect to one or more SMA Sunny Webboxes
 // to get the Solar Power Generated (current, today, total).
 
-// example configuration in /etc/netdata/sma_webbox.conf
+// example configuration in /etc/netdata/node.d/sma_webbox.conf
 /*
 {
     "enable_autodetect": false,
index ddc8985270be68ebd6c4e3a8d17e415f8273fdef..d1563e19681a0a80e040b7dd2eb7cd2a8cdfcf33 100644 (file)
@@ -2,7 +2,7 @@
 
 // This program will connect to one or more SNMP Agents
 
-// example configuration in /etc/netdata/snmp.conf
+// example configuration in /etc/netdata/node.d/snmp.conf
 /*
 {
     "enable_autodetect": false,
index 21b04384e8ca87607e36cd747e9966d59351c3fa..df96ecb207e05a266ed22a9c04b0e6999e9c1582 100755 (executable)
@@ -30,6 +30,7 @@ process.mainModule.paths.unshift(NODE_D_DIR);
 
 var fs = require('fs');
 var url = require('url');
+var util = require('util');
 var http = require('http');
 var path = require('path');
 var extend = require('extend');
@@ -61,8 +62,6 @@ extend(true, netdata.options, {
 
     update_every: NETDATA_UPDATE_EVERY,
 
-    exit_after_ms: 3600 * 4 * 1000,
-
     paths: {
         plugins: NETDATA_PLUGINS_DIR,
         config: NETDATA_CONFIG_DIR,
@@ -79,8 +78,15 @@ netdata.options.config_filename = pluginConfig(__filename);
 try {
     netdata.options_loaded = JSON.parse(fs.readFileSync(netdata.options.config_filename, 'utf8'));
     extend(true, netdata.options, netdata.options_loaded);
-    console.error('merged netdata object:');
-    console.error(netdata);
+
+    if(!netdata.options.paths.plugins)
+        netdata.options.paths.plugins = NETDATA_PLUGINS_DIR;
+
+    if(!netdata.options.paths.config)
+        netdata.options.paths.config = NETDATA_CONFIG_DIR;
+
+    // console.error('merged netdata object:');
+    // console.error(util.inspect(netdata, {depth: 10}));
 }
 catch(e) {
     netdata.error('Cannot read configuration file ' + netdata.options.config_filename + ': ' + e.message + ', using internal defaults.');