Page 3 of 6

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 1:36 pm
by dwhitfield
What do you mean that the replacement date was too old? Also, what do you mean in both cases? I thought the UPS GUI was showing it replaced.

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 1:54 pm
by avandemore
sa77if wrote:is this fine?

***** Nagios *****

Notification Type: PROBLEM

Service: Check UPS Battery LifeTime
Host: SmartUPS 2200B
Address: 192.168.0.7
State: CRITICAL

Date/Time: Fri Nov 4 11:04:40 PDT 2016

Additional Info:

SNMP CRITICAL - Battery LifeTime *60000*
I am very confused, that is polling an integer value.
after replacing the old batteries i logged into the UPS and changed the date to the replacement date but still getting the warning with the same values
Why do you expect changing a date on your appliance GUI is going to effect the OID value? Your alert is from that OID value, not on some date. If you expect that OID value to change after your process and it isn't, that is a question for your device manufacturer. Nagios can only act on the information it is given.

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 1:57 pm
by tgrtjake
Looking at https://exchange.nagios.org/directory/P ... ad/details I can see that "Battery LifeTime" is actually upsAdvBatteryRunTimeRemaining .1.3.6.1.4.1.318.1.1.1.2.2.3.0.

If you are looking for an alert as to when the batteries are needing replacement then this is not the correct OID. Is that what you are looking for?

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 2:02 pm
by sa77if
this is what i mean about UPS GUI

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 2:04 pm
by sa77if
i think i got you now, the nagios is pulling the results from the UPS so it need to be changed there
maybe i need to restart the UPS after changing batteries to make it send the right reading to nagios
right?

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 2:07 pm
by tgrtjake
You are going to get a warning and critical for sure because this OID is for battery run time remaining.
sa77if wrote:sorry just found it at another folder

Code: Select all

# 'snmp_ups_stat' command definition
define command{
        command_name    snmp_ups_stat
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.2.2.3.0 -w 3 -c 4 -l 'Battery LifeTime'
        }

Below you gave us the alert and output of the OID. It returned a critical with 60000. That is telling you that there is 10 minutes of battery run time remaining.
sa77if wrote: ***** Nagios *****

Notification Type: PROBLEM

Service: Check UPS Battery LifeTime
Host: SmartUPS 2200B
Address: 192.168.0.7
State: CRITICAL

Date/Time: Fri Nov 4 11:04:40 PDT 2016

Additional Info:

SNMP CRITICAL - Battery LifeTime *60000*

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 2:16 pm
by rkennedy
Thank you for clarifying the OID's through this @tgrtjake!

@sa77if - let me know if you have any further questions.

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 2:16 pm
by sa77if
so its not the battery lifetime that warn for replacing
its the one that warn for remaining charge
ok, how can raise the values to reduce warnings like that, because i am on AC its not important to have 10m or 5m

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 2:24 pm
by tgrtjake
sa77if wrote:so its not the battery lifetime that warn for replacing
its the one that warn for remaining charge
ok, how can raise the values to reduce warnings like that, because i am on AC its not important to have 10m or 5m
Yes, you'll need to change the -c and -w to something like this. Also, if I were you I'd change the name to Battery RunTime.

I think with your current setup being 10 min run time you would maybe want to warn at 5 mins and crit at 3 mins? 6000 = 1 min

Code: Select all

# 'snmp_ups_stat' command definition
define command{
        command_name    snmp_ups_stat
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.2.2.3.0 -w 30000 -c 18000 -l 'Battery RunTime'
        }
Sorry, edits for correct timings

Re: UPS battery lifetime alert

Posted: Fri Nov 04, 2016 2:29 pm
by sa77if
thanks @tgrtjake
i will do it
thank you all for your patent with me appreciate that