HRSP plugin issue


#1

Hi,

Im trying to get this HRSP check working

nagiosexchange.org/cgi-bin/p … 5.html;d=1
or directly from here
myneo.de/upload/nagios/check_cisco_hsrp.sh

but theres a syntax error in it somewhere which I just cant find :frowning:

[root@optiplex libexec]# ./check_cisco_hsrp.sh
./check_cisco_hsrp.sh: line 171: syntax error: unexpected end of file

Im just wondering if theres someone here who might be able to spot the problem.

Thanks in advance
Tom


#2

Hi,

Since I did not find a reply I might as well post my solution:

I changed the line

print_usage() { echo "Usage: $PROGNAME -H <HOSTNAME> -C <COMMUNITY> -m active|standby|state ip|ip|state" }
so the last ‘}’ is on a newline. It seems to work OK now


#3

man you are brilliant and i should say hats off, i was not able to figure this out, however did you get it work?
i am not able to work with the plugun, it shows me the following error:

./check_cisco_hsrp.sh -H 10.1.95.1 -C public -m state 5
-text omitted-
./check_cisco_hsrp.sh: line 146: : : integer expression expected
./check_cisco_hsrp.sh: line 149: : : integer expression expected
./check_cisco_hsrp.sh: line 152: : : integer expression expected
./check_cisco_hsrp.sh: line 155: : : integer expression expected
./check_cisco_hsrp.sh: line 158: : : integer expression expected
./check_cisco_hsrp.sh: line 161: : : integer expression expected
UNKNOWN - State unknown

and if i gave:
./check_cisco_hsrp.sh -H 10.1.95.2 -C public -m active 10.1.95.1
result is:
You are querying 10.1.95.2, which is not the HSRP Ip Address, please use for the Checks

what each of the ip addresses reflects?
please help me with the mentioned