Page 1 of 1

help with plugin 'check_compellent"

Posted: Thu Jan 30, 2020 3:07 pm
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.

Re: help with plugin 'check_compellent"

Posted: Thu Jan 30, 2020 5:43 pm
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.

Re: help with plugin 'check_compellent"

Posted: Fri Jan 31, 2020 9:04 am
by emcmahon
i will try this. thank you.

Re: help with plugin 'check_compellent"

Posted: Fri Jan 31, 2020 9:27 am
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?

Re: help with plugin 'check_compellent"

Posted: Fri Jan 31, 2020 5:27 pm
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.