Converting Wizard based Router services to Templates

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Matthew.Cary
Posts: 32
Joined: Fri Nov 10, 2017 11:43 am

Converting Wizard based Router services to Templates

Post by Matthew.Cary »

I am in the process of trying to setup hostgroup/service based templates for our Meraki based switches.

I've run the wizard against one switch and then tweaked the results into generic service checks that can be run against any Meraki switch. Pings and Port Up/Down went very smoothly. I'm having some issues wrapping my head around the bandwidth checks.

It looks like they are using the check_rrdtraf plugin to monitor a file at /var/lib/mrtg/routername_1.rrd

So 2 questions:

1) Is the "routername_1.rrd" file actually created by the wizard in the background? If so do I need to create this for every router? If so, can you talk about how to do this outside the wizard?

2) The actual service check from the wizard looks like this: /var/lib/mrtg/$ARG1$, with $ARG1$ being defined as routername_1.rrd
Assuming I can make a variable out of this, how can I format $ARG1$ to pass the hostname? Something like $HOSTNAME$_1.rrd feels right but I suspect I have the wrong syntax

Or is there a better way to make bandwidth charts for routers that fit in a template? Linux and Windows OS checks template just fine, but use a different plugin. Is there something similar for Routers?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Converting Wizard based Router services to Templates

Post by cdienger »

Check out https://support.nagios.com/kb/article/n ... re-62.html which will help clarify how the wizard and checks work.

In short, the wizard creates an mrtg configuration file that is responsible for scanning a device and getting information about the bandwidth of interface. This configuration will create the /var/lib/mrtg/routername_1.rrd file and the check_rrdtraf plugin reads this file to create the graphs.

If you've run the wizard already, you'll find an mrtg configuration for each router it was run against under /etc/mrtg/conf.d/ The configuration files will have all the details about the interfaces as well as the command that was run to create the configuration file. The command will be found at the top of the file. For example:

Code: Select all

# Created by
# /usr/bin/cfgmaker --show-op-down --noreversedns --zero-speed 100000000 public@192.168.1.1:161::::2
The 'Bulk Configuration' section of the wizard can be used if you have multiple routers you want to run the wizard against. Note that this will set up individual service checks for each interface. Unless interface X on routerA and routerB are similar and you want to always apply the same thresholds to them, I would recommend using the checks that the wizard sets up for each interface. That said, you could configure a port check that could be applied to multiple hosts - edit or duplicate the check_xi_service_mrtgtraf command and set the Command Line field to:

Code: Select all

$USER1$/check_rrdtraf -f /var/lib/mrtg/$HOSTADDRESS$$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$
and then edit the service to remove the host portion of $ARG1$. See the attached screenshot highlighting where to edit the command and as well as how the service would look.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.