- NRG archives and graphs non-SNMP data by using "collector scripts." Collector scripts gather data for a single data source and print the time the data was collected, the uptime of the remote agent (when necessary), an integer value for the data source and description for the data source.
- NRG is configured to use collector scripts by specifying an appropiate collector script command with in backtick (`) characters. For example:
Variable[SomeServer-apache-tp][requests]: \ `nrg-apachestat -m bytes x.x.x.x` COUNTER
- Collectors report their data by printing to (Unix) stdout. At a minimum, they should print three integers on three separate lines:
- On the first line, they should print the "time" the stats are valid for in Unix timestamp format (seconds since Jan 1st 1970.)
- On the second line, they should print the "uptime" (time since last boot in seconds) of the host whose stats are being monitored.
- On the third line, they should print the "value" of of the desired statistic.
- Labels, details and/or other comments should be added after the time, uptime and value for readability. For example:
bash% nrg-bindstat -m queries_in dns.wiscnet.net 937366921 Tue Sep 14 22:43:12 CDT 1999 321321 uptime 1231230 queries COUNTER
- When data collection fails, collector scripts should print something besides an integer number, float number or the value "U" for "undefined" for the value. For example:
bash% nrg-bindstat -m queries_in dns.wiscnet.net 937367221 Tue Sep 14 22:48:12 CDT 1999 INF uptime connection refused - The uptime values are used to avoid creating data spikes by avoiding logging recently reset counter values. When the data sources being monitored are GAUGEs, the uptime is not relevant. In this case, collector scripts can use the value "INF" to denote that the uptime is "infinite."