Abstract
This document describes how you can monitor network devices (Cisco, Nortel, Procurve,…), such as:
These instructions assume that you have installed Shinken according to the Installation tutorial. The sample configuration entries below reference objects that are defined in the sample config files (“commands.cfg”, “templates.cfg”, etc.) that are installed if you followed the quickstart.
Network devices are typically monitored using the SNMP and ICMP(ping) protocol.
Here are the steps you will need to follow in order to monitor a new device :
To make your life a bit easier, a few configuration tasks have already been done for you:
The above-mentioned configuration files can be found in the /etc/shinken/packs/network/switch directory (or c:\shinken\etc\packs\network\switch under windows). You can modify the definitions in these and other configuration packs to suit your needs better. However, it is recommended to wait until you are familiar with Shinken before doing so. For the time being, just follow the directions outlined below and you will be securely monitoring your devices in no time.
First connect as the shinken user under your shinken host.
Unix like to install check_nwc_health:
install -p check_nwc_health
Now to try to check your switch, for this you need a read community for it. Consult your device vendors documentation on how to change the SNMP community. The default value is “public”. The most efficient, though less secure protocol version of SNMP is version 2c. Version 3 includes encryption and user/password combinations, but is more convoluted to configure and may tax your devices CPU, it is beyond the scope of this tutorial.
Now connect as the shinken user.
su - shinken
Let's say that the switch-1 IP is 192.168.0.1.
/usr/local/shinken/libexec/check_nwc_health --hostname 192.168.0.1 --timeout 60 --community "public" --mode interface-status
It should give you the state of all interfaces.
If the SNMP community value is a global one you are using on all your hosts, you can configure it in the file /etc/shinken/resource.cfg (or c:\shinken\resource.cfg under windows) in the line:
$SNMPCOMMUNITYREAD$=public
Now it's time to define some object definitions in your Shinken configuration files in order to monitor the new Linux device.
You can add the new host definition in an existing configuration file, but it's a good idea to have one file per host, it will be easier to manage in the future. So create a file with the name of your server.
Under Linux :
linux:~ # vi /etc/shinken/hosts/switch-1.cfgOr Windows :
c:\ wordpad c:\shinken\etc\hosts\switch-1.cfg
You need to add a new host definition for the switch device that you're going to monitor. Just copy/paste the above definition Change the “host_name”, and “address” fields to appropriate values for this device.
define host{
use switch
host_name switch-1
address 192.168.0.1
}
If you are using a specific SNMP community for this host, you can configure it in the SNMPCOMUNITY host macro like this :
define host{
use switch
host_name switch-1
address 192.168.0.1
_SNMPCOMMUNITY password
}
At this point, you configure your host to be checked with a switch template. What does it means? It means that you got some checks already configured for you :
Not all devices are managed by check_nwc_health. To know if yours is, just launch :
/usr/local/shinken/libexec/check_nwc_health --hostname 192.168.0.1 --timeout 60 --community "public" --mode hardware-health
If it's ok, you can add the “cisco” template for your hosts (even if it's not a cisco device, we are working on getting more templates configuration).
define host{
use cisco,switch
host_name switch-1
address 192.168.0.1
_SNMPCOMMUNITY password
}
If it does not work, to learn more about your device, please launch the command :
snmpwalk -v2c -c public 192.168.0.1 | bzip2 > /tmp/device.bz2And launch this this command as well :
nmap -T4 -O -oX /tmp/device.xml 192.168.0.1
Once you have done that, send us the device.bz2 and device.xml files (located in /tmp directory), we will add this new device to the check_nwc_health plugin in addition to the discovery module. With these files please also provide some general information about the device, so we will incorporate it correctly into the discovery module.
You're done with modifying the Shinken configuration, you will need to verify your configuration files and restart Shinken.
If the verification process produces any errors messages, fix your configuration file before continuing. Make sure that you don't (re)start Shinken until the verification process completes without any errors!