F5 Check Failing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
aylesworth
Posts: 31
Joined: Mon Mar 22, 2021 12:57 pm

F5 Check Failing

Post by aylesworth »

Hello,

We have a couple checks that look at an F5 load balancer pair, on this new instance of Nagios XI it fails, on the old version of Core it works just fine. The F5's are configured to allow SNMP access from the entire subnet, so I don't believe that allowance is part of the issue.

Here's the command/output from the old server, names and IPs have been changed:
[root@Nagios-Core libexec]# ./check_snmp_gtm_server.sh [snmp key here] [IP here] f5-Primary
OK - bigip health check of f5-Primary passed

And the command/output from the new server:
[nagios@Nagios-XI ~]$ /usr/local/nagios/libexec/check_snmp_gtm_server.sh [snmp key here] [IP here] f5-Primary
CRITICAL - bigip health check of f5-Primary failed

This happens when run as root or su - nagios

Not quite sure how to proceed.

Thanks!
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: F5 Check Failing

Post by pbroste »

Hello @aylesworth

Thanks for reaching out, looks like the plugin in unable to pull the data or incorrect data.

what do you get when you run the plugin with verbose:

Code: Select all

bash -v /usr/local/nagios/libexec/check_snmp_gtm_server.sh [snmp key here] [IP here] f5-Primary
or

Code: Select all

bash -x /usr/local/nagios/libexec/check_snmp_gtm_server.sh [snmp key here] [IP here] f5-Primary
Thanks,
Perry
aylesworth
Posts: 31
Joined: Mon Mar 22, 2021 12:57 pm

Re: F5 Check Failing

Post by aylesworth »

Hi Perry,

Thanks for the response, and sorry for the delay. Here's the output of both, I've redacted the string, ip and hostnames like before, but they're proper in the output.

Code: Select all

[root@NagiosXI ~]# bash -v /usr/local/nagios/libexec/check_snmp_gtm_server.sh [snmp string] [ip] [host]
#!/bin/bash
#
# This script is used to check GTM Server status - mainly
# to see if one BigIP running GTM thinks other BigIPs are OK.

snmpstring=$1
bigip=$2
remotebigip=$3

export MIBS=ALL

result=`snmpwalk -v 2c -c $snmpstring $bigip F5-BIGIP-GLOBAL-MIB::gtmServerStatusAvailState 2>&1 | grep $remotebigip | sed 's/^.*INTEGER: //' | sed 's/(.)//'`
snmpwalk -v 2c -c $snmpstring $bigip F5-BIGIP-GLOBAL-MIB::gtmServerStatusAvailState 2>&1 | grep $remotebigip | sed 's/^.*INTEGER: //' | sed 's/(.)//'

if [[ $? -ne 0 ]]; then
	echo "UNKNOWN - $result"
	exit 3
fi

if [[ $result == 'green' ]]; then
	echo "OK - bigip health check of $remotebigip passed"
	exit 0
else
	echo "CRITICAL - bigip health check of $remotebigip failed"
	exit 2
fi
CRITICAL - bigip health check of [hostname] failed

[root@NagiosXI ~]# bash -x /usr/local/nagios/libexec/check_snmp_gtm_server.sh [snmp string] [ip] [host]
+ snmpstring=[string]
+ bigip=[ip]
+ remotebigip=[hostname]
+ export MIBS=ALL
+ MIBS=ALL
++ snmpwalk -v 2c -c [snmp-string] [ip] F5-BIGIP-GLOBAL-MIB::gtmServerStatusAvailState
++ sed 's/^.*INTEGER: //'
++ grep [hostname]
++ sed 's/(.)//'
+ result=
+ [[ 0 -ne 0 ]]
+ [[ '' == \g\r\e\e\n ]]
+ echo 'CRITICAL - bigip health check of [hostname] failed'
CRITICAL - bigip health check of [hostname] failed
+ exit 2
This is from the XI server, the Core server reports output as expected with OK.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: F5 Check Failing

Post by pbroste »

Hello @aylesworth

Thanks for following up and providing the results. Curious that it was working on the old but not on the new, so we wonder if there are any security applications like SELinux, AppArmor, etc... blocking things. Would you please check your /var/log's to see if there is any messages associated if not already done so.

Thanks,
Perry
aylesworth
Posts: 31
Joined: Mon Mar 22, 2021 12:57 pm

Re: F5 Check Failing

Post by aylesworth »

Hey Perry,

I don't see anything in var/log having to do with the f5, is there any file/directory within var/log in particular I should be looking in?

Thanks!
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: F5 Check Failing

Post by pbroste »

Hello @aylesworth

Thanks for following up, appears that we are not seeing any errors or warnings logged so let's go ahead and run the snmpwalk on that and follow up on the results:

We want to see a list from this:

Code: Select all

snmpwalk -v 2c -c <yourrocommunitystring>  <youraddressofdevice> F5-BIGIP-GLOBAL-MIB::gtmServerStatusAvailState
The script is looking for results from the following:

Code: Select all

snmpwalk -v 2c -c <yourrocommunitystring> <youraddressonbigip> F5-BIGIP-GLOBAL-MIB::gtmServerStatusAvailState 2>&1 | grep <youraddressonremotebigip> | sed 's/^.*INTEGER: //' | sed 's/(.)//'
And

Code: Select all

snmpwalk -v 2c -c <yourrocommunitystring> <youraddressbigip> F5-BIGIP-GLOBAL-MIB::gtmServerStatusAvailState 2>&1 | grep <youraddressonremotebigip | sed 's/^.*INTEGER: //' | sed 's/(.)//'
Please follow up with the results.
Thanks,
Perry
aylesworth
Posts: 31
Joined: Mon Mar 22, 2021 12:57 pm

Re: F5 Check Failing

Post by aylesworth »

Hi Perry,

The first command failed with the following result:
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (F5-BIGIP-GLOBAL-MIB): At line 0 in (none)
F5-BIGIP-GLOBAL-MIB::gtmServerStatusAvailState: Unknown Object Identifier

The second two returned blank.

Thanks!
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: F5 Check Failing

Post by pbroste »

Hello @aylesworth

Thanks for following up, appears that the F5-BIGIP-GLOBAL-MIB is not available. Attached is the F5-BIGIP-GLOBAL-MIB mibs file to be placed in the /usr/share/snmp/mibs/.

Then re-run the commands found in the previous post.

Thanks,
Perry
You do not have the required permissions to view the files attached to this post.
aylesworth
Posts: 31
Joined: Mon Mar 22, 2021 12:57 pm

Re: F5 Check Failing

Post by aylesworth »

Thanks Perry,

Am I dropping the whole tar into that directory or one of the contained files?

Thanks!
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: F5 Check Failing

Post by pbroste »

Hello @ayleworth

Either will work drop the F5-BIGIP-GLOBAL-MIB or drop the extracted contents it will read from the match.

Thanks,
Perry
Locked