Get the App
SLTechnology News&Howtos  ›  Development  › 

How does Nagios monitor the router

Shulou Source: shulou.com Published: 2022-06-02 12:00:18 09月20日 Update

This article is about how Nagios monitors routers. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

I. configuration of the router

Here I use the GNS3 simulator to simulate the router, bridge to the physical network, and configure the relevant IP and enable SNMP related information

The router configuration is as follows:

Router#conf terminal

Router (config) # int e0Universe 0

Router (config-if) # ip address 192.168.30.130 255.255.255.0

Router (config-if) # no sh

Router (config-if) # exit

Router (config) # snmp-server community public RW

Router (config) # snmp-server location China-jcs-F/5F

Router (config) # snmp-server contact IT:Allan EXT:7758

Router (config) # snmp-server host 192.168.30.100 public snmp

Router (config-if) # end

Test connectivity to the nagios server

Router#ping 192.168.30.100

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.30.100, timeout is 2 seconds:

.!

Success rate is 80 percent (4amp 5), round-trip min/avg/max = 4-14-28 ms

II. Configuration of Nagios server

Because Nagios detects router-related conditions through the plug-in check_snmp. Because there is no net-snmp installed before, we need to install it first.

[root@server ~] # yum-y install net-snmp-libs net-snmp-devel net-snmp net-snmp-utils

Nagios-plugin needs to be recompiled after installation

[root@server nagios-plugins-1.4.14] #. / configure

[root@server nagios-plugins-1.4.14] # make

[root@server nagios-plugins-1.4.14] # make install

After compiling and installing, test snmp on the local machine

Add a host as shown in the figure. Here, check the connectivity of the router with the PING command.

You can customize a command according to your needs, command-define-add

For example, I want to check how long the router has been started, but the command we are going to execute is: check_snmp-H'$HOSTADDRESS-C'$ARG1-o sysUpTime.0

First check the value of OID of sysuptime through the command: sysUpTimeInstance

[root@server] # snmpwalk-v1-c public 192.168.30.130 sysUpTimeInstance

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (245944) 040 59.44

Then go to Supervision-Service-add to the inspection command here, we can choose the command we just customized.

Add one more service to check the status of router f0cano interface

When the configuration is complete, remember to write to the configuration

Then associate the service just built in the mainframe.

After checking the configuration for errors, restart nagios

Thank you for reading! This is the end of the article on "how Nagios monitors routers". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Routing routers commands configuration services inspection monitoring hosts content more servers articles testing compiling good practical information interfaces plug-ins articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology Docker MySQL Linux