Page 1 of 1

Convert SNMP check return value from milliseconds to minutes

Posted: Tue Dec 20, 2016 9:41 am
by macranes
Hi, I am trying to convert a status value returned from our APC UPS devices from milliseconds to minutes.

I'm running the snmp check OID -o 1.3.6.1.4.1.318.1.1.1.2.2.3.0 which returns the remaining battery time in milliseconds. Does anyone have a solution to either convert the return value, or be able to convert the value in the alert email? I can set my -w and -c values based on milliseconds if necessary, but I would like to have the alert email indicate how much battery time remains in an easily readable format (minutes).

I haven't been able to find anything covering this type of conversion in the KB or in the forums, but I'm hoping someone has some experience with this.

Thank you for your assistance.

Re: Convert SNMP check return value from milliseconds to min

Posted: Tue Dec 20, 2016 12:29 pm
by avandemore
We don't support development of custom plugins other than generic information:

https://nagios-plugins.org/doc/guidelines.html
https://mathias-kettner.de/checkmk_localchecks.html
http://www.yourownlinux.com/2014/06/how ... cript.html

If you write a plugin to gather such information in a scripting language like perl, python, or php there are modules which allow for a transformation.

Shell scripts have there own requirements, but this is all dependent on the language used.