check_ncpa Not Defined Anywhere - Help Please?

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
darenmatthews
Posts: 3
Joined: Mon Jun 08, 2015 4:38 am

check_ncpa Not Defined Anywhere - Help Please?

Post by darenmatthews »

My problem is that my configuration verification fails with error "Error: Service check command 'check_ncpa ... is not defined anywhere!"

Please can someone help me to troubleshoot this?

- I installed ncpa agent on a Windows machine successfully (I can login to the agent using https://[ip address]:5693/gui/).
- I created an ncpa.cfg file and placed it into /usr/local/nagios/etc/objects:
[root@linux objects]# pwd
/usr/local/nagios/etc/objects

[root@linux objects]# grep check_ncpa ncpa.cfg
check_command check_ncpa!-t '' -P 5693 -M system/agent_version
check_command check_ncpa!-t '' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
check_command check_ncpa!-t '' -P 5693 -M memory/virtual -w 50 -c 80 -u G
check_command check_ncpa!-t '' -P 5693 -M processes -w 150 -c 200
- I updated the commands.cfg file with this:
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
But when I run the verification I receive the following:
Running pre-flight check on configuration data...
Checking objects...
Error: Service check command 'check_ncpa!-t '' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'' specified in service 'CPU Usage' for host 'LONTEST350' not defined anywhere!
Error: Service check command 'check_ncpa!-t '' -P 5693 -M memory/virtual -w 50 -c 80 -u G' specified in service 'Memory Usage' for host 'LONTEST350' not defined anywhere!
Error: Service check command 'check_ncpa!-t '' -P 5693 -M processes -w 150 -c 200' specified in service 'Process Count' for host 'LONTEST350' not defined anywhere!
Error: Host check command 'check_ncpa!-t '' -P 5693 -M system/agent_version' specified for host 'LONTEST350' is not defined anywhere!
Thanks in advance of any help.
- Daren
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ncpa Not Defined Anywhere - Help Please?

Post by scottwilkerson »

Are you sure you don't have multiple commands.cfg files? what is the path to the commands.cfg file in your nagios.cfg

Is this the same locations of the file you edited?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
darenmatthews
Posts: 3
Joined: Mon Jun 08, 2015 4:38 am

Re: check_ncpa Not Defined Anywhere - Help Please?

Post by darenmatthews »

Hi Scott,

Thanks for replying, much appreciated. Here is the path to commands.cfg in nagios.cfg:
[root@linux etc]# grep commands.cfg nagios.cfg
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
I have one commands.cfg (plus the sample which isn't referenced in nagios.cfg):
[root@linux etc]# find / -name commands.cfg
/tmp/nagios-4.1.1/sample-config/template-object/commands.cfg
/usr/local/nagios/etc/objects/commands.cfg
The verification failure started just after I had uploaded ncpa.cfg (I also added the path to this in nagios.cfg):
[root@linux etc]# grep ncpa.cfg nagios.cfg
cfg_file=/usr/local/nagios/etc/objects/ncpa.cfg
The only place where check_ncpa is defined is in ncpa.cfg:
[root@linux]# grep 'check_ncpa' *.*
ncpa.cfg: check_command check_ncpa!-t '' -P 5693 -M system/agent_version
ncpa.cfg: check_command check_ncpa!-t '' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
ncpa.cfg: check_command check_ncpa!-t '' -P 5693 -M memory/virtual -w 50 -c 80 -u G
ncpa.cfg: check_command check_ncpa!-t '' -P 5693 -M processes -w 150 -c 200
I'm baffled really
darenmatthews
Posts: 3
Joined: Mon Jun 08, 2015 4:38 am

Re: check_ncpa Not Defined Anywhere - Help Please?

Post by darenmatthews »

OK problem solved. It was a simple error / oversight. I did not have this in my commands.cfg file:
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
Many thanks for the reponse
- Daren
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_ncpa Not Defined Anywhere - Help Please?

Post by scottwilkerson »

darenmatthews wrote:OK problem solved. It was a simple error / oversight. I did not have this in my commands.cfg file:
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
Many thanks for the reponse
- Daren
Excellent Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked