BGP sessions monitoring with nagios

Hey Skunks Has anyone implemented successful BGP sessions monitoring with Nagios? Which plugin did you use and what were the configs? ./TheMburu -- Conservatism is the adherence to the old tried against the new untried.

Hi Mburu, On 2/21/12 9:16 AM, TheMburu George wrote:
Hey Skunks
Has anyone implemented successful BGP sessions monitoring with Nagios? Which plugin did you use and what were the configs?
What do you want to monitor specifically about the BGP sessions. There are a number of bgp neighbor states that can be monitored. The reason being one particular state is likely to give an unlikely picture of what the problem is. Each state is linked to a specific MIB and OIDs (specific to the equipment vendor). Therefore, the best way to go about this is to set snmp traps and use nagios to monitor the traps (snmp trap handlers). I don't have any configs to share however most of the plugin's that come with Nagios have the configuration settings. There are two types of plug-ins for BGP checking those that use the CLI to check the status and those that use the OID's. I would go with the OID's as they are very specific. For the Router settings here you need either to provide a username/password for CLI based plugins and an SNMP community/password for the SNMP OID based plugins. Look at the scripts to see what they are doing. If you are not on Vendor C. you will have to modify the scripts with the right OID's for them to work for you. HTH, Michuki.

Hi Michuki For now the major thing for now is neighbor states. Got two scripts one in perl the other basic shell, from command line the perl script has correct output but when I set it on Nagios the response isnt showing as for the shell script is just not working at all. ./TheMburu On Tue, Feb 21, 2012 at 10:39 AM, Michuki Mwangi <michuki@swiftkenya.com>wrote:
Hi Mburu,
On 2/21/12 9:16 AM, TheMburu George wrote:
Hey Skunks
Has anyone implemented successful BGP sessions monitoring with Nagios? Which plugin did you use and what were the configs?
What do you want to monitor specifically about the BGP sessions. There are a number of bgp neighbor states that can be monitored. The reason being one particular state is likely to give an unlikely picture of what the problem is.
Each state is linked to a specific MIB and OIDs (specific to the equipment vendor). Therefore, the best way to go about this is to set snmp traps and use nagios to monitor the traps (snmp trap handlers).
I don't have any configs to share however most of the plugin's that come with Nagios have the configuration settings.
There are two types of plug-ins for BGP checking those that use the CLI to check the status and those that use the OID's. I would go with the OID's as they are very specific. For the Router settings here you need either to provide a username/password for CLI based plugins and an SNMP community/password for the SNMP OID based plugins.
Look at the scripts to see what they are doing. If you are not on Vendor C. you will have to modify the scripts with the right OID's for them to work for you.
HTH,
Michuki.
-- Conservatism is the adherence to the old tried against the new untried.

On 2/21/12 11:23 AM, TheMburu George wrote:
Hi Michuki
For now the major thing for now is neighbor states. Got two scripts one in perl the other basic shell, from command line the perl script has correct output but when I set it on Nagios the response isnt showing as for the shell script is just not working at all.
Check the logs - or post them here. If you can run the perl one, it looks like a permission issue when its run by Nagios.Try the following; Check the user that Nagios is running as (it varies from OS). Then attempt to run the script as the Nagios user and see if you get the same result. For the shell thats not running at all - try running it in debug mode (from the your shell) $export_DEBUG=on Then run the script using the -x to see the commands as they are executed. If there's something failing you will pick it up from here. bash -x ./scripname.sh HTH, Michuki.

Hi Michuki The permisions are all fine on the perl script, however will try all the tweaks to see if it works. ./TheMburu On Tue, Feb 21, 2012 at 12:07 PM, Michuki Mwangi <michuki@swiftkenya.com>wrote:
On 2/21/12 11:23 AM, TheMburu George wrote:
Hi Michuki
For now the major thing for now is neighbor states. Got two scripts one in perl the other basic shell, from command line the perl script has correct output but when I set it on Nagios the response isnt showing as for the shell script is just not working at all.
Check the logs - or post them here.
If you can run the perl one, it looks like a permission issue when its run by Nagios.Try the following; Check the user that Nagios is running as (it varies from OS). Then attempt to run the script as the Nagios user and see if you get the same result.
For the shell thats not running at all - try running it in debug mode (from the your shell) $export_DEBUG=on
Then run the script using the -x to see the commands as they are executed. If there's something failing you will pick it up from here.
bash -x ./scripname.sh
HTH,
Michuki.
-- Conservatism is the adherence to the old tried against the new untried.

