check_ncpa Not Defined Anywhere - Help Please?

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_ncpa Not Defined Anywhere - Help Please?

Postby darenmatthews » Tue Jul 10, 2018 10:18 am

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

Re: check_ncpa Not Defined Anywhere - Help Please?

Postby scottwilkerson » Tue Jul 10, 2018 3:23 pm

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 11583
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_ncpa Not Defined Anywhere - Help Please?

Postby darenmatthews » Wed Jul 11, 2018 3:20 am

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?

Postby darenmatthews » Wed Jul 11, 2018 6:48 am

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

Re: check_ncpa Not Defined Anywhere - Help Please?

Postby scottwilkerson » Wed Jul 11, 2018 8:20 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 11583
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: jccastro, nkal and 33 guests