Thresholds for SNMP Monitoring
Posted: Mon Jun 24, 2019 10:26 am
Want to monitor free space using SNMP on some AIX servers.
Did an SNMP Walk and got the values for the "/" directory...
Total = 2048
Free = 1591
We want to alert at...
Warning = 10% or Free = 205
Critical = 5% or Free = 103
Coded a monitor and it went critical immediately...
[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H 10.180.199.40 -o 1.3.6.1.4.1.2.6.191.6.2.1.6.1 -P 3 --seclevel=authPriv --secname=USER --authproto=md5 --authpasswd='AUTHPASSWORD' --privpasswd='PRIVPASSWD' --privproto=des -l "Free Space "/"" -m IBM-AIX-MIB.mib -w 204 -c 102
SNMP CRITICAL - Free Space / *1591* | 'Free Space /'=1591;204;102;
Thought that Nagios may be looking at how much disk is being used versus how much is free, so we reversed our logic...
[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H 127.0.0.1 -o 1.3.6.1.4.1.2.6.191.6.2.1.6.1 -P 3 --seclevel=authPriv --secname=USER --authproto=md5 --authpasswd='AUTHPASSWORD' --privpasswd='PRIVPASSWD' --privproto=des -l "Free Space "/"" -m IBM-AIX-MIB.mib -w 1843 -c 1945
SNMP OK - Free Space / 1591 | 'Free Space /'=1591;1843;1945;
But, we have no way to know if this is correct or not. Don't feel like creating a 1800 MB file to see if it alerts or not.
Then read something about using a colon in the thresholds and tried this...
[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H 127.0.0.1 -o 1.3.6.1.4.1.2.6.191.6.2.1.6.1 -P 3 --seclevel=authPriv --secname=USER --authproto=md5 --authpasswd='AUTHPASSWD' --privpasswd='PRIVPASSWD' --privproto=des -l "Free Space "/"" -m IBM-AIX-MIB.mib -w 204:10 -c 102:5
SNMP OK - Free Space / 1591 | 'Free Space /'=1591;204;102;
That's the same output as the first attempt but it didn't go Critical. Still, I don't know if this is working as desired.
Did an SNMP Walk and got the values for the "/" directory...
Total = 2048
Free = 1591
We want to alert at...
Warning = 10% or Free = 205
Critical = 5% or Free = 103
Coded a monitor and it went critical immediately...
[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H 10.180.199.40 -o 1.3.6.1.4.1.2.6.191.6.2.1.6.1 -P 3 --seclevel=authPriv --secname=USER --authproto=md5 --authpasswd='AUTHPASSWORD' --privpasswd='PRIVPASSWD' --privproto=des -l "Free Space "/"" -m IBM-AIX-MIB.mib -w 204 -c 102
SNMP CRITICAL - Free Space / *1591* | 'Free Space /'=1591;204;102;
Thought that Nagios may be looking at how much disk is being used versus how much is free, so we reversed our logic...
[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H 127.0.0.1 -o 1.3.6.1.4.1.2.6.191.6.2.1.6.1 -P 3 --seclevel=authPriv --secname=USER --authproto=md5 --authpasswd='AUTHPASSWORD' --privpasswd='PRIVPASSWD' --privproto=des -l "Free Space "/"" -m IBM-AIX-MIB.mib -w 1843 -c 1945
SNMP OK - Free Space / 1591 | 'Free Space /'=1591;1843;1945;
But, we have no way to know if this is correct or not. Don't feel like creating a 1800 MB file to see if it alerts or not.
Then read something about using a colon in the thresholds and tried this...
[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H 127.0.0.1 -o 1.3.6.1.4.1.2.6.191.6.2.1.6.1 -P 3 --seclevel=authPriv --secname=USER --authproto=md5 --authpasswd='AUTHPASSWD' --privpasswd='PRIVPASSWD' --privproto=des -l "Free Space "/"" -m IBM-AIX-MIB.mib -w 204:10 -c 102:5
SNMP OK - Free Space / 1591 | 'Free Space /'=1591;204;102;
That's the same output as the first attempt but it didn't go Critical. Still, I don't know if this is working as desired.