I am new to SNMP and Nagios, and would like to do some basic arithmetic on values retrieved using OIDs.
I need to monitor the used memory (RAM) on the servers on the University's network. They seem to be using UCD-SNMP-MIB. So far I have encountered memTotalReal.0
and memAvailReal.0
, and no direct way to retrieve the used memory. Is there any specific reason for this?
Expected command for basic subtraction:
$USER1$/check_snmp -H $HOSTADDRESS$ -o memTotalReal.0-memAvailReal.0
What is the easiest way to retrieve the used memory? Do I need to resort to subtraction by possibly writing another script?
There is no simple way to do it. So you need to calculate it like this:
(Used – buffers – cached) / Total * 100 = % memory used
Used = total - available
In terms of OIDs you'll need to use the following: