do not enough $ARG$ for my service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

do not enough $ARG$ for my service

Post by sacom01 »

hi team,
I have a plugin with check 4 parameter : cpu, vms, io_read, io_write. Every parameter need check have -w and -c, so we have 8 arguments (4 -w and 4 -c)
When we check the service for client svr using ncpa, it will have 10 arguments : 4 -w and 4 -c and port and token.
But we have only 8 $ARGS like picture.

is there any way for this case? Now i have to hard code for fix 4 -w and 4 -c inside my code but it's very inconvenience.

Thank you.
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: do not enough $ARG$ for my service

Post by benjaminsmith »

Hi,

I can submit a feature request for this if you'd like. The recommended workaround to the limitiation of 8 arguments in the interface is to combine multiple arguments into one argument field.

If you need any assistance, please post the full check command, and we'll review the arguments.

Thanks,
Ben
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: do not enough $ARG$ for my service

Post by sacom01 »

i tried fix -p port and -t token to the command but facing error.
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: do not enough $ARG$ for my service

Post by benjaminsmith »

Hi,

That ought to work. Try wrapping the token in single quotes, 'mytoken', perhaps it's not getting passed over correctly.

I'm not familiar with the syntax on this plugin and was unable to locate it from Google but select the Run Check Command button, then cut and paste the command string into the CLI and get working from thee and then make adjustments in the CCM. There could be an error in the syntax.
test-check-command.png
If that's not working, please attach the plugin and I'll try to replicate it the best I can. Thanks, Benjamin
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: do not enough $ARG$ for my service

Post by sacom01 »

i can not see your attach, pls share it again.
i tried fix -t 'token' but no luck, not work
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: do not enough $ARG$ for my service

Post by benjaminsmith »

Hi,

Okay, not sure why you are not able to view that attachment. I checked your account and it looks correct. Please follow the step in the article below to retrieve the full check command and post it to the ticket. Thanks,Benjamin

Nagios XI - How To Test Check Commands From The Command-line
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: do not enough $ARG$ for my service

Post by sacom01 »

hi ben,
i sent you my plugin, pls check your ib and help me review it.
thanks.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: do not enough $ARG$ for my service

Post by benjaminsmith »

Hi,

Got the plugin and I was able to get this going. After putting the plugin in the NCPA plugin directory, I ran the NCPA wizard.
ccm-command-setup.png
As you can see, it's only using one argument, but you could configure it differently. Here's the full check command.

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 192.168.23.140  -P 5693 -t 'mytoken' -P 5693  -M 'plugins/unix_check_OSprocess.py' -q 'args=-wC 1 -cC 2  -wR 10 -cR 20 -wW 10 -cW 20 -wV 150 -cV 200'
NCPA uses python version 2 so its necessary to install python3 to run this. Then be sure to add python 3 to the npca.cfg file.

/usr/local/ncpa/etc/ncpa.cfg

Code: Select all

.py = python3 $plugin_name $plugin_args
More details on this in the thread below.
https://support.nagios.com/forum/viewto ... 16&t=61959

Let me know if you get it working. If you haven't done so already, it also will require installing python3 and psutil on the remote server.

--Benjamin
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: do not enough $ARG$ for my service

Post by sacom01 »

i did it, but now i have another problem with this plugin.
when i run the command on client server, it show many alerts, but when run with ncpa from nagios xi, it show only one alert (itself process)
plugin permission was 755 already
-rwxr-xr-x 1 root root 5237 Jul 28 14:56 unix_check_OSprocess.py
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: do not enough $ARG$ for my service

Post by benjaminsmith »

HI sacom01,

For testing purposes, can you adjust the thresholds so you definitely are returning more than one line?

It could be changing states between running it locally and from XI.

I'm able to view more than one line of output in the XI interface.
xi-output.png
NCPA GUI
ncpa-output.png
Let me know what you find out. Also, what version of NCPA are you using, if it's really old it may not handle multi-line output. Post the output of the command below. Thanks, Benjamin

Code: Select all

curl -k -L -vvv 'https://<IP address>:5693/api/system/agent_version/?token=<token>&check=1'
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked