Can check_snmp decode a date/time string?

Subhendu Ghosh sghosh at sghosh.org
Tue Jul 26 16:42:29 CEST 2005


On Tue, 26 Jul 2005, Ben Conrad wrote:

> Hi All,
>
> I'm pulling info from an APC ups and my return string (via snmpget) looks
> like:
>
> SNMPv2-SMI::enterprises.318.1.1.1.2.2.3.0 = 0:0:34:00.00
>>>> 34 minutes
>
> When I run check_snmp against this oid I get:
> SNMP OK - *198000*
>
> Does anybody know what check_snmp is doing to convert 0:0:34:00.00 to
> 198000?
>
> I saw this in the --help but I'm not sure how to apply it:
>
> "- All evaluation methods other than PR, STR, and SUBSTR expect that the
> value
>  returned from the SNMP query is an unsigned integer."
>
> Is it more appropriate to write a wrapper that knows how to convert
> 0:0:34:00.00 to my preferred time unit?
>
> Thanks,
>
> Ben


check_snmp is not doing any conversions.  The OID is defined as TIMETICKS 
(base INTEGER) which hundredths of a second.

snmpget converts the TIMIETICKS to a human readable time format, 
check_snmp does not.

A wrapper would be appropriate.

-- 
-sg


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list