I've used Nagios for around a year. Took over the one running in the office, and I've learned a lot since then.
On to brass tacks: I need to monitor the bandwidth on multiple network devices (switches, routers, load balancers), so I read some of the documentation and setup mrtg to handle the data acquisition.
I've been told that we need to monitor the special interfaces (PortChannel, VLAN). The way the Nagios documentation recommends I do it is by defining one check per IP per interface, hardcoded:
Code: Select all
define service{
use generic-service ; Inherit values from a template
host_name linksys-srw224p
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,2000000!5000000,5000000!10
}Is there a way to concatenate the hostname in the command?
So that check_command would end up like this:
Code: Select all
check_local_mrtgtraf!/var/lib/mrtg/$HOSTNAME$_1.log!AVG!1000000,2000000!5000000,5000000!10