[mrtg] Graphing uptime
resident at telcontar.net
Fri Sep 28 11:06:23 CEST 2018
I can see that graphing uptime is possible, as you can see here:
The HTML pages report uptime in the format: "163 days, 21:07:10"
If I check manually, I get this:
snmpget -v2c -c somecommunity somehost 18.104.22.168.22.214.171.124.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1415941565) 163 days,
The format is almost the same, but the latter contains the full centisecond
accuracy. You do nonetheless get the raw number included.
Now, using this in MRTG yields:
2018-09-27 19:56:04 -- 2018-09-27 19:51:33: WARNING: Expected a number but
got '163 days, 7:17:10'
Looking at the source code, I cannot determine quite how uptime is
processed. It seems odd that the format is almost the same (without the
centiseconds), which suggests (along with other code) that MRTG receives
pre-formatted output, and then has to scrape out the useful bits. (Which is
just plain horrible if this is true.)
Am I right in thinking that MRTG presently has no way to extract the raw
figure here? It seems that the SNMP library is formatting the data
prematurely and MRTG just works with that preformatted value as it suits its
own purposes, but that you cannot get the raw data out if you choose, for
example if you want to record uptime as a graph for checking for reboots.
In the example posted, I suspect that was bodged to get that to work.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mrtg