Page 3 of 4
Re: do not enough $ARG$ for my service
Posted: Wed Aug 04, 2021 8:16 pm
by sacom01
hi ben,
Thanks for your info. I can open the ticket, but our system is a high security system, offline system and you are unable to remote to the system from outside.
So is there another way to check this issue? do we need open the ticket as well?
Thanks.
Re: do not enough $ARG$ for my service
Posted: Thu Aug 05, 2021 11:14 am
by ssax
Try doing this on the remote system:
Code: Select all
mkdir /home/nagios
chown nagios.nagios /home/nagios
chmod 0700 /home/nagios
Then restart the ncpa_listener and try again.
Re: do not enough $ARG$ for my service
Posted: Thu Aug 05, 2021 8:40 pm
by sacom01
hi ben,
i tried but no luck, nothing changed.
only its process show when run the plugin.
Re: do not enough $ARG$ for my service
Posted: Fri Aug 06, 2021 3:51 pm
by ssax
Add this to your
/etc/sudoers:
Code: Select all
nagios ALL=NOPASSWD: /bin/python3 /usr/local/ncpa/plugins/unix_check_OSprocess.py *
Make sure these are set in your
ncpa.cfg:
Code: Select all
.py = python3 $plugin_name $plugin_args
run_with_sudo = unix_check_OSprocess.py
Restart the ncpa_listener service:
Then test:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -P 5693 -t 'xxxxxx' -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'
That should do it. The sudo was required because the plugin is unable to get this info for the non-nagios services:
Code: Select all
if(data["io_counters"] == None) :
continue
Re: do not enough $ARG$ for my service
Posted: Sun Aug 08, 2021 9:14 pm
by sacom01
hi ssax,
i tried but no luck.
it was not work from both nagios xi and remote server.
Re: do not enough $ARG$ for my service
Posted: Mon Aug 09, 2021 1:50 pm
by ssax
Try removing the /bin from the python3 in the sudoers, I had to do that with mine.
Set your run_with_sudo to this (it's not asking for a full path):
Code: Select all
run_with_sudo = unix_check_OSprocess.py
After both of those changes, restart the ncpa_listener service and test again.
Re: do not enough $ARG$ for my service
Posted: Mon Aug 09, 2021 8:49 pm
by sacom01
I tried but not effect bro.
Re: do not enough $ARG$ for my service
Posted: Tue Aug 10, 2021 3:54 pm
by ssax
The run_with_sudo one shouldn't be in the
/etc/sudoers.
Edit your
/etc/sudoers, and add this:
Code: Select all
nagios ALL=NOPASSWD: /usr/bin/python3 /usr/local/ncpa/plugins/unix_check_OSprocess.py
Make sure this line is in your
/usr/local/ncpa/etc/ncpa.cfg on the remote system under the
[plugin directives] section:
Code: Select all
run_with_sudo = unix_check_OSprocess.py
Make sure you can sudo with it now:
Code: Select all
su - nagios
sudo /usr/bin/python3 /usr/local/ncpa/plugins/unix_check_OSprocess.py
Then restart the ncpa_listener service and test:
- Remove the | wc -l from the command so that I can see the output from the command
Re: do not enough $ARG$ for my service
Posted: Tue Aug 10, 2021 9:43 pm
by sacom01
hi,
i tried and able to execute the command in remote server now.
But still not work fine from nagios xi using ncpa. How to do run with sudo from nagios xi?
(wc -l just for shortly and count the result)
Re: do not enough $ARG$ for my service
Posted: Wed Aug 11, 2021 1:30 pm
by ssax
Is this in your ncpa.cfg on the remote system? (it needs to be under the [plugin directives], then restart the ncpa_listener service)
Code: Select all
run_with_sudo = unix_check_OSprocess.py