help with plugin 'check_compellent"

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
emcmahon
Posts: 8
Joined: Tue Jan 28, 2020 11:05 am

help with plugin 'check_compellent"

Post by emcmahon »

we are using the check_compellent located here: https://exchange.nagios.org/directory/P ... nt/details

if i SNMPWALK
snmpwalk -v 2c -O vqe -c public x.x.x.x .1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.4 to get server names.
and
snmpwalk -v 2c -O vqe -c public x.x.x.x .1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.3 to get the status ( connected/disconnected/unknown/ok )

the odd thing is i seem to be pulling accurate info where the server list and the status of 2 downed servers seems correct

but

nagios displays the wrong server names as down.

these two are down and the snmpwalk agrees
server1 2
server2 2

nagios displays:
Down Servers: "server9" "server11" < these servers are up and OK.

any ideas would be appreciated.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: help with plugin 'check_compellent"

Post by Box293 »

I looked at the plugin and it does not seem to have any verbose option for printing out the logic.

I would add some echo statements in the sections where the logic is happening, for example:

Code: Select all

		declare -a servercrit=($(snmpwalk -v 2c -O vqe -c ${community} ${host} .1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.3 | grep -n "3" | awk -F : '{print $1}' | tr '\n' ' '))
	        c=0
                for line in ${servercrit[@]}
                do servercrit[$c]=`expr ${servercrit[$c]} - 1`
                echo "$c"
                echo "servercrit[$c]"
                let c++
                done
                # find the corresponding names of the critical server
                c=0
                for line in ${servercrit[@]}
                do serverfinalcrit[${c}]=${servernames[$line]}
                echo "$c"
                echo "serverfinalcrit[${c}]"
                let c++
                done
Specifically:

Code: Select all

                echo "$c"
                echo "servercrit[$c]"
and:

Code: Select all

                echo "$c"
                echo "serverfinalcrit[${c}]"
You need to follow the logic of the script to see what is happening and see if you can determine patterns.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
emcmahon
Posts: 8
Joined: Tue Jan 28, 2020 11:05 am

Re: help with plugin 'check_compellent"

Post by emcmahon »

i will try this. thank you.
emcmahon
Posts: 8
Joined: Tue Jan 28, 2020 11:05 am

Re: help with plugin 'check_compellent"

Post by emcmahon »

Code: Select all

echo "$c"
                echo "serverfinalcrit[${c}]" 

echo "$w"
                echo "serverfinalwarn[${w}]"

echo "$o"
                echo "serverfinalok[${o}]"  

added the echo statements above to each section.

when i run the check:
./check_compellent.pl -H x.x.x.x -C public -t server -w 2 -c 3

it starts to display a list:

serverwarn[]

serverwarn[]

serverok[]
1
serverok[1]
2
serverok[2]
3
.........

serverok[122]
123
serverok[123]
124
serverok[124]
Down Servers: "notdownserver1" "notdownserver2" < names changed to protect the innocent. ;)


still listing the incorrect server names as down.
ideas?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: help with plugin 'check_compellent"

Post by cdienger »

The full commands it runs are:

Code: Select all

declare -a servernames=($(snmpwalk -v 2c -O vqe -c ${community} ${host} .1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.4 | tr '\n' ' '))
declare -a serverwarn=($(snmpwalk -v 2c -O vqe -c ${community} ${host} .1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.3 | grep -n "2" | awk -F : '{print $1}' | tr '\n' ' '))
I think it is failing to line up the servers that are returned with the statuses that are returned:

Code: Select all

       		declare -a serverwarn=($(snmpwalk -v 2c -O vqe -c ${community} ${host} .1.3.6.1.4.1.674.11000.2000.500.1.2.27.1.3 | grep -n "2" | awk -F : '{print $1}' | tr '\n' ' '))
	        c=0
                for line in ${serverwarn[@]}
                do serverwarn[$w]=`expr ${serverwarn[$w]} - 1`
                let c++
                done
                # find the corresponding names of the warning server
                c=0
                for line in ${serverwarn[@]}
                do serverfinalwarn[${w}]=${servernames[$line]}
                let w++
                done
I'm not able to test and think it may be worth trying to print out these arrays to see if they line up.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked