Configure a plugin as a single command

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Configure a plugin as a single command

Postby prl77 » Mon Mar 27, 2017 12:43 pm

I got a plugin that is working when running from command line. I would now like to implement it, add it to Nagios. But instead of trying to figure out $ARG$ and "!" and adding hosts and services, can I just somehow add this single command without the additional complexity of the other stuff? This will only run with a single set to arguments so I don't need to make it generic so I can customize later for different purposes.
prl77
 
Posts: 2
Joined: Mon Nov 21, 2016 5:42 pm

Re: Configure a plugin as a single command

Postby scottwilkerson » Mon Mar 27, 2017 12:52 pm

yes you can simply add the command like this
Code: Select all
define command {
       command_name                             your_new_check
       command_line                             /your/command/here -a your_arg
}


then add that as the check_command to hosts/services or templates with

Code: Select all
check_command                            your_new_check
User avatar
scottwilkerson
CTO
 
Posts: 7536
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Configure a plugin as a single command

Postby prl77 » Mon Mar 27, 2017 1:12 pm

Thank you for your time Scott.
prl77
 
Posts: 2
Joined: Mon Nov 21, 2016 5:42 pm


Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 2 guests