How to pass arguments to plugin via NCPA config 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
dianad
Posts: 1
Joined: Thu Sep 21, 2017 11:51 am

How to pass arguments to plugin via NCPA config file?

Post by dianad »

Hello,

I'm trying to set up a passive check in NCPA that calls a plugin. The plugin works if I su to nagios and execute it. It also works from the browser when passing the two required arguments:

Code: Select all

https://x.x.x.x:5693/api/plugins/check_proc_uptime.sh/java/5/?token=mytoken
What I can't figure out is the syntax to pass arguments from the NCPA configuration file (java and 5 in this case).

Code: Select all

[passive checks]

%HOSTNAME%|__HOST__ = system/agent_version
%HOSTNAME%|Process Check = plugins/check_proc_uptime.sh java 5
Note, if I modify the script and don't try to pass arguments to it everything works. :|
Thanks!
kyang

Re: How to pass arguments to plugin via NCPA config file?

Post by kyang »

A good document on passing arguments via NCPA passive checks will be posted.
https://www.nagios.org/ncpa/help/2.0/passive.html

It seems like this is a good example from the documentation. Using a plugin to pass arguments. So depending on the args you want to pass with the check_proc_uptime plugin.
The / to separate arguments.

Code: Select all

server1.local|CPU Usage = plugins/check_cpu/-H server1.local/-w 60/-c 80
server2.local|CPU Usage = plugins/check_cpu/-H server2.local/-w 60/-c 80
%HOSTNAME%|CPU Usage = cpu/percent --warning 60 --critical 80 --aggregate avg
Let us know if this helps!
Locked