Question : LINUX/UNIX %CPU and Memory via SNMP

Hi,

We have a requirement to fetch the average %CPU and memory used on a UNIX/Linux server for every 5 minutes.

I have tried the sar command succesfully, but some times it is faling for some reasons. I learnt that through SNMP we can get these values. Can anybody please let me know how to do this? What is the Linux/Solaris OID number for these values? (Using SNMP)

Thanks
Murali

Answer : LINUX/UNIX %CPU and Memory via SNMP

Hi,
snmpget -O v -c private localhost ssCpuUser.0
will tell you the average user cpu usage in % since last reboot
do not use ssCpuUser ssCpuSystem ssCpuIdle its old, use ssCpuRawUser ssCpuSystem ssCpuIdle instead.
To get the average system cpu usage in a 5min interval use
snmpget -O v -c private localhost ssCpuRawSystem.0
or ssCpuRawUser or ssCpuRawIdle or ssCpuRawNice
every 5min and take the diff.

if you try to build an graph take a look at http://net-snmp.sourceforge.net/tutorial/mrtg/
Random Solutions  
 
programming4us programming4us