Page 1 of 1

Use SNMP to get disk space from two oids and add them

Posted: Fri Nov 04, 2016 1:10 pm
by vtadisina
I want to get memory available from two oids and add those memories and compare it with a threshold to give an alert. Is there a way where i can do this.

Re: Use SNMP to get disk space from two oids and add them

Posted: Fri Nov 04, 2016 1:49 pm
by ssax
What type of system is it, we may have a plugin that already does what you're looking for.

If there isn't an already made plugin you would need to write your own to perform the queries and calculations.

https://assets.nagios.com/downloads/nag ... inapi.html
https://nagios-plugins.org/doc/guidelines.html

Let us know if you have any questions.


Thank you

Re: Use SNMP to get disk space from two oids and add them

Posted: Fri Nov 04, 2016 2:02 pm
by vtadisina
It is a Linux system and I am using UCD-SNMP-MIB to get 2 memory statuses in kb and add them and compare against a threshold

Re: Use SNMP to get disk space from two oids and add them

Posted: Fri Nov 04, 2016 2:11 pm
by mcapra
Can you share the OIDs you are referencing? I wrote a plugin that calculates disk space for a given mount using the UCD-SNMP-MIB table which might satisfy your use case:

https://github.com/mcapra/nagios-check_snmp_storage_ucd

Re: Use SNMP to get disk space from two oids and add them

Posted: Fri Nov 04, 2016 2:17 pm
by vtadisina
These are the Oids that i need the status from.

UCD-SNMP-MIB::memAvailReal.0 =.1.3.6.1.4.1.2021.4.6.0
UCD-SNMP-MIB::memCached.0 = .1.3.6.1.4.1.2021.4.15.0

Re: Use SNMP to get disk space from two oids and add them

Posted: Mon Nov 07, 2016 1:34 pm
by mcapra
This plugin appears to leverage those OIDs:
https://exchange.nagios.org/directory/P ... em/details

You might give that a shot. With the understanding that this is not a plugin officially maintained by Nagios, feel free to share any issues you encounter with the plugin.