Forum Discussion
Notifying Nagios that a Node is down/disabled
i'm using Big IP 9.4.5 Build 1049.10 Final and need a advice.
In my environment I use Nagios for monitoring every server and service.
Now, i started using Big IP for balancing LDAP-requests.
What I need now is, that Big IP sends a notification/snmp-trap to my Nagios-Server whenever a node is marked as "disabled" or "down" depending on my LDAP-Health-Monitor.
Is there a simple way to do this?
My first thought was to create a nagios-check that checks the Big IP logfiles for some keywords using ssh but I dont really like this solution.
Has anyone an idea how to configure Big IP for sending out SNMP-Traps to Nagios?
I'm new to Big IP and i appreciate every advice.
Thank you.
Bye,
Timo
16 Replies
- Timo_Schlueter_
Nimbostratus
I wrote a simple perl script for Nagios/Icinga a while ago where you can specify the hostname of the appliance and the pool name you want to monitor. It simply gives you the status of the pool and the number of active nodes.
Usage: check_ltm_pool.pl LTMHOSTNAME POOLNAME
Example output: "OK - Pool: EXAMPLE-POOL / Status: available / Members active: 2 out of 2"
or
"WARNING: Pool EXAMPLE-POOL / Status: available /Members active 1 out of 3"
The script is very quick and dirty written. But maybe you can use it as a start for your own check:
!/usr/bin/perl Nagios-Check to monitor Big IP 11 Pool and Member availability. Timo Schlueter (26.04.2012) Mail: timo@timo.in use Switch; my $snmpwalkPath = "/usr/bin/snmpwalk"; my $snmpCommunity = "public"; my $hostname = $ARGV[0]; my $pool_name = $ARGV[1]; my $outputString = "Pool: " . $pool_name . " / "; my $activeMemberCountOid = "1.3.6.1.4.1.3375.2.2.5.1.2.1.8"; my $availableMemberCountOid = "1.3.6.1.4.1.3375.2.2.5.1.2.1.23"; my $poolAvailabilityCountOid = "1.3.6.1.4.1.3375.2.2.5.5.2.1.2"; my $critCount = 0; my $warnCount = 0; my $unknwonCount = 0; if ($ARGV[0] eq "" || $ARGV[1] eq "") { print "UNKNOWN - Missing parameters."; exit 1; } $pool_availability = snmpwalkCmd($poolAvailabilityCountOid); $members_available = snmpwalkCmd($availableMemberCountOid); $members_active = snmpwalkCmd($activeMemberCountOid); if ($pool_availability eq "" || $members_available eq "" || $members_active eq "") { print "UNKNOWN - Invalid pool or snmp problem."; exit 1; } sub snmpwalkCmd { $pool_oid = $pool_name; $pool_oid =~ s/(.)/sprintf('.%u', ord($1))/eg; $output = `$snmpwalkPath -v2c -c $snmpCommunity -m '' -On -Oe $hostname $_[0] | grep $pool_oid`; @array = split(' ', $output); @array[$array]; } switch($pool_availability) { case 0 { $outputString .= "Status: not availabie"; $critCount++; break; } case 1 { $outputString .= "Status: available"; break; } else { $outputString .= "Status: unknown"; $unknownCount++; break; } } $outputString .= " / "; if ($members_active == 0) { $outputString .= "Members active: 0 out of $members_available"; $critCount++; } else { if ($members_active < $members_available) { $outputString .= "Members active: $members_active out of $members_available"; $warnCount++; } else { $outputString .= "Members active: $members_active out of $members_available"; } } if ($critCount > 0) { print "CRITICAL - " . $outputString; exit 2; } if ($warnCount > 0) { print "WARNING - " . $outputString; exit 1; } if ($unknownCount > 0) { print "UNKNOWN - " . $outputString; exit 3; } print "OK - " . $outputString; exit 0;Regards, Timo
- Leon_Johnson_11
Nimbostratus
Great work Timo! You should put this up on http://exchange.nagios.org/ or github. This is the first v11 pool check that I've come across. - Timo_Schlueter_
Nimbostratus
Thank you Leon. I will clean up the code here and there and will put it up on Nagios Exchange. Good idea! - Timo_Schlueter_
Nimbostratus
I did a rewrite of the script above and just uploaded it to Nagios Exchange. I have used it in our productive environment for 5 days now on Big IP version 11.1 without any problems. You can find it here: http://exchange.nagios.org/directory/Plugins/Hardware/Network-Gear/F5/Big-2DIP-Pool-Status-Check/details Some feedback would be great! :)
- eszer_28053
Nimbostratus
Finally, I've made my own script to check this. It's on github, and I hope it's simple to use.
I had a problem with F5mibs. I had to copy them on /usr/share/snmp/mibs/
Once I had them, snmpwalk returned human readable lines.
This are sn mibs I have on my system for f5 checks:
/usr/share/snmp/mibs/F5-BIGIP-APM-MIB.txt
/usr/share/snmp/mibs/F5-BIGIP-LOCAL-MIB.txt
/usr/share/snmp/mibs/F5-EM-MIB.txt /usr/share/snmp/mibs/F5-BIGIP-COMMON-MIB.txt
/usr/share/snmp/mibs/F5-BIGIP-SYSTEM-MIB.txt /usr/share/snmp/mibs/F5-BIGIP-GLOBAL-MIB.txt
/usr/share/snmp/mibs/F5-BIGIP-WAM-MIB.txtFeel free to improve the check script!
- rmd1023
Nimbostratus
Thanks! I forked the repo and will check it out.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
