Hi All,
I have a question about using the check_snmp plugin that be easily answered. Basically I have two devices that use different snmp protocols so I need the ability to use the same plugin for two different checks. When i define two different check_commands using the same snmp plugin it errors out.
Here is my first check_command:
define command {
command_name check_snmp
command_line $USER1$/check_snmp -P 2c -H $HOSTADDRESS$ -C $ARG1$ -o $ARG2$
}
define command {
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o $ARG2$
}
As you can see the first command I need to use "2c" to get the info from the device. On my second command I don't need to specify anything. Nagios will error out until I change one of the commands.
Is there a way to set a variable in the command line of the check command. For instance:
define command {
command_name check_snmp
command_line $USER1$/check_snmp -v $AGR1$ -H $HOSTADDRESS$ -C $ARG2$ -o $ARG3$
I tried doing something like this and i still had issues. Any help would be appreciated.
}
check_snmp multiple protocol version
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: check_snmp multiple protocol version
Did you have $ARG1$ spelled correctly?00_kl250 wrote:define command {
command_name check_snmp
command_line $USER1$/check_snmp -v $AGR1$ -H $HOSTADDRESS$ -C $ARG2$ -o $ARG3$
}
What were you using for $ARG1$?
This should work fine for you.
Re: check_snmp multiple protocol version
I fixed my own problem:
instead of -v, i used -P:
define command {
command_name check_snmp
command_line $USER1$/check_snmp -P $ARG1$ -H $HOSTADDRESS$ -C $ARG2$ -o $ARG3$
}
all working now.
thx
instead of -v, i used -P:
define command {
command_name check_snmp
command_line $USER1$/check_snmp -P $ARG1$ -H $HOSTADDRESS$ -C $ARG2$ -o $ARG3$
}
all working now.
thx