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

Re: do not enough $ARG$ for my service

Post by sacom01 »

hi ben,
first, ncpa version : Agent_version was ['2.2.2']

the picture you send, "I'm able to view more than one line of output in the XI interface." Two lines you see, it was only ONE, you can see the PID and Mem_vms, it same.

"For testing purposes, can you adjust the thresholds so you definitely are returning more than one line? "
--> you can see thresholds in two server are the same but it show very different result.

i'm not clear what you mean in this.
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,

When I tested this I was not able to notice a difference between running the plugin locally vs using NCPA. Overall the plugin returns an exit code and plugin output that Nagios can process.
the picture you send, "I'm able to view more than one line of output in the XI interface." Two lines you see, it was only ONE, you can see the PID and Mem_vms, it same
I believe this is an issue with the plugin itself and the way it outputs data. Can you provide more specifics are what you would expect to see, my apologies, but I'm not 100% clear on the requirements?

Thanks,
Benjamin
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 »

"Can you provide more specifics are what you would expect to see, my apologies, but I'm not 100% clear on the requirements?"
--> the issue here is it was not show all alert exist in the server. E.g : when we run on the command, it have 80 process have been alerted. But on the Nagios, it show only one - itself process.

You can see the picture, it will show like that
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,

If it's returning in the CLI, but not in the GUI, I suspect it's maxing out the database field size. What is the output of the following command:

Code: Select all

echo 'desc nagios_servicechecks;desc nagios_hostchecks;' | mysql -u root -pnagiosxi nagios -t
--Benjamin
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,
"I suspect it's maxing out the database field size" --> i dont think so bro. At least it will show 7-8 rows, it work like that on UAT environment but in production it show just one as you known.
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,

Thanks for posting the query, that looks okay. It looks like what is happening is when running the plugin, NCPA runs as the nagios user account and it can only see the processes for that user account.

If you want to see every process, then the plugin will have to run as sudo. In order to do this, NCPA has to be version 2.1 or higher.
New configuration options - New configuration options available:
run_with_sudo - Comma separated list of plugin names that should be ran through sudo
See:
https://www.nagios.org/ncpa/help/2.2/index.html
https://github.com/NagiosEnterprises/ncpa/issues/304

Try enabling sudo and test this once more. In the ncpa.cfg file on the remote host add the following

Code: Select all

run_with_sudo = /usr/local/ncpa/plugins/check_OSprocess.py
Then add the following to the "/etc/sudoers" file on your remote NCPA agent.

Code: Select all

nagios ALL=(ALL) NOPASSWD:/usr/local/ncpa/plugins/check_OSprocess.py
Be sure to restart the NPCA service after making those changes. If you get any error messages, please post them to the thread.

Code: Select all

systemctl restart  ncpa_listener
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,
i tried add sudo for plugin but not effect.
then i tried run on remote server using nagios user but it not work as well :(
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: do not enough $ARG$ for my service

Post by ssax »

What is the output of this command on the remote system (not the XI server)?

Code: Select all

mount | grep hidepid
I didn't need to use sudo on mine, all I had to do was change this in the ncpa.cfg:

Code: Select all

.py = python3 $plugin_name $plugin_args
If you run these commands as root on the remote system, do you see all the pids from other users?

Code: Select all

su - nagios
ps aux
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: do not enough $ARG$ for my service

Post by sacom01 »

hi,
python3 already set for python on ncpa.cfg
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,

Thanks for checking that. Please open a support ticket for this issue and reference this post when opening a ticket. We'll have to get a remote session set up to take a closer look at the systems as we haven't been able to replicate the issue here.

To open a support ticket:

https://support.nagios.com/tickets/

Thanks,
Benjamin
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