George, The Nagios API specifies that Nagios can only accept output that does not exceed a certaint amount of bytes (cant recall the exact bytes). If your script is returning large amounts then you could have problems. As Michuki has mentioned, try querying using the pre-defined vendor OIDs for best results. I use a distribution of Nagios called Fully Automated Nagios (FAN) comes with a GUI front-end called centreon and has quite a good number checks built-in out of he box. You could give it a try. Regards, Lenya On Tue, Feb 21, 2012 at 4:47 PM, TheMburu George <themburu@gmail.com> wrote:
Hi Michuki
The permisions are all fine on the perl script, however will try all the tweaks to see if it works.
./TheMburu
On Tue, Feb 21, 2012 at 12:07 PM, Michuki Mwangi <michuki@swiftkenya.com>wrote:
On 2/21/12 11:23 AM, TheMburu George wrote:
Hi Michuki
For now the major thing for now is neighbor states. Got two scripts one in perl the other basic shell, from command line the perl script has correct output but when I set it on Nagios the response isnt showing as for the shell script is just not working at all.
Check the logs - or post them here.
If you can run the perl one, it looks like a permission issue when its run by Nagios.Try the following; Check the user that Nagios is running as (it varies from OS). Then attempt to run the script as the Nagios user and see if you get the same result.
For the shell thats not running at all - try running it in debug mode (from the your shell) $export_DEBUG=on
Then run the script using the -x to see the commands as they are executed. If there's something failing you will pick it up from here.
bash -x ./scripname.sh
HTH,
Michuki.
-- Conservatism is the adherence to the old tried against the new untried.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Lenya I think we can take this offline else Im about to give up especially study the OIDs and MIBs. ./TheMburu On Tue, Feb 21, 2012 at 5:07 PM, Anthony Lenya <tlensya@gmail.com> wrote:
George,
The Nagios API specifies that Nagios can only accept output that does not exceed a certaint amount of bytes (cant recall the exact bytes). If your script is returning large amounts then you could have problems. As Michuki has mentioned, try querying using the pre-defined vendor OIDs for best results.
I use a distribution of Nagios called Fully Automated Nagios (FAN) comes with a GUI front-end called centreon and has quite a good number checks built-in out of he box. You could give it a try.
Regards,
Lenya
On Tue, Feb 21, 2012 at 4:47 PM, TheMburu George <themburu@gmail.com>wrote:
Hi Michuki
The permisions are all fine on the perl script, however will try all the tweaks to see if it works.
./TheMburu
On Tue, Feb 21, 2012 at 12:07 PM, Michuki Mwangi <michuki@swiftkenya.com>wrote:
On 2/21/12 11:23 AM, TheMburu George wrote:
Hi Michuki
For now the major thing for now is neighbor states. Got two scripts one in perl the other basic shell, from command line the perl script has correct output but when I set it on Nagios the response isnt showing as for the shell script is just not working at all.
Check the logs - or post them here.
If you can run the perl one, it looks like a permission issue when its run by Nagios.Try the following; Check the user that Nagios is running as (it varies from OS). Then attempt to run the script as the Nagios user and see if you get the same result.
For the shell thats not running at all - try running it in debug mode (from the your shell) $export_DEBUG=on
Then run the script using the -x to see the commands as they are executed. If there's something failing you will pick it up from here.
bash -x ./scripname.sh
HTH,
Michuki.
-- Conservatism is the adherence to the old tried against the new untried.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Conservatism is the adherence to the old tried against the new untried.
participants (3)
-
Anthony Lenya
-
Michuki Mwangi
-
TheMburu George