check_snmp memTotalFree thresholds
Posted: Mon Jul 20, 2020 10:04 pm
Hello,
I've searched other posts and I'm not able to locate anything on my particular issue. This is my first go round setting up snmp monitoring.
From my nagios server I'm able to snmpwalk all OID's that I'm interested in. But, I'm having trouble setting thresholds.
$ snmpwalk -O n -v2c -c mystring server1.domain.com:161 Memory
.1.3.6.1.4.1.2021.4.3.0 = INTEGER: 2097148 kB
.1.3.6.1.4.1.2021.4.4.0 = INTEGER: 2097148 kB
.1.3.6.1.4.1.2021.4.5.0 = INTEGER: 16262416 kB
.1.3.6.1.4.1.2021.4.6.0 = INTEGER: 14288168 kB
.1.3.6.1.4.1.2021.4.11.0 = INTEGER: 16385316 kB
.1.3.6.1.4.1.2021.4.13.0 = INTEGER: 68984 kB
.1.3.6.1.4.1.2021.4.14.0 = INTEGER: 2108 kB
.1.3.6.1.4.1.2021.4.15.0 = INTEGER: 651484 kB
Just focusing on OID ( .1.3.6.1.4.1.2021.4.11.0 ) for this post. Which is memTotalFree.0 ( Total RAM Free ) according or oidref.com
Checking with snmp_check it seems to report critical no matter what I put in for warning and critical. Just for testing I'd like to get warning when memTotalFree is 8gb and critical when its 4gb. So, I thought something like this would do it.
$ /usr/local/nagios/libexec/check_snmp -H server1.domain.com -p 161 -o 'memTotalFree.0' -C 'mystring' -P 2c -u 'kB' -m UCD-SNMP-MIB -w 8192658 -c 4096329
SNMP CRITICAL - *16385176* kB | UCD-SNMP-MIB::memTotalFree.0=16385176kB;8192658;4096329
I cannot get anything other than CRITICAL for return status.
Not sure what I'm doing wrong or if I'm misunderstand the values.
Update: This seems to report incorreclty. If I make the -w and -c higher than the actual amount of memory it will report ok.
So, server has 16gb of Total Memory free and I make warn just 1 kb higher and it will report ok.
No values ='s OK
$ /usr/local/nagios/libexec/check_snmp -H server1.domain.com -p 161 -o 'memTotalFree.0' -C 'mystring' -P 2c -m UCD-SNMP-MIB
SNMP OK - 16374568 kB | UCD-SNMP-MIB::memTotalFree.0=16374568
Make warn and critical 1byte beyond what the server has.
$ /usr/local/nagios/libexec/check_snmp -H server1.domain.com -p 161 -o 'memTotalFree.0' -C "mystring' -P 2c -m UCD-SNMP-MIB -w 16374617 -c 16374618
SNMP OK - 16374584 | UCD-SNMP-MIB::memTotalFree.0=16374584;16374617;16374618
Same applies to swap space, etc. Found another post in the community w/ same issue. Its unanswered. Hoping someone has some insight.
https://support.nagios.com/forum/viewto ... 81#p308596
Thanks,
Thanks,
I've searched other posts and I'm not able to locate anything on my particular issue. This is my first go round setting up snmp monitoring.
From my nagios server I'm able to snmpwalk all OID's that I'm interested in. But, I'm having trouble setting thresholds.
$ snmpwalk -O n -v2c -c mystring server1.domain.com:161 Memory
.1.3.6.1.4.1.2021.4.3.0 = INTEGER: 2097148 kB
.1.3.6.1.4.1.2021.4.4.0 = INTEGER: 2097148 kB
.1.3.6.1.4.1.2021.4.5.0 = INTEGER: 16262416 kB
.1.3.6.1.4.1.2021.4.6.0 = INTEGER: 14288168 kB
.1.3.6.1.4.1.2021.4.11.0 = INTEGER: 16385316 kB
.1.3.6.1.4.1.2021.4.13.0 = INTEGER: 68984 kB
.1.3.6.1.4.1.2021.4.14.0 = INTEGER: 2108 kB
.1.3.6.1.4.1.2021.4.15.0 = INTEGER: 651484 kB
Just focusing on OID ( .1.3.6.1.4.1.2021.4.11.0 ) for this post. Which is memTotalFree.0 ( Total RAM Free ) according or oidref.com
Checking with snmp_check it seems to report critical no matter what I put in for warning and critical. Just for testing I'd like to get warning when memTotalFree is 8gb and critical when its 4gb. So, I thought something like this would do it.
$ /usr/local/nagios/libexec/check_snmp -H server1.domain.com -p 161 -o 'memTotalFree.0' -C 'mystring' -P 2c -u 'kB' -m UCD-SNMP-MIB -w 8192658 -c 4096329
SNMP CRITICAL - *16385176* kB | UCD-SNMP-MIB::memTotalFree.0=16385176kB;8192658;4096329
I cannot get anything other than CRITICAL for return status.
Not sure what I'm doing wrong or if I'm misunderstand the values.
Update: This seems to report incorreclty. If I make the -w and -c higher than the actual amount of memory it will report ok.
So, server has 16gb of Total Memory free and I make warn just 1 kb higher and it will report ok.
No values ='s OK
$ /usr/local/nagios/libexec/check_snmp -H server1.domain.com -p 161 -o 'memTotalFree.0' -C 'mystring' -P 2c -m UCD-SNMP-MIB
SNMP OK - 16374568 kB | UCD-SNMP-MIB::memTotalFree.0=16374568
Make warn and critical 1byte beyond what the server has.
$ /usr/local/nagios/libexec/check_snmp -H server1.domain.com -p 161 -o 'memTotalFree.0' -C "mystring' -P 2c -m UCD-SNMP-MIB -w 16374617 -c 16374618
SNMP OK - 16374584 | UCD-SNMP-MIB::memTotalFree.0=16374584;16374617;16374618
Same applies to swap space, etc. Found another post in the community w/ same issue. Its unanswered. Hoping someone has some insight.
https://support.nagios.com/forum/viewto ... 81#p308596
Thanks,
Thanks,