It depends on the model and type of UPS you are using. Test the default check_ups plugin if it works for you. If it doesn’t (like in my case), you could use check_snmp with the OID that represents the variables you wish to get from UPS (load, battery status…). I suggest you to do some testing with snmpget command to get the proper output format for your check_snmp queries.
As far as I can see, the check_ups has these variables available:
-T, --temperature
Output of temperatures in Celsius
-v, --variable=STRING
Valid values for STRING are LINE, TEMP, BATTPCT or LOADPCT
Don’t know. Haven’t found a word about snmp in plugin’s source files (although I’m not an expert in programming so my knowledge lacks in this case).
I wouldn’t bother so much about it. If your UPS is snmp compatibile, you just put check_snmp on OID you need and that’s it. The magic of Nagios is that it is customizable and expandable in many ways.
Maybe you’ve sorted this one out. I have APC Smart-UPS RT 6000 and I found a syntax for it.
define service{
use generic-service ;
hostgroup_name ups
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC Battery temperature
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.2.2.2.0 -C public -w 35 -c 45 -u C
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC Battery run time remaining
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.2.2.3.0 -C public
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC Battery needs replacement
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.2.2.4.0 -C public -c 2
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC Line-in voltage
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.3.2.1.0 -C public -w 245 -c 250 -u VAC
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC UPS load
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.4.2.3.0 -C public -w 70 -c 90 -u %
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC output current
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.4.2.4.0 -C public -w 40 -c 50 -u A
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC output voltage
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.4.2.1.0 -C public -w 235 -c 245 -u VAC
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC status
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.4.1.1.0 -C public -c 3
}
define service{
use generic-service ;
hostgroup_name ups
service_description APC UPS Model
check_command check_snmp!-o .1.3.6.1.4.1.318.1.1.1.1.1.1.0 -C public
}
Hope this helps.
As you can see I use hostgroup_name, you can change that to host_name if you’re just monitoring one ups. You can also change the critical and warning thresholds…