You can use a regex with the "-m" flag, and search for the type of memory you would like to monitor, provided it is available via SNMP.
For example, when I run snmwalk against my CentOS box, I see the following entries in the output:
Code: Select all
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Physical memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Virtual memory
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: Memory buffers
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: Cached memory
so, I can modify my check accordingly.
Examples:
Code: Select all
[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_snmp_storage_wizard.pl -H x.x.x.x -C <community> --v2c -m Physical -w 95 -c 98 -f
Physical memory: 95%used(7595MB/8001MB) (<95%) : OK | 'Physical_memory'=7595MB;7601;7841;0;8001
[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_snmp_storage_wizard.pl -H x.x.x.x -C <community> --v2c -m Virtual -w 95 -c 98 -f
Virtual memory: 75%used(7578MB/10049MB) (<95%) : OK | 'Virtual_memory'=7578MB;9547;9848;0;10049
[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_snmp_storage_wizard.pl -H x.x.x.x -C <community> --v2c -m buffers -w 95 -c 98 -f
Memory buffers: 2%used(193MB/8001MB) (<95%) : OK | 'Memory_buffers'=193MB;7601;7841;0;8001
[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_snmp_storage_wizard.pl -H x.x.x.x -C <community> --v2c -m Cached -w 95 -c 98 -f
Cached memory: 100%used(490MB/490MB) (>98%) : CRITICAL | 'Cached_memory'=490MB;466;480;0;490
This may be different on Ubuntu 16.04, but you could save the output of the snmpwalk command, open the file in a text editor, and try to find out what you can monitor as far as memory type.
Code: Select all
snmpwalk -v 2c -c community ip address > /tmp/snmpoutput.txt