Zombie process monitor using NCPA

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
IT-OPS-SYS
Posts: 184
Joined: Sun Jan 07, 2018 12:56 pm

Re: Zombie process monitor using NCPA

Post by IT-OPS-SYS »

Would it be possible for us to run the script as admin/root user instead of nagios user.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Zombie process monitor using NCPA

Post by vtrac »

Hi,
It is NOT recommended that you use "root" for this.

However, inside the "ncpa.cfg" file (on your NCPA remote agent) which defined user and group to run plugins.

Code: Select all

[listener]

#
# User and group to run plugins as (recommended to use nagios:nagios)
# Default: uid = nagios
# Default: gid = nagios
#
# ** Note - The daemon runs as root, but forks a child process when running a plugin
#    that is defined by the user, for security reasons. However, without the main daemon
#    running as root, much of the system information would be missing. This is typical behavior. **
#
# This is for Unix only (Linux, Mac OS X, etc)
#
uid = nagios
gid = nagios

What is the "log_file" path that your file is using?


Best Regards,
Vinh
IT-OPS-SYS
Posts: 184
Joined: Sun Jan 07, 2018 12:56 pm

Re: Zombie process monitor using NCPA

Post by IT-OPS-SYS »

i changed the permission but same issue. uploaded both the plugins for you to review.
log_file = /var/log
Permissions are :

ls -l kern.log
-rw-r----- 1 syslog adm 1185 May 13 22:29 kern.log
You do not have the required permissions to view the files attached to this post.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Zombie process monitor using NCPA

Post by vtrac »

Hi,
Hope you are having a good day!!

Please change permission for "log_file":

Code: Select all

sudo chmod 644 /var/log/kern.log
Now try again:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 10.0.60.35 -t 'cFvgpWMXjaZojGlk' -P 5693 -M 'plugins/nfs-error.py'
Best Regards,
Vinh
IT-OPS-SYS
Posts: 184
Joined: Sun Jan 07, 2018 12:56 pm

Re: Zombie process monitor using NCPA

Post by IT-OPS-SYS »

it worked. thanks for your assistance.

how about the script do you want me to make any changes to it .
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Zombie process monitor using NCPA

Post by vtrac »

Hi,
Hope you are having a good day!!

Your python script looks fine.

However, if your "log_file" is large, checking each line for a matching string might not be a good solution especially if your log_file does not rotate each night.

So keep an eye on that log_file, don't let it get too big ... :-)

May I close this thread?


Best Regards,
Vinh
IT-OPS-SYS
Posts: 184
Joined: Sun Jan 07, 2018 12:56 pm

Re: Zombie process monitor using NCPA

Post by IT-OPS-SYS »

sure. thanks and have a good one!!!
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Zombie process monitor using NCPA

Post by vtrac »

Great!! .... locking thread!! ... :-)
Locked