Search found 8 matches
- Fri Jan 23, 2015 2:53 pm
- Forum: Open Source Nagios Projects
- Topic: Optional parameters in plugins
- Replies: 3
- Views: 4955
Re: Optional parameters in plugins
Thanks for the tip, I'll give it a shot.
- Fri Jan 23, 2015 1:45 pm
- Forum: Open Source Nagios Projects
- Topic: Optional parameters in plugins
- Replies: 3
- Views: 4955
Optional parameters in plugins
Hi all, We've written a nagios plugin using a bash shell script. It works fine, takes a few arguments, and we'd like to allow for optional parameters. I'm not sure a good way to do it however? The plugin definition looks like this in nagios_command.cfg: define command { command_line /usr/lib/my_shel...
- Fri Oct 17, 2014 7:10 pm
- Forum: Open Source Nagios Projects
- Topic: 1st plugin, not sure about passing arguments
- Replies: 7
- Views: 5963
Re: 1st plugin, not sure about passing arguments
Thanks for the assistance. I finally got this working after studying this tutorial here: http://nagios.sourceforge.net/docs/nagioscore/3/en/macros.html My final entries read like this: check_command my_command!$HOSTADDRESS$!9000!./tmp/settings_file!80 command_line $USER1$/my_shell_script.sh -H $ARG1...
- Thu Oct 16, 2014 9:34 am
- Forum: Open Source Nagios Projects
- Topic: 1st plugin, not sure about passing arguments
- Replies: 7
- Views: 5963
Re: 1st plugin, not sure about passing arguments
Hmm. My new setup now reads like this: define command { command_name my_command command_line $USER1$/my_shell_script.sh } define service { use generic-service; host_name localhost; service_description some description check_command my_command!"-H my.server.of.interest -P 9000 -I ./tmp/settings_...
- Wed Oct 15, 2014 9:31 am
- Forum: Open Source Nagios Projects
- Topic: 1st plugin, not sure about passing arguments
- Replies: 7
- Views: 5963
Re: 1st plugin, not sure about passing arguments
A service needs to be attached to a host, so if you already have a localhost host set up, just put "localhost" in there. For the command, you will wanna put this: my_command!"-H my.server.of.interest -P 9000 -I ./tmp/settings_file -timeout 80" Thank you very much, I'll try that.
- Tue Oct 14, 2014 5:51 pm
- Forum: Open Source Nagios Projects
- Topic: 1st plugin, not sure about passing arguments
- Replies: 7
- Views: 5963
1st plugin, not sure about passing arguments
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...
- Thu Aug 28, 2014 3:44 pm
- Forum: Open Source Nagios Projects
- Topic: Named arguments in a nagios plugin?
- Replies: 2
- Views: 1815
Re: Named arguments in a nagios plugin?
Works for me, thanks!tmcdonald wrote:Technically you can just use $ARG1$ and cram all the flags into that one arg.
- Thu Aug 28, 2014 3:32 pm
- Forum: Open Source Nagios Projects
- Topic: Named arguments in a nagios plugin?
- Replies: 2
- Views: 1815
Named arguments in a nagios plugin?
Hi everyone, I'm writing my first plugin and am learning about the $ARGx macros. It seems from my reading that you have to supply your plugin with arguments in a particular order? Is there a way to do named parameters instead? I ask because my plugin (a Unix shell script) has a fair number of config...