[mrtg] New feature request - allow use of snmpEngineTime for uptime

Terry Kennedy terry-mrtg at glaver.org
Thu May 11 01:08:41 CEST 2017

  The regular sysUptime OID rolls over every 496 days. Some equipment
stays up longer than that and also offers snmpEngineTime for non-roll-
over uptime. There is a mrtg.cfg option (NoMib2) to suppress polling
for sysUptime, but there doesn't seem to currently be a way to specify
an alternate source of uptime information.

  It isn't simply a matter of substituting one OID for the other, as
snmpEngineTime returns "INTEGER: x seconds" while sysUptime returns
"Timeticks: (x) x days, xx:xx:xx.xx".

  Doing this externally in Perl is pretty simple (apologies in advance
for my coding style):

$days = int($snmpEngineTime/86400);
$hours = int($snmpEngineTime/3600%24);
$minutes = int($snmpEngineTime/60%60);
$seconds = int($snmpEngineTime%60);

printf "$days days, ";
printf "%02d:", $hours;
printf "%02d:", $minutes;
printf "%02d\n", $seconds;

  Before I go and add this to my local MRTG mods, is this something that
would be considered for a future MRTG release?

        Terry Kennedy     http://www.glaver.org      New York, NY USA

More information about the mrtg mailing list