Get SNMP tables in bulk

Hi All,

I’m brand new to the community, I’d like to start by apologising if this question has been answered elsewhere, or indeed if it is complete gibberish. My background is networking, I am completely new to Icinga.

I’m trying to gather some SNMP information from a collection of different devices using bulkSNMP requests. While I am aware of some SNMP plugins, the only ones I can find are either tailored to a specific need (e.g. the Interfaces plugin) or are only designed to pull a single OID value.

If I want to pull a whole bunch of SNMP values from a table, then make sense of them (possibly referring to information I have pulled from other tables) would I have to create my own custom plugin from scratch to do this? Is there any existing plugin designed to work with SNMP tables?

I’m hoping this makes sense to someone, and they can point me in the right direction.

1 Like

I think you should reconsider the usefulness of bulk SNMP data as far as
Icinga is concerned.

Icinga is not a system where you can pull a whole load of data from some
device and then analyse it for various measurements.

Each Service Check needs to perform its own measurement, which means it needs
to pull its own SNMP data from the device being monitored. Any other data
which SNMP may be able to provide belongs to a different Service Check, and
should be collected by that one on its own.

The design of Icinga is such that you define Service Checks for each of the
things you’re interested in (for example, interface bandwidth, port speed,
uptime, disk usage, memory usage, system load…), and each of those Service
Checks needs to collect the data it requires to be able to report its result.

Any other data is irrelevant, and needs to be collected by the Service Check
to which it is relevant.

I hope that helps to clarify.

Antony.

2 Likes

Hi,

There is no such thing as a universal snmp plugin except if you only get one OID.
The main problem is that you have to code a logic between tables values, and the easiest way is … a plugin.
This is not related to Icinga by the way, all monitoring (OSS or commercial) have the same “problem”.
If you only need to select elements in a snmp table and check values related to these elements in the same table, I can provide a plugin for this (it’s a quick hack of my check_snmp_int.pl plugin).

I also agree with Antony : get as few data as you can by service checks because if you are not, you will quickly have problems with the simple OK/warn/crit return code.

Patrick

1 Like

Thanks for the replies Patrick and Anthony, they both make a lot of sense. Patrick if you are happy to let me take a look at your plugin I would be very interested in how it works.

Basically I have a table of statistics for service interfaces, each of which have related bandwidth, discard and state statistics. I want to pull the relevant information for each interface. There could be hundreds of these interfaces on a device, so as far as possible discovery of a new interface needs to be automated.

Hello, you can have both performance and getting data in bulk in ‘one shot’ if you take the time to implement your collect in the following way.

Lets say you have a need A collecting traffic in/out for network interfaces.
Lets say you have a need B collecting errors/discards for network interfaces.

In the Mib, traffic in/out and erros/discard share the same identifier for interface, and this is oftently the case for many others things among snmp.

That means, you can make a script to collect datas for A and B related to the same object (you interface), so, you can pretty much collect data once and put it in cache locally on the server, and using cached data until you consider you cache should be refreshed (lets say few minutes). To sum it up, you would end up with a file in /tmp being refreshed, you get a gain in perf since you collect your data only once and after that only use the cache, that means less active wait on your server, and script execution running much much faster. as long as the share the same cached data, this also means less network load for both the monitoring server and the devices to be requested.

The only drawback of this solution is that it requires some development and needs you to properly manage concurrent execution and lock of the tempfile among multiple processes launched by icinga.

Though I agree with Anthony as well, that “one check to rule them all” at the very least reduces visibilty/simplicity, there is a check script that should do what you are looking for (if I understood correctly, what you want :wink: )

check_nwc_health (translated to english) has the ability to get bandwidth usage, errors, discards and state for one or multiple interfaces (with regex).
The command is also already integrated in the ITL, so you you won’t have to create it yourself.

Hi,
I made a gist for the plugin check_snmp_table.pl but be careful as it was for a specific purpose wich may not match what you are trying to do.

I undestand you want to check values of all interfaces of several hosts, so yes you need bulk snmp get along with caching (for interface descriptions) : then you will need the C version of check_snmp_int which provides both. I use it when I need to check hundreds of interface state/speed on core networks. I haven’t got a version wich is simple to compile, but I will soon created another gist for this.
Be aware, the warning/crit levels has to be the same for all interfaces on the same host.

/Patrick

1 Like