1st plugin, not sure about passing arguments
Posted: Tue Oct 14, 2014 5:51 pm
Hi everyone,
I've installed my first plugin on a Nagios server, but am having trouble getting the arguments right. I've tried some things with $ARG1$ but realized, after doing this and that, I'm essentially just flopping around.
One complication, perhaps: this plugin is supposed to run on the nagios server itself, no npre call to a remote box.
The plugin is a shell script that makes a curl call against a remote box under the hood. Typical command line use with flags would read:
(yes, it has its own '-H' flag, unrelated to nagios' hostname flag.)
Here's the skeleton I have right now. Nagios appears to think all my flags are one giant one.
The above is a little stripped down for readability, but that's the gist of it. It's the hostname and arguments and bits in the 'what do I put here' that are giving me trouble. I could use a nudge, and thanks for the suggestions.
I've installed my first plugin on a Nagios server, but am having trouble getting the arguments right. I've tried some things with $ARG1$ but realized, after doing this and that, I'm essentially just flopping around.
One complication, perhaps: this plugin is supposed to run on the nagios server itself, no npre call to a remote box.
The plugin is a shell script that makes a curl call against a remote box under the hood. Typical command line use with flags would read:
Code: Select all
my_shell_script.sh -H my.server.of.interest -P 9000 -I ./tmp/settings_file -timeout 80Here's the skeleton I have right now. Nagios appears to think all my flags are one giant one.
Code: Select all
define command {
command_name my_command
command_line $USER1$/my_shell_script.sh $ARG1$
}
define service {
use generic-service;
host_name {{what do I put here? This is supposed to run on the nagios box itself. My shell script is installed on it.}};
service_description some description
check_command my_command!{{what goes here?}}
}