Hi guys.
I am planing my nagios environment and I have some specific situations that I need to monitor only specific interfaces via snmp, and those interfaces vary per host in quantity and identifiers.
Basically, since there are many hosts, I think in creating a template with custom variables for ifIndex and snmp community. Then, applying that template in each host I create, specifying the custom variables per host.
The problem I see in this setup is that I want to monitor only 3 interfaces in a specific host (e.g. ifindex 1, 10 and 20), only 2 in another host (e.g. ifindex 3 and 12) and so on. I could not see a good way to do this.
There are some hosts with more than 50 interfaces that I am supposed to monitor and a single interface for some others.
How can I set up this situation using templates with different amount of interfaces?
Thanks in advance
Template - custom variables / different amount of interfaces
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Template - custom variables / different amount of interf
That's a tricky one. Templates or service groups may not be the best option, only because of the restriction on being nearly identical. If there were large numbers of devices that need identical monitoring either would work fairly well, but for some of the other ones, you may be better off creating a script that accepts multiple port identifiers after ifIndex and returns the status for each one in a single result. You could also have this script return the performance data for each port on that single check, to give a nice graph of each port on that device. Otherwise, you would probably be best off defining a service template that defines your check and most other critical options, then just defining the service name and ifIndex identifier as an argument within the actual service.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Template - custom variables / different amount of interf
Hi. Thanks for replying.
I guess, in my case, I will have to create a single service check for each interface, as your second suggestion. I will collect performance data as well.
To be easy to manage, I will make a script to insert devices into my nagios, and based in which hostgroup(s) I choose, the script will ask for some basic variables, will make some basic validation and, if everything goes fine, it will build the host cfg file with the interfaces service checks automatically, keeping a standard for all the hosts/services.
Thanks
I guess, in my case, I will have to create a single service check for each interface, as your second suggestion. I will collect performance data as well.
To be easy to manage, I will make a script to insert devices into my nagios, and based in which hostgroup(s) I choose, the script will ask for some basic variables, will make some basic validation and, if everything goes fine, it will build the host cfg file with the interfaces service checks automatically, keeping a standard for all the hosts/services.
Thanks
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Template - custom variables / different amount of interf
You're welcome. That sounds like a pretty good idea, just be sure to restart nagios and make sure the directory or files are listed in the nagios.cfg, but I'm sure you get that already! Let us know if you need any further help.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.