Page 1 of 2

RedHat NCPA test install - UNKNOWN for all checks

Posted: Wed Apr 06, 2016 11:09 am
by dlukinski
Hello XI Support

We have installed NCPA agent on the test RedHat EL 6.6
All checks produced same error: UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.

Please advice how to troubleshoot from here?

Thank you

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Wed Apr 06, 2016 12:41 pm
by lmiltchev
What version of the NCPA agent did you install? Run the following commands on the RHEL machine, and show the output in code wraps:

Code: Select all

ps -ef | grep ncpa
tail -100 /usr/local/ncpa/var/ncpa_listener.log
Show us one of the "failing" checks run from the command line on the Nagios XI server along with the output of it.

Example:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <client ip> -t 'mytoken' -P 5693 -M memory/virtual/percent -w 80 -c 90

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Wed Apr 06, 2016 3:18 pm
by dlukinski
lmiltchev wrote:What version of the NCPA agent did you install? Run the following commands on the RHEL machine, and show the output in code wraps:

Code: Select all

ps -ef | grep ncpa
tail -100 /usr/local/ncpa/var/ncpa_listener.log
Show us one of the "failing" checks run from the command line on the Nagios XI server along with the output of it.

Example:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <client ip> -t 'mytoken' -P 5693 -M memory/virtual/percent -w 80 -c 90
------------------------
[lukindi@fihp-rheltst01 tmp]$ sudo ps -ef | grep ncpa
root 6906 1 0 18:36 ? 00:00:03 /usr/local/ncpa/ncpa_posix_passive --start
root 8395 1 0 18:40 ? 00:00:00 ./ncpa_posix_listener --start
lukindi 44221 65157 0 23:19 pts/0 00:00:00 grep ncpa
[lukindi@fihp-rheltst01 tmp]$ tail -100 /usr/local/ncpa/var/ncpa_listener.log
2016-04-06 18:36:25,480 6896 INFO started
2016-04-06 18:36:25,481 6896 INFO Using SSL version TLSv1
2016-04-06 18:40:44,442 6896 INFO stopped
2016-04-06 18:40:44,952 8395 INFO started
2016-04-06 18:40:44,953 8395 INFO Using SSL version TLSv1
2016-04-06 18:41:31,852 8395 INFO 10.96.30.40 - - [2016-04-06 18:41:31] "GET /testconnect?token=ncpa_test HTTP/1.0" 301 583 0.119507
2016-04-06 18:41:31,913 8395 INFO 10.96.30.40 - - [2016-04-06 18:41:31] "GET /testconnect/?token=ncpa_test HTTP/1.0" 200 152 0.000984
2016-04-06 18:41:31,978 8395 INFO 10.96.30.40 - - [2016-04-06 18:41:31] "GET /api/interface?token=ncpa_test HTTP/1.0" 200 1364 0.004404
2016-04-06 18:41:32,078 8395 INFO 10.96.30.40 - - [2016-04-06 18:41:32] "GET /api/disk?token=ncpa_test HTTP/1.0" 200 9041 0.041624
2016-04-06 18:41:33,583 8395 INFO 10.96.30.40 - - [2016-04-06 18:41:33] "GET /api/service?token=ncpa_test HTTP/1.0" 200 3907 1.445199
2016-04-06 23:15:19,625 8395 INFO 10.96.30.40 - - [2016-04-06 23:15:19] "GET /api/memory/virtual/percent/?token=ncpa_test&warning=80&critical=90&check=1 HTTP/1.0" 200 317 0.002968
[lukindi@fihp-rheltst01 tmp]$
---------------------------------



