Hi

I'm monitoring a number of APC UPS devices. These return the 'Runtime 
Remaining' information from SNMP OID 1.3.6.1.4.1.318.1.1.1.2.2.3.0

If I test this in zenoss, I get output as follows:

Executing command against XXX-UPS2 
 
SNMPv2-SMI::enterprises.318.1.1.1.2.2.3.0 = Timeticks: (870000) 2:25:00.00 
 
 
DONE in 1 seconds 

Whilst this data seems to be pulled back OK, it doesn't display well in 
performance graphs, and I don't expect any thresholds to work properly!

Anyone know how I can do a calculation on the value as it is retrieved, or as 
it is stored for RRD?

I've seen someone out on the web calculate as follows 
(http://bruin.me.uk/node/114):


Code:

#########################################################################
#
# Convert APC UPS RunTime (Timeticks) to INTEGER in minutes
#
# Input string is of the form "1:02:00.00" or "1:02:00"
# i.e.  hh:mm:ss.nn
#
sub Runtime2Int {
  my $value = shift;
  if (defined($value)) 
    {
    $value =~ s/(\d*):(\d*):\d*.\d*/int(($1 * 60)+$2)/e;
    $value =~ s/(\d*):(\d*):\d*/int(($1 * 60)+$2)/e;
    };
  return $value;
}



Any help gratefully received!

Aaron




-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=30767#30767

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to