Data collectors are tiny scripts producing a measured quantity at standard output. They are not specific to MRTG Online and can be used with other tools supporting custom counters.
Different tools and languages can be used for writing the collectors, but we prefer canonical solutions written using standard sh and awk tools and /proc file system when possible. Note that /proc filesystem is linux-specific and may depend on kernel version and configuration.
- Active RAM
-
awk '/Active:/ { print $2 }' /proc/meminfo
- Load average (5 min)
-
top -bn1 | awk '/load average:/ { print $14 }'
- Average ping roundtrip time
-
ping -c 10 -i 2 -w 60 192.168.0.1 | awk -F '/' '/rtt/ { print $5 / 1000 }'