Works from XI CLI:
[root@fikc-nagxidev01 ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.102.36.62 -t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 80 -c 90
OK: percent was 35% | 'percent_0'=35%;80;90;
[root@fikc-nagxidev01 ~]#

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Wed Apr 06, 2016 3:25 pm
by lmiltchev
In this case, the issue may be in the wizard. What is the version of the "NCPA Agent" wizard that you are currently using?

Admin->Manage Config Wizards

Can you show us the "memory usage" service configuration?

CCM->Services->memory usage->View Text Config

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Wed Apr 06, 2016 3:37 pm
by dlukinski
lmiltchev wrote:In this case, the issue may be in the wizard. What is the version of the "NCPA Agent" wizard that you are currently using?

Admin->Manage Config Wizards

Can you show us the "memory usage" service configuration?

CCM->Services->memory usage->View Text Config
Monitor an NCPA Agent
Version: 1.3.5

$USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$

-t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 50 -c 80

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Wed Apr 06, 2016 3:54 pm
by lmiltchev
$USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$

-t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 50 -c 80
Can you show us the actual config file? I expected to see something like this:

Code: Select all

define service {
	host_name				x.x.x.x
	service_description		Main Memory Usage
	use						xiwizard_ncpa_service
	check_command			check_xi_ncpa_agent!-t 'mytoken' -P 5693 -M memory/virtual/percent -w 50 -c 80
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval	60
	notification_period		xi_timeperiod_24x7
	contacts				nagiosadmin
	_xiwizard				ncpa
	register				1
	}
Also, show us the screenshot of the "Service Status" page with the failing ("Unknown") services.

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Thu Apr 07, 2016 12:54 pm
by dlukinski
lmiltchev wrote:
$USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$

-t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 50 -c 80
Can you show us the actual config file? I expected to see something like this:

Code: Select all

define service {
	host_name				x.x.x.x
	service_description		Main Memory Usage
	use						xiwizard_ncpa_service
	check_command			check_xi_ncpa_agent!-t 'mytoken' -P 5693 -M memory/virtual/percent -w 50 -c 80
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval	60
	notification_period		xi_timeperiod_24x7
	contacts				nagiosadmin
	_xiwizard				ncpa
	register				1
	}
Also, show us the screenshot of the "Service Status" page with the failing ("Unknown") services.
--------------------------------------------------------------------------------------------------------------------------
define service {
<------>host_name<-----><------><------>fihp-rheltst01.konecranes.com
<------>service_description<---><------>Main Memory Usage
<------>use<---><------><------><------>xiwizard_ncpa_service
<------>check_command<-><------><------>check_xi_ncpa_agent!-t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 5
<------>max_check_attempts<----><------>5
<------>check_interval<><------><------>10
<------>retry_interval<><------><------>2
<------>check_period<--><------><------>xi_timeperiod_24x7
<------>notification_interval<-><------>60
<------>first_notification_delay<------>10
<------>notification_period<---><------>xi_timeperiod_24x7
<------>notifications_enabled<-><------>0
<------>_xiwizard<-----><------><------>ncpa
<------>register<------><------><------>1
<------>}<----->

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Thu Apr 07, 2016 3:08 pm
by lmiltchev
We saw that your check works from the command line when using an IP address:
Works from XI CLI:
[root@fikc-nagxidev01 ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.102.36.62 -t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 80 -c 90
OK: percent was 35% | 'percent_0'=35%;80;90;
Does it work with a hostname? What is the output of the following commands?

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H fihp-rheltst01.konecranes.com -t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 80 -c 90
nslookup fihp-rheltst01.konecranes.com

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Thu Apr 07, 2016 3:30 pm
by dlukinski
lmiltchev wrote:We saw that your check works from the command line when using an IP address:
Works from XI CLI:
[root@fikc-nagxidev01 ~]# /usr/local/nagios/libexec/check_ncpa.py -H 10.102.36.62 -t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 80 -c 90
OK: percent was 35% | 'percent_0'=35%;80;90;
Does it work with a hostname? What is the output of the following commands?

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H fihp-rheltst01.konecranes.com -t 'ncpa_test' -P 5693 -M memory/virtual/percent -w 80 -c 90
nslookup fihp-rheltst01.konecranes.com

This worked too ("localhost" somehow appeared under host address after using NCPA agent Wizard. Unsure if this specific to us.
- sorry did not check (did not think about something that simple)

Re: RedHat NCPA test install - UNKNOWN for all checks

Posted: Thu Apr 07, 2016 3:47 pm
by rkennedy
Got it - guessing this is similar to the last one you mentioned with the wizard.

Are we good to mark this thread as resolved?