check_nrpe arguments from a file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rjmon
Posts: 106
Joined: Wed Dec 06, 2017 11:39 am

check_nrpe arguments from a file

Post by rjmon »

Is it possible to read arguments from a file. i have 5 processes to be monitored instead of creating 5 processes config manually i want it to read the arguments from a file.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: check_nrpe arguments from a file

Post by eloyd »

If the plugin you're using supports reading parameters from a file, then yes. If it doesn't, you could always write a short shell script wrapper than does, and then passes them off to the appropriate plugin command.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe arguments from a file

Post by scottwilkerson »

or as part of the command you could add the following where the arguments should come from

Code: Select all

$(cat /path/to/file)
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: check_nrpe arguments from a file

Post by eloyd »

True. Shell-based file substitution is an option as well. It may get confusing if you have to escape that inside an NRPE request or something else, though.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe arguments from a file

Post by scottwilkerson »

Let us know if this doesn't work for you.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
rjmon
Posts: 106
Joined: Wed Dec 06, 2017 11:39 am

Re: check_nrpe arguments from a file

Post by rjmon »

Thanks Scott i tested your idea and implemented it. Also tested eloyd idea using wrapper script also works.

Code: Select all

$(cat /path/to/file)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe arguments from a file

Post by scottwilkerson »

Glad to see it was resolved!!

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked