Tryingt to use check_pix_failover plugin

I’m trying to use the “check_pix_failover” plugin but I seem to be having problems. If I run the command it actually works and I get

./check_pix_failover -H 10.10.10.10 -C password
OK - Primary: Active, Secondary: Standby

But after adding the commands to commands.cfg

define command{
command_name check_pix_failover
command_line $USER1$/check_pix_failover -H $HOSTADDRESS$ -C $USER3$ -o '$ARG1$ -R $ARG2$
}

and creating the host

define host{
use generic-switch ; Inherit default values from a template
host_name test-fw ; The name we’re giving to this switch
alias test-fw ; A longer name associated with the switch
address 10.10.10.10 ; IP address of the switch
hostgroups firewalls ; Host groups this switch is associated with
}

define service {
host_name test-fw
service_description Status check
check_command check_pix_failover
max_check_attempts 1
}

After restarting nagios it doesn’t seem to show whether the primary or secondary is active I get the following error

Status Information: (null)

Info
firewall pix 535
Nagios 3.03
Red Hat 5
Mysql 5

I hope someone can help.

Hi,

in your command definition, you have:
command_line $USER1$/check_pix_failover -H $HOSTADDRESS$ -C $USER3$ -o '$ARG1$ -R $ARG2$

meaning that this command is awaiting 2 arguments AND that it will pass the options -o and -R to the plugin

So, you have 2 solutions:

  1. you want to pass the same command as:
    ./check_pix_failover -H 10.10.10.10 -C password
    => use this line for your command definition:
    command_line $USER1$/check_pix_failover -H $HOSTADDRESS$ -C $USER3$
    (assuming that your $USER3$ variable is set to “password”!)

  2. use your command definition, because the -o and -R options are usefull, after all
    => check_command check_pix_failover!your_first_arg!your_2nd_arg

Hope this helps :slight_smile:

I did this but I’m still having the same problem

define command{
command_name check_pix_failover
command_line $USER1$/check_pix_failover -H 10.10.10.10 -C password -o '$ARG1$ -R $ARG2$
}

define service {
host_name test-fw
service_description PIX Failover Check
check_command check_pix_failover!Primary:idea:Active
max_check_attempts 1
}

well, if the command
./check_pix_failover -H 10.10.10.10 -C password

works and the results are enough, then use:

define command{
command_name check_pix_failover
command_line $USER1$/check_pix_failover -H 10.10.10.10 -C password
}

define service {
host_name test-fw
service_description PIX Failover Check
check_command check_pix_failover
max_check_attempts 1
}

note:
in your post, are the “:” there on purpose?
check_command check_pix_failover!Primary**:**!Active

I tried that already and although it works with the command it doesn’t seem to work work with the config files.

The reason I had “:” is because when I run the command I get the following

OK - Primary: Active, Secondary: Standby