Check BGP


#1

I am trying to monitor BGP on two cisco routers. I was pointed in two different directions, I could not get either of them to work.

If someone has done this and can help me out I would appreciate it.

Nagios version 3.2.3 running on Ubuntu server 10.04 x86


#2

Alright so let me get a little more specific and see if someone can help out.

I am trying to monitor BGP using a pl file suggested by someone that can be found here: blog.glinskiy.com/2006/06/nagios-bgp-plugin.html

At first I was getting an error about SNMP.pm not being found. I know snmpd is installed because I installed it for nagios. I had copied SNMP_util.pm over and renamed it to SNMP.pm and this seemed to get me to the next error. “Can’t locate object method “session” via package “Net::SNMP” (perhaps you forgot to load “Net::SNMP”?) at ./check_bgp_snmp.pl line 152.”

I do not know enough about linux to find out what I am missing or need to do, so if anyone can give me some insight I would appreciate it.

The other option I tried was from here: exchange.nagios.org/directory/Pl … rs/details

Put the .sh file in libexec. added strings to command.cfg and nothing. I tried running it manually using this command **“sudo ./check_bgp_neighbors.sh -H 10.0.0.1 -C public -n 10.0.0.2” and i get this.

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.2.1.15.3.1.2.10.0.0.2

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.9.9.187.1.2.4.1.1.10.0.0.2.1.1

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.2.1.15.3.1.12.10.0.0.2

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.2.1.15.3.1.13.10.0.0.2

expr: syntax error

**IP’s and community name are different but used generic for forum purposes


#3

Update on this.

On another forum that I always post on someone helped me out a little. The first site that I was trying to get to work I pretty much have it going. Turns out I needed to install Net::SNMP using the cpan command. Had to su to root, typed in “cpan” (without the quotes), followed the steps then once I got to cpan> I typed in “install Net::SNMP” (again without the quotes).

I run the first command found on the site: ./check_bgp_snmp.pl -r 10.0.0.1 -c public
From this I now get the output: "All BGP Neighbors are sending updates"
I run the second command found on the site: ./bgpmonitor.pl 10.0.0.1
From this I now get the output:

Router: 10.0.0.1 AS 65033
Neighbor: 10.0.0.2 Status: established

Once I put this into nagios I get the same out put from the check_bgp_snmp but from the bgpmonitor I get “(No output returned from plugin)”. It says the status is Ok.

So my question would be do i leave it as is hoping that it will go critical if something happens or is there something else I should be doing.


#4

if you should get an output it shouldn’t say no output returned… looks like something is getting lost between the command line check and the execution in nagios.

Status and output are defined differently in the plugins. the output is simply what the plugin prints, the STATUS in nagios is defined by the return code returned from the script. You could try running the bgpmonitor script to an ip which returns an error and then type “$?” without quotes in the command line if it returns 0 you have a problem as a CRITICAL should return 2… ( nagiosplug.sourceforge.net/devel … html#AEN76 ).