Specify multiple ifIndex at once?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rakem
Posts: 3
Joined: Tue May 08, 2012 7:27 pm

Specify multiple ifIndex at once?

Post by rakem »

hi,
I have nagios setup to do a bunch checks of interfaces on my juniper EX switches, the check command is this. It checks interfaces flaps, errors, discards etc etc.
The problem I have is that the network is growing and whenever I connect a new device or switch I need to go to nagios at add a new service with the new interface ifindex. So for example i have this:


define service{
use basic-service ; Name of service template to use
host_name sydiprdswi05-10g
check_command check_snmp!-C internal -o ifInDiscards.553 -m IF-MIB -w 10 -c 20 --rate --rate
service_description xe-0/0/1 if in discard
}

the .553 is the snmp IfIndex for a specific interface. I then need to add that same check for all my other interfaces since the ifIndex is different.
So is there a way I can use a wildcard for the ifindex, or specific multiple ifIndex values in a single check?

thanks
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Specify multiple ifIndex at once?

Post by agriffin »

I don't think there's a way to do this with Nagios' built-in options. There are ways to make it a little easier to add the service, but you'll still need to add something for each new device added to the network. If you're able to do some scripting or programming, there are a few things you could do. You could write something that checks the network and adds the services for you, or you could write a plugin that allows wildcards or multiple values.
Locked