New Nagios install - Adding 15 (60 ports) switches

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
hybmrock
Posts: 1
Joined: Thu Oct 15, 2020 9:36 am

New Nagios install - Adding 15 (60 ports) switches

Post by hybmrock »

Hello,

I've been browsing the web a lot in the last 3 days looking for some ways to modify my switch.cfg file properly. I only got the same info over and over again about how to setup the Host definition and service definition.

Good things is now I can monitor my Up time, Ping BUT I would like to use SNMP to monitor all the switches ports. With a total of 900 ports to monitor I was wondering if I must setup this block of code 900 times !! and only changes the ifOperStatus.x:

#define service {
#
# use generic-service ; Inherit values from a template
# host_name linksys-srw224p
# service_description Port 1 Link Status
# check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
#}

I will also wish to monitor traffic using MRTG but I face the same issue, is there a way to automate/script the check so I don't need to create so much entry in my fswitch.cfg file?

How do you guys work outthere?

Best regards,
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: New Nagios install - Adding 15 (60 ports) switches

Post by gormank »

One thing you can do is rather than define the hostname, define a hostgroup, add the switches to that, then monitor the hostgroup.
I'd have a look at the the check_snmp -h output and -o option and maybe give it a list of IF OIDs, or the OID that contains the table of all IFs.
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

Re: New Nagios install - Adding 15 (60 ports) switches

Post by snapier3 »

I normally try the passive monitoring approach utilizing SNMP when dealing with network devices.

NagiosXI with SNMP traps
https://assets.nagios.com/downloads/nag ... ios_XI.pdf
https://support.nagios.com/kb/article/n ... s-852.html

NagiosXI + SNMP v3 Docs
https://support.nagios.com/kb/article.php?id=827

--SN
Locked