snmpttconvertmib and ups monitoring
Posted: Fri Dec 15, 2023 5:29 am
Hello!
I have an Online UPS with snmp module.
I have added the Host and a Service successfully and can get all data with snmpwalk:
root@nagivis:~# snmpwalk -v3 -u (user)-m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.1
UPS-MIB::upsBatteryStatus.0 = INTEGER: batteryNormal(2)
In the webgui the status of the service is ok, but the "Status Information" states jsut (No output on stdout) stderr: Configuration directives understood:
The command is:
define command{
command_name check_ups_battery
command_line /usr/bin/snmpwalk -v3 -m /usr/share/snmp/mibs/UPS-MIB.txt -H 192.168.151.195 -u (user) -t 360 iso.1.3.6.1.2.1.33.1.2.1
}
I found in the web that nagios cand translate the output of the content of the status infos and i have to use a plugin like SNMPTT.
I followed the original guide: http://www.snmptt.org/docs/snmptt.shtml#Nagios-Netsaint
but im a little clueless at the part where you Create an EXEC statement such as the following for each EVENT entry in the snmptt.conf file like this:
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "xxxxxx"
In the example they used somethink like what you could get from the snmpwalk: "Drive $1 in bay $2 has failed".
My gut tells me to use for me"batteryNormal"
Im rather helpless with the part after this where do i get the variables - the mib file?
do i have to use any variables?
I want to add those 4:
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.1
UPS-MIB::upsBatteryStatus.0 = INTEGER: batteryNormal(2)
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.3
UPS-MIB::upsEstimatedMinutesRemaining.0 = INTEGER: 999 minutes
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.4
UPS-MIB::upsEstimatedChargeRemaining.0 = INTEGER: 100 percent
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.7
UPS-MIB::upsBatteryTemperature.0 = INTEGER: 16 degrees Centigrade
Im not an linux/nagios pro so could you give me a hint how i can configure the Nagios correct?
I would really appreciate it.
Thank you in advance!
I have an Online UPS with snmp module.
I have added the Host and a Service successfully and can get all data with snmpwalk:
root@nagivis:~# snmpwalk -v3 -u (user)-m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.1
UPS-MIB::upsBatteryStatus.0 = INTEGER: batteryNormal(2)
In the webgui the status of the service is ok, but the "Status Information" states jsut (No output on stdout) stderr: Configuration directives understood:
The command is:
define command{
command_name check_ups_battery
command_line /usr/bin/snmpwalk -v3 -m /usr/share/snmp/mibs/UPS-MIB.txt -H 192.168.151.195 -u (user) -t 360 iso.1.3.6.1.2.1.33.1.2.1
}
I found in the web that nagios cand translate the output of the content of the status infos and i have to use a plugin like SNMPTT.
I followed the original guide: http://www.snmptt.org/docs/snmptt.shtml#Nagios-Netsaint
but im a little clueless at the part where you Create an EXEC statement such as the following for each EVENT entry in the snmptt.conf file like this:
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "xxxxxx"
In the example they used somethink like what you could get from the snmpwalk: "Drive $1 in bay $2 has failed".
My gut tells me to use for me"batteryNormal"
Im rather helpless with the part after this where do i get the variables - the mib file?
do i have to use any variables?
I want to add those 4:
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.1
UPS-MIB::upsBatteryStatus.0 = INTEGER: batteryNormal(2)
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.3
UPS-MIB::upsEstimatedMinutesRemaining.0 = INTEGER: 999 minutes
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.4
UPS-MIB::upsEstimatedChargeRemaining.0 = INTEGER: 100 percent
root@nagivis:~# snmpwalk -v3 -u (user) -m /usr/share/snmp/mibs/UPS-MIB.txt 192.168.151.195 1.3.6.1.2.1.33.1.2.7
UPS-MIB::upsBatteryTemperature.0 = INTEGER: 16 degrees Centigrade
Im not an linux/nagios pro so could you give me a hint how i can configure the Nagios correct?
I would really appreciate it.
Thank you in advance!