@cryptotaxi247 / netdata-1 / commits / 6c86a447a

added node.d.conf and node.d markdown files to explain configuration

Costa Tsaousis (ktsaou) committed Oct 13, 2016 at 22:33 UTC 6c86a447a08595c354a6389924f60493cd1a3f67
9 files changed +767 -8
conf.d/Makefile.am
+4
@@ -6,6 +6,7 @@ MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
6 dist_config_DATA = \
7 apps_groups.conf \
8 charts.d.conf \
9 + node.d.conf \
10 python.d.conf \
11 health_alarm_notify.conf \
12 health_email_recipients.conf \
@@ -17,6 +18,9 @@ dist_chartsconfig_DATA = \
18
19 nodeconfigdir=$(configdir)/node.d
20 dist_nodeconfig_DATA = \
21 + node.d/named.conf.md \
22 + node.d/sma_webbox.conf.md \
23 + node.d/snmp.conf.md \
24 $(NULL)
25
26 pythonconfigdir=$(configdir)/python.d
conf.d/node.d.conf new
+39
@@ -0,0 +1,39 @@
1 +{
2 + "___help_1": "Default options for node.d.plugin - this is a JSON file.",
3 + "___help_2": "Use http://jsonlint.com/ to verify it is valid JSON.",
4 + "___help_3": "------------------------------------------------------------",
5 +
6 + "___help_update_every": "Minimum data collection frequency for all node.d/*.node.js modules. Set it to 0 to inherit it from netdata.",
7 + "update_every": 0,
8 +
9 + "___help_modules_enable_autodetect": "Enable/disable auto-detection for node.d/*.node.js modules that support it.",
10 + "modules_enable_autodetect": true,
11 +
12 + "___help_modules_enable_all": "Enable all node.d/*.node.js modules by default.",
13 + "modules_enable_all": true,
14 +
15 + "___help_modules": "Enable/disable the following modules. Give only XXX for node.d/XXX.node.js",
16 + "modules": {
17 + "named": {
18 + "enabled": true
19 + },
20 + "sma_webbox": {
21 + "enabled": true
22 + },
23 + "snmp": {
24 + "enabled": true
25 + }
26 + },
27 +
28 + "___help_paths": "Paths that control the operation of node.d.plugin",
29 + "paths": {
30 + "___help_plugins": "The full path to the modules javascript node.d/ directory",
31 + "plugins": null,
32 +
33 + "___help_config": "The full path to the modules configs node.d/ directory",
34 + "config": null,
35 +
36 + "___help_modules": "Array of paths to add to node.js when searching for node_modules",
37 + "modules": []
38 + }
39 +}
conf.d/node.d/named.conf.md new
+344
@@ -0,0 +1,344 @@
1 +# ISC Bind Statistics
2 +
3 +Using this netdata collector, you can monitor one or more ISC Bind servers.
4 +
5 +The source code for this plugin in [here](https://github.com/firehol/netdata/blob/master/node.d/named.node.js).
6 +
7 +## Example netdata charts
8 +
9 +Depending on the number of views your bind has, you may get a large number of charts.
10 +Here this is with just one view:
11 +
12 +![image](https://cloud.githubusercontent.com/assets/2662304/12765473/879b8e04-ca07-11e5-817d-b0651996c42b.png)
13 +![image](https://cloud.githubusercontent.com/assets/2662304/12766538/12b272fa-ca0d-11e5-81e1-6a9f8ff488ff.png)
14 +
15 +## How it works
16 +
17 +The plugin will execute (from within node.js) the equivalent of:
18 +
19 +```sh
20 +curl "http://localhost:8888/json/v1/server"
21 +```
22 +
23 +Here is a sample of the output this command produces.
24 +
25 +```js
26 +{
27 + "json-stats-version":"1.0",
28 + "boot-time":"2016-01-31T08:20:48Z",
29 + "config-time":"2016-01-31T09:28:03Z",
30 + "current-time":"2016-02-02T22:22:20Z",
31 + "opcodes":{
32 + "QUERY":247816,
33 + "IQUERY":0,
34 + "STATUS":0,
35 + "RESERVED3":0,
36 + "NOTIFY":0,
37 + "UPDATE":3813,
38 + "RESERVED6":0,
39 + "RESERVED7":0,
40 + "RESERVED8":0,
41 + "RESERVED9":0,
42 + "RESERVED10":0,
43 + "RESERVED11":0,
44 + "RESERVED12":0,
45 + "RESERVED13":0,
46 + "RESERVED14":0,
47 + "RESERVED15":0
48 + },
49 + "qtypes":{
50 + "A":89519,
51 + "NS":863,
52 + "CNAME":1,
53 + "SOA":1,
54 + "PTR":116779,
55 + "MX":276,
56 + "TXT":198,
57 + "AAAA":39324,
58 + "SRV":850,
59 + "ANY":5
60 + },
61 + "nsstats":{
62 + "Requestv4":251630,
63 + "ReqEdns0":1255,
64 + "ReqTSIG":3813,
65 + "ReqTCP":57,
66 + "AuthQryRej":1455,
67 + "RecQryRej":122,
68 + "Response":245918,
69 + "TruncatedResp":44,
70 + "RespEDNS0":1255,
71 + "RespTSIG":3813,
72 + "QrySuccess":205159,
73 + "QryAuthAns":119495,
74 + "QryNoauthAns":120770,
75 + "QryNxrrset":32711,
76 + "QrySERVFAIL":262,
77 + "QryNXDOMAIN":2395,
78 + "QryRecursion":40885,
79 + "QryDuplicate":5712,
80 + "QryFailure":1577,
81 + "UpdateDone":2514,
82 + "UpdateFail":1299,
83 + "UpdateBadPrereq":1276,
84 + "QryUDP":246194,
85 + "QryTCP":45,
86 + "OtherOpt":101
87 + },
88 + "views":{
89 + "local":{
90 + "resolver":{
91 + "stats":{
92 + "Queryv4":74577,
93 + "Responsev4":67032,
94 + "NXDOMAIN":601,
95 + "SERVFAIL":5,
96 + "FORMERR":7,
97 + "EDNS0Fail":7,
98 + "Truncated":3071,
99 + "Lame":4,
100 + "Retry":11826,
101 + "QueryTimeout":1838,
102 + "GlueFetchv4":6864,
103 + "GlueFetchv4Fail":30,
104 + "QryRTT10":112,
105 + "QryRTT100":42900,
106 + "QryRTT500":23275,
107 + "QryRTT800":534,
108 + "QryRTT1600":97,
109 + "QryRTT1600+":20,
110 + "BucketSize":31,
111 + "REFUSED":13
112 + },
113 + "qtypes":{
114 + "A":64931,
115 + "NS":870,
116 + "CNAME":185,
117 + "PTR":5,
118 + "MX":49,
119 + "TXT":149,
120 + "AAAA":7972,
121 + "SRV":416
122 + },
123 + "cache":{
124 + "A":40356,
125 + "NS":8032,
126 + "CNAME":14477,
127 + "PTR":2,
128 + "MX":21,
129 + "TXT":32,
130 + "AAAA":3301,
131 + "SRV":94,
132 + "DS":237,
133 + "RRSIG":2301,
134 + "NSEC":126,
135 + "!A":52,
136 + "!NS":4,
137 + "!TXT":1,
138 + "!AAAA":3797,
139 + "!SRV":9,
140 + "NXDOMAIN":590
141 + },
142 + "cachestats":{
143 + "CacheHits":1085188,
144 + "CacheMisses":109,
145 + "QueryHits":464755,
146 + "QueryMisses":55624,
147 + "DeleteLRU":0,
148 + "DeleteTTL":42615,
149 + "CacheNodes":5188,
150 + "CacheBuckets":2079,
151 + "TreeMemTotal":2326026,
152 + "TreeMemInUse":1508075,
153 + "HeapMemMax":132096,
154 + "HeapMemTotal":393216,
155 + "HeapMemInUse":132096
156 + },
157 + "adb":{
158 + "nentries":1021,
159 + "entriescnt":3157,
160 + "nnames":1021,
161 + "namescnt":3022
162 + }
163 + }
164 + },
165 + "public":{
166 + "resolver":{
167 + "stats":{
168 + "BucketSize":31
169 + },
170 + "qtypes":{
171 + },
172 + "cache":{
173 + },
174 + "cachestats":{
175 + "CacheHits":0,
176 + "CacheMisses":0,
177 + "QueryHits":0,
178 + "QueryMisses":0,
179 + "DeleteLRU":0,
180 + "DeleteTTL":0,
181 + "CacheNodes":0,
182 + "CacheBuckets":64,
183 + "TreeMemTotal":287392,
184 + "TreeMemInUse":29608,
185 + "HeapMemMax":1024,
186 + "HeapMemTotal":262144,
187 + "HeapMemInUse":1024
188 + },
189 + "adb":{
190 + "nentries":1021,
191 + "nnames":1021
192 + }
193 + }
194 + },
195 + "_bind":{
196 + "resolver":{
197 + "stats":{
198 + "BucketSize":31
199 + },
200 + "qtypes":{
201 + },
202 + "cache":{
203 + },
204 + "cachestats":{
205 + "CacheHits":0,
206 + "CacheMisses":0,
207 + "QueryHits":0,
208 + "QueryMisses":0,
209 + "DeleteLRU":0,
210 + "DeleteTTL":0,
211 + "CacheNodes":0,
212 + "CacheBuckets":64,
213 + "TreeMemTotal":287392,
214 + "TreeMemInUse":29608,
215 + "HeapMemMax":1024,
216 + "HeapMemTotal":262144,
217 + "HeapMemInUse":1024
218 + },
219 + "adb":{
220 + "nentries":1021,
221 + "nnames":1021
222 + }
223 + }
224 + }
225 + }
226 +}
227 +```
228 +
229 +
230 +From this output it collects:
231 +
232 +- Global Received Requests by IP version (IPv4, IPv6)
233 +- Global Successful Queries
234 +- Current Recursive Clients
235 +- Global Queries by IP Protocol (TCP, UDP)
236 +- Global Queries Analysis
237 +- Global Received Updates
238 +- Global Query Failures
239 +- Global Query Failures Analysis
240 +- Other Global Server Statistics
241 +- Global Incoming Requests by OpCode
242 +- Global Incoming Requests by Query Type
243 +- 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)
244 +- Per View Statistics (the following set will be added for each bind view):
245 + - View, Resolver Active Queries
246 + - View, Resolver Statistics
247 + - View, Resolver Round Trip Timings
248 + - View, Requests by Query Type
249 +
250 +## Configuration
251 +
252 +The collector (optionally) reads a configuration file named `/etc/netdata/node.d/named.conf`, with the following contents:
253 +
254 +```js
255 +{
256 + "enable_autodetect": true,
257 + "update_every": 5,
258 + "servers": [
259 + {
260 + "name": "bind1",
261 + "url": "http://127.0.0.1:8888/json/v1/server",
262 + "update_every": 1
263 + },
264 + {
265 + "name": "bind2",
266 + "url": "http://10.1.2.3:8888/json/v1/server",
267 + "update_every": 2
268 + }
269 + ]
270 +}
271 +```
272 +
273 +You can add any number of bind servers.
274 +
275 +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.
276 +
277 +### XML instead of JSON, from bind
278 +
279 +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.
280 +
281 +In such cases, use a URL like this:
282 +
283 +```sh
284 +curl "http://localhost:8888/xml/v3/server"
285 +```
286 +
287 +Only `xml` and `v3` has been tested.
288 +
289 +Keep in mind though, that XML parsing is done using javascript code, which requires a triple conversion:
290 +
291 +1. from XML to JSON using a javascript XML parser (**CPU intensive**),
292 +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),
293 +3. which is then processed to generate the data for the charts (this will happen even if bind is producing JSON).
294 +
295 +In general, expect XML parsing to be 2 to 3 times more CPU intensive than JSON.
296 +
297 +**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.
298 +
299 +The XML interface of bind is not autodetected.
300 +You will have to provide the config file `/etc/netdata/node.d/named.conf`, like this:
301 +
302 +```js
303 +{
304 + "enable_autodetect": false,
305 + "update_every": 1,
306 + "servers": [
307 + {
308 + "name": "local",
309 + "url": "http://localhost:8888/xml/v3/server",
310 + "update_every": 1
311 + }
312 + ]
313 +}
314 +```
315 +
316 +Of course, you can monitor more than one bind servers. Each one can be configured with either JSON or XML output.
317 +
318 +## Auto-detection
319 +
320 +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.
321 +
322 +## Bind (named) configuration
323 +
324 +To use this plugin, you have to have bind v9.10+ properly compiled to provide statistics in `JSON` format.
325 +
326 +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).
327 +
328 +Normally, you will need something like this in your `named.conf`:
329 +
330 +```
331 +statistics-channels {
332 + inet 127.0.0.1 port 8888 allow { 127.0.0.1; };
333 + inet ::1 port 8888 allow { ::1; };
334 +};
335 +```
336 +
337 +(use the IPv4 or IPv6 line depending on what you are using, you can also use both)
338 +
339 +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):
340 +
341 +```sh
342 +curl "http://localhost:8888/json/v1/server"
343 +```
344 +
conf.d/node.d/sma_webbox.conf.md new
+25
@@ -0,0 +1,25 @@
1 +
2 +Example netdata configuration for node.d/sma_webbox.conf
3 +The module supports any number of name servers, like this:
4 +
5 +WHEN PLACED AS node.d/sma_webbox.conf THIS FILE SHOULD BE VALID JSON.
6 +YOU CAN CHECK JSON VALIDITY AT http://jsonlint.com/
7 +
8 +YOU HAVE TO DELETE THE COMMENTS - JSON DOES NOT SUPPORT COMMENTS.
9 +
10 +{
11 + "enable_autodetect": false,
12 + "update_every": 5,
13 + "servers": [
14 + {
15 + "name": "plant1",
16 + "hostname": "10.0.1.1",
17 + "update_every": 10
18 + },
19 + {
20 + "name": "plant2",
21 + "hostname": "10.0.2.1",
22 + "update_every": 15
23 + }
24 + ]
25 +}
conf.d/node.d/snmp.conf.md new
+341
@@ -0,0 +1,341 @@
1 +# SNMP Data Collector
2 +
3 +Using this collector, netdata can collect data from any SNMP device.
4 +
5 +This collector supports:
6 +
7 +- any number of SNMP devices
8 +- each SNMP device can be used to collect data for any number of charts
9 +- each chart may have any number of dimensions
10 +- each SNMP device may have a different update frequency
11 +- 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).
12 +
13 +The source code of the plugin is [here](https://github.com/firehol/netdata/blob/master/node.d/snmp.node.js).
14 +
15 +## Configuration
16 +
17 +You will need to create the file `/etc/netdata/node.d/snmp.conf` with data like the following.
18 +
19 +In this example:
20 +
21 + - the SNMP device is `10.11.12.8`.
22 + - the SNMP community is `public`.
23 + - we will update the values every 10 seconds (`update_every: 10` under the server `10.11.12.8`).
24 + - we define 2 charts `snmp_switch.bandwidth_port1` and `snmp_switch.bandwidth_port2`, each having 2 dimensions: `in` and `out`.
25 +
26 +```js
27 +{
28 + "enable_autodetect": false,
29 + "update_every": 5,
30 + "max_request_size": 100,
31 + "servers": [
32 + {
33 + "hostname": "10.11.12.8",
34 + "community": "public",
35 + "update_every": 10,
36 + "max_request_size": 50,
37 + "options": { "timeout": 10000 },
38 + "charts": {
39 + "snmp_switch.bandwidth_port1": {
40 + "title": "Switch Bandwidth for port 1",
41 + "units": "kilobits/s",
42 + "type": "area",
43 + "priority": 1,
44 + "family": "ports",
45 + "dimensions": {
46 + "in": {
47 + "oid": "1.3.6.1.2.1.2.2.1.10.1",
48 + "algorithm": "incremental",
49 + "multiplier": 8,
50 + "divisor": 1024
51 + },
52 + "out": {
53 + "oid": "1.3.6.1.2.1.2.2.1.16.1",
54 + "algorithm": "incremental",
55 + "multiplier": -8,
56 + "divisor": 1024
57 + }
58 + }
59 + },
60 + "snmp_switch.bandwidth_port2": {
61 + "title": "Switch Bandwidth for port 2",
62 + "units": "kilobits/s",
63 + "type": "area",
64 + "priority": 1,
65 + "family": "ports",
66 + "dimensions": {
67 + "in": {
68 + "oid": "1.3.6.1.2.1.2.2.1.10.2",
69 + "algorithm": "incremental",
70 + "multiplier": 8,
71 + "divisor": 1024
72 + },
73 + "out": {
74 + "oid": "1.3.6.1.2.1.2.2.1.16.2",
75 + "algorithm": "incremental",
76 + "multiplier": -8,
77 + "divisor": 1024
78 + }
79 + }
80 + }
81 + }
82 + }
83 + ]
84 +}
85 +```
86 +
87 +`update_every` is the update frequency for each server, in seconds.
88 +
89 +`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.
90 +
91 +`family` sets the name of the submenu of the dashboard each chart will appear under.
92 +
93 +If you need to define many charts using incremental OIDs, you can use something like this:
94 +
95 +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`.
96 +
97 +Each of the 24 new charts will have its id (1-24) appended at:
98 +
99 +1. its chart unique id, i.e. `snmp_switch.bandwidth_port1` to `snmp_switch.bandwidth_port24`
100 +2. its `title`, i.e. `Switch Bandwidth for port 1` to `Switch Bandwidth for port 24`
101 +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`
102 +3. its priority (which will be incremented for each chart so that the charts will appear on the dashboard in this order)
103 +
104 +```js
105 +{
106 + "enable_autodetect": false,
107 + "update_every": 10,
108 + "servers": [
109 + {
110 + "hostname": "10.11.12.8",
111 + "community": "public",
112 + "update_every": 10,
113 + "options": { "timeout": 20000 },
114 + "charts": {
115 + "snmp_switch.bandwidth_port": {
116 + "title": "Switch Bandwidth for port ",
117 + "units": "kilobits/s",
118 + "type": "area",
119 + "priority": 1,
120 + "family": "ports",
121 + "multiply_range": [ 1, 24 ],
122 + "dimensions": {
123 + "in": {
124 + "oid": "1.3.6.1.2.1.2.2.1.10.",
125 + "algorithm": "incremental",
126 + "multiplier": 8,
127 + "divisor": 1024
128 + },
129 + "out": {
130 + "oid": "1.3.6.1.2.1.2.2.1.16.",
131 + "algorithm": "incremental",
132 + "multiplier": -8,
133 + "divisor": 1024
134 + }
135 + }
136 + }
137 + }
138 + }
139 + ]
140 +}
141 +```
142 +
143 +The `options` given for each server, are:
144 +
145 + - `timeout`, the time to wait for the SNMP device to respond. The default is 5000 ms.
146 + - `version`, the SNMP version to use. `0` is Version 1, `1` is Version 2c. The default is Version 1 (`0`).
147 + - `transport`, the default is `udp4`.
148 + - `port`, the port of the SNMP device to connect to. The default is `161`.
149 + - `retries`, the number of attempts to make to fetch the data. The default is `1`.
150 +
151 +## Retreiving names from snmp
152 +
153 +You can append a value retrieved from SNMP to the title, by adding `titleoid` to the chart.
154 +
155 +You can set a dimension name to a value retrieved from SNMP, by adding `oidname` to the dimension.
156 +
157 +Both of the above will participate in `multiply_range`.
158 +
159 +
160 +## Testing the configuration
161 +
162 +To test it, you can run:
163 +
164 +```sh
165 +/usr/libexec/netdata/plugins.d/node.d.plugin 1 snmp
166 +```
167 +
168 +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.
169 +
170 +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).
171 +
172 +## Data collection speed
173 +
174 +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).
175 +
176 +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.
177 +
178 +## Finding OIDs
179 +
180 +Use `snmpwalk`, like this:
181 +
182 +```sh
183 +snmpwalk -t 20 -v 1 -O fn -c public 10.11.12.8
184 +```
185 +
186 +- `-t 20` is the timeout in seconds
187 +- `-v 1` is the SNMP version
188 +- `-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)
189 +- `-c public` is the SNMP community
190 +- `10.11.12.8` is the SNMP device
191 +
192 +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.
193 +
194 +## Example: Linksys SRW2024P
195 +
196 +This is what I use for my Linksys SRW2024P. It creates:
197 +
198 +1. A chart for power consumption (it is a PoE switch)
199 +2. Two charts for packets received (total packets received and packets received with errors)
200 +3. One chart for packets output
201 +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.
202 +
203 +This switch also reports various other metrics, like snmp, packets per port, etc. Unfortunately it does not report CPU utilization or backplane utilization.
204 +
205 +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.
206 +
207 +```js
208 +{
209 + "enable_autodetect": false,
210 + "update_every": 5,
211 + "servers": [
212 + {
213 + "hostname": "10.11.12.8",
214 + "community": "public",
215 + "update_every": 15,
216 + "options": { "timeout": 20000, "version": 1 },
217 + "charts": {
218 + "snmp_switch.power": {
219 + "title": "Switch Power Supply",
220 + "units": "watts",
221 + "type": "line",
222 + "priority": 10,
223 + "family": "power",
224 + "dimensions": {
225 + "supply": {
226 + "oid": ".1.3.6.1.2.1.105.1.3.1.1.2.1",
227 + "algorithm": "absolute",
228 + "multiplier": 1,
229 + "divisor": 1
230 + },
231 + "used": {
232 + "oid": ".1.3.6.1.2.1.105.1.3.1.1.4.1",
233 + "algorithm": "absolute",
234 + "multiplier": 1,
235 + "divisor": 1
236 + }
237 + }
238 + }
239 + , "snmp_switch.input": {
240 + "title": "Switch Packets Input",
241 + "units": "packets/s",
242 + "type": "area",
243 + "priority": 20,
244 + "family": "IP",
245 + "dimensions": {
246 + "receives": {
247 + "oid": ".1.3.6.1.2.1.4.3.0",
248 + "algorithm": "incremental",
249 + "multiplier": 1,
250 + "divisor": 1
251 + }
252 + , "discards": {
253 + "oid": ".1.3.6.1.2.1.4.8.0",
254 + "algorithm": "incremental",
255 + "multiplier": 1,
256 + "divisor": 1
257 + }
258 + }
259 + }
260 + , "snmp_switch.input_errors": {
261 + "title": "Switch Received Packets with Errors",
262 + "units": "packets/s",
263 + "type": "line",
264 + "priority": 30,
265 + "family": "IP",
266 + "dimensions": {
267 + "bad_header": {
268 + "oid": ".1.3.6.1.2.1.4.4.0",
269 + "algorithm": "incremental",
270 + "multiplier": 1,
271 + "divisor": 1
272 + }
273 + , "bad_address": {
274 + "oid": ".1.3.6.1.2.1.4.5.0",
275 + "algorithm": "incremental",
276 + "multiplier": 1,
277 + "divisor": 1
278 + }
279 + , "unknown_protocol": {
280 + "oid": ".1.3.6.1.2.1.4.7.0",
281 + "algorithm": "incremental",
282 + "multiplier": 1,
283 + "divisor": 1
284 + }
285 + }
286 + }
287 + , "snmp_switch.output": {
288 + "title": "Switch Output Packets",
289 + "units": "packets/s",
290 + "type": "line",
291 + "priority": 40,
292 + "family": "IP",
293 + "dimensions": {
294 + "requests": {
295 + "oid": ".1.3.6.1.2.1.4.10.0",
296 + "algorithm": "incremental",
297 + "multiplier": 1,
298 + "divisor": 1
299 + }
300 + , "discards": {
301 + "oid": ".1.3.6.1.2.1.4.11.0",
302 + "algorithm": "incremental",
303 + "multiplier": -1,
304 + "divisor": 1
305 + }
306 + , "no_route": {
307 + "oid": ".1.3.6.1.2.1.4.12.0",
308 + "algorithm": "incremental",
309 + "multiplier": -1,
310 + "divisor": 1
311 + }
312 + }
313 + }
314 + , "snmp_switch.bandwidth_port": {
315 + "title": "Switch Bandwidth for port ",
316 + "titleoid": ".1.3.6.1.2.1.31.1.1.1.18.",
317 + "units": "kilobits/s",
318 + "type": "area",
319 + "priority": 100,
320 + "family": "ports",
321 + "multiply_range": [ 1, 24 ],
322 + "dimensions": {
323 + "in": {
324 + "oid": ".1.3.6.1.2.1.2.2.1.10.",
325 + "algorithm": "incremental",
326 + "multiplier": 8,
327 + "divisor": 1024
328 + }
329 + , "out": {
330 + "oid": ".1.3.6.1.2.1.2.2.1.16.",
331 + "algorithm": "incremental",
332 + "multiplier": -8,
333 + "divisor": 1024
334 + }
335 + }
336 + }
337 + }
338 + }
339 + ]
340 +}
341 +```
node.d/named.node.js
+2 -2
@@ -6,8 +6,8 @@
6 // http://jpmens.net/2013/03/18/json-in-bind-9-s-statistics-server/
7 // https://ftp.isc.org/isc/bind/9.10.3/doc/arm/Bv9ARM.ch06.html#statistics
8
9 -// example configuration in /etc/netdata/named.conf
10 -// the module supports auto-detection if bind is running in localhost
9 +// example configuration in /etc/netdata/node.d/named.conf
10 +// the module supports auto-detection if bind is running at localhost
11
12 /*
13 {
node.d/sma_webbox.node.js
+1 -1
@@ -3,7 +3,7 @@
3 // This program will connect to one or more SMA Sunny Webboxes
4 // to get the Solar Power Generated (current, today, total).
5
6 -// example configuration in /etc/netdata/sma_webbox.conf
6 +// example configuration in /etc/netdata/node.d/sma_webbox.conf
7 /*
8 {
9 "enable_autodetect": false,
node.d/snmp.node.js
+1 -1
@@ -2,7 +2,7 @@
2
3 // This program will connect to one or more SNMP Agents
4
5 -// example configuration in /etc/netdata/snmp.conf
5 +// example configuration in /etc/netdata/node.d/snmp.conf
6 /*
7 {
8 "enable_autodetect": false,
plugins.d/node.d.plugin
+10 -4
@@ -30,6 +30,7 @@ process.mainModule.paths.unshift(NODE_D_DIR);
30
31 var fs = require('fs');
32 var url = require('url');
33 +var util = require('util');
34 var http = require('http');
35 var path = require('path');
36 var extend = require('extend');
@@ -61,8 +62,6 @@ extend(true, netdata.options, {
62
63 update_every: NETDATA_UPDATE_EVERY,
64
64 - exit_after_ms: 3600 * 4 * 1000,
65 -
65 paths: {
66 plugins: NETDATA_PLUGINS_DIR,
67 config: NETDATA_CONFIG_DIR,
@@ -79,8 +78,15 @@ netdata.options.config_filename = pluginConfig(__filename);
78 try {
79 netdata.options_loaded = JSON.parse(fs.readFileSync(netdata.options.config_filename, 'utf8'));
80 extend(true, netdata.options, netdata.options_loaded);
82 - console.error('merged netdata object:');
83 - console.error(netdata);
81 +
82 + if(!netdata.options.paths.plugins)
83 + netdata.options.paths.plugins = NETDATA_PLUGINS_DIR;
84 +
85 + if(!netdata.options.paths.config)
86 + netdata.options.paths.config = NETDATA_CONFIG_DIR;
87 +
88 + // console.error('merged netdata object:');
89 + // console.error(util.inspect(netdata, {depth: 10}));
90 }
91 catch(e) {
92 netdata.error('Cannot read configuration file ' + netdata.options.config_filename + ': ' + e.message + ', using internal defaults.');