Thursday, June 22, 2006

Nagios BGP plugin

I converted the script I wrote to monitor BGP on Cisco routers via SNMP into Nagios plugin. I did not like check_bgp plugin which comes with Nagios, because it requires username and password to access a router to be stored in plain text.

Here is how to configure Nagios to use my plugin:
copy check_bgp_snmp.pl into nagios/libexec directory. Then, add the following to Nagios config

define command{       
command_name    check_bgp_snmp
command_line    $USER1$/check_bgp_snmp.pl -r $HOSTADDRESS$ -c $ARG1$
}



define service{
host_name               router1
service_description     BGP CHECK
check_command           check_bgp_snmp!public
max_check_attempts      2
normal_check_interval   5
retry_check_interval    2
check_period            24x7
notification_interval   10
notification_period     24x7
notification_options    w,u,c,r
notifications_enabled   0
contact_groups          admins
}

Download check_bgp_snmp.pl

6 comments:

Debianadmin said...

really great plugin very usefulthank check_bgp

Stefan said...

Great Tool. I just thought about writing it myself :-).

What showed up is that the error in Line 201 isn't completely correct... it's not that the neighbour doesn't send prefixes, it's that it doesn't send updates.

Funnily there doesn't seem to be a oid that states how many prefixes one received from a peer... puzzling, I'd have expected that.

Anyway: Great work!

xBiafra said...

There is problem with nagios plugin for bgp: Page not found

xBiafra said...
This post has been removed by the author.
V. Glinskiy said...

Sorry, fixed the link

xBiafra said...

Thx :)