check_ncpa.py plugin issue

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
nickanderson1982
Posts: 72
Joined: Wed Feb 06, 2019 3:22 pm

check_ncpa.py plugin issue

Post by nickanderson1982 »

I finally setup my nagios and I was starting to edit cfg files with new hosts.
I'm having an issue where it seems like check_ncpa.py plugin isn't working because everything polling is not communicating and listed as critical.
When I do my pre flight check everything is ok with no errors. I'm not sure why this is not working. Now I only did ncpa and not nrdp
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ncpa.py plugin issue

Post by scottwilkerson »

Can you show the commands you have configured for check_ncpa and the service cnfigurations?

Additionally, can you should the results of the commands being run from the command line?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
nickanderson1982
Posts: 72
Joined: Wed Feb 06, 2019 3:22 pm

Re: check_ncpa.py plugin issue

Post by nickanderson1982 »

command.cfg
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$


Sample of one of my host.cfg files:
define host {
host_name host
address xxx.xxx.xxx.xxx
check_command check_ncpa!-t 'token' -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts nagiosadmin
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
}

define service {
host_name host
service_description CPU Usage
check_command check_ncpa!-t 'token' -P 5693 -M cpu/percent -w 50 -c 80 -q 'aggregate=avg'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

define service {
host_name host
service_description Memory Usage
check_command check_ncpa!-t 'token' -P 5693 -M memory/virtual -w 50 -c 80 -u G
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

define service {
host_name host
service_description Process Count
check_command check_ncpa!-t 'token' -P 5693 -M processes -w 150 -c 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

define service {
host_name host
service_description Disk Usage
check_command check_ncpa!-t 'token' -P 5693 -M 'disk/logical/C:|/used_percent' -w 80 -c 90
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

I'm not sure if this is what you mean:
[root@name objects]# check_ncpa!-t token -P 5693 -M 'disk/logical/C:|/used_percent' -w 80
check_ncpatar xvf check_ncpa.tar.gz token -P 5693 -M 'disk/logical/C:|/used_percent' -w 80
bash: check_ncpatar: command not found

I'm seeing this in the status information on the gui monitor:
Usage: check_ncpa.py [options] and everything is listed on as critical
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ncpa.py plugin issue

Post by scottwilkerson »

What I meant was what if you run this, what do you get? (replacing xxx.xxx.xxx.xxx and token)

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H xxx.xxx.xxx.xxx -t 'token' -P 5693 -M 'disk/logical/C:|/used_percent' -w 80 -c 90
Also, if token contains special chars, specifically ! this could be a problem in the GUI
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
nickanderson1982
Posts: 72
Joined: Wed Feb 06, 2019 3:22 pm

Re: check_ncpa.py plugin issue

Post by nickanderson1982 »

You were correct on the ! character in the token. I can't believe that was the issue. Thank you for pointing that out everything is working as intended now. I appreciate the assistance.
Locked