Hello I am new to python and snmp and I was wondering how can I use pysnmp to monitor system resources such as CPU usage, Memory usuage, Disk usage and NIC Load?
I am experimenting with the cmdgen.CommandGenerator().getCmd()
but having a hard time finding the OIDs that will return me anything meaningful.
An example of what I have tried (cpu usage query):
errorIndication, errorStatus, errorIndex, varBinds =
cmdgen.CommandGenerator().getCmd(
cmdgen.CommunityData('my-agent', 'public', 0),
cmdgen.UdpTransportTarget(('localhost', 161)),
'1.3.6.1.4.1.11.2.3.1.1.13'
)
print(varBinds)
output:
[(ObjectName(1.3.6.1.4.1.2021.10.1.3.1), Null(''))]
You could try a free MIB browser like mbrowse, and look at the mibs stored in /usr/share/snmp/mibs/
For specific examples ( Taken from http://www.debianhelp.co.uk/linuxoids.htm ):
Load
CPU
Memory Statistics