Page 1 of 3
Nagios Core 4.0 with NCPA and NRDP
Posted: Wed Oct 16, 2013 8:08 am
by skynardo
I have a new Nagios Core 4.0 installation with NRDP installed and configured. I have a remote host with NCPA installed and configured to point to my Nagios/nrdp with the appropriate token. I can query the NCPA api vai a browser to display various checks and the default ncpa checks are running successfully. If I am reading correctly, I should be able to define services for these checks on my Nagios machine so that these passive checks will be received and processed by Nagios. Is this a correct assumption or am I missing a step here? Also, I can't find an example of how to define a service for my NCPA checks and so far trial and error has not been good to me. Any suggestions greatly appreciated.
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Wed Oct 16, 2013 10:35 am
by slansing
You will need to deploy check_ncpa.py on your core server in the plugins directory:
http://exchange.nagios.org/directory/Pl ... pa/details
Then define a command as such:
Code: Select all
$USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
Where $ARG$ = -t '<nrpd token>' -P <port.you.configured.ncpa.with> -M <metric> -w 20 -c 40
Such as:
Code: Select all
-t 'abcdef123456' -P 5693 -M cpu/percent -w 20 -c 40
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Wed Oct 16, 2013 11:53 am
by skynardo
Thanks for that. Is this plugin for use with Active checks?
I am trying to get Passive checks to Nagios from NCPA via NRDP. I found that I had not configured a generic-passive-service template on my Nagios server. After doing this the services show up in Nagios but show "PENDING" and service not scheduled to be checked. When I check the ncpa log on the client however, I see that it is processing my 3 checks as shown below:
2013-10-16 11:39:10,084 23390 INFO HOSTNAME was not explicitly declared. Using devhost
2013-10-16 11:39:11,131 23390 INFO Starting new HTTP connection (1): nagios_core_nrdp_host
2013-10-16 11:39:11,167 23390 INFO Message from NRDP server: OK
2013-10-16 11:39:11,167 23390 INFO Meta output from NRDP server: 3 checks processed.
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Wed Oct 16, 2013 1:59 pm
by slansing
Do you have your NRDS information correctly defined in the NCPA.cfg file?
You need a valid nrdp address, token, and config name that matches what you created on the core server.
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Wed Oct 16, 2013 3:40 pm
by skynardo
I believe so, my service definitions for the 3 (default) ncpa passive checks are shown below.
I verified my token in the config.inc.php on the Nagios machine and in the ncpa.cfg on the client.
The three services are now showing up as Critical service is"stale"
Here is my generic-passive-service def
define service {
name generic-passive-service
use generic-service
register 0
check_command check_dummy!2!"service is stale"
active_checks_enabled 0
passive_checks_enabled 1
check_freshness 1
freshness_threshold 4000 ; If passive check has not checked in for an hour, send "service is stale" alert
}
define service{
use generic-passive-service
host_name devhost
service_description cpu usage
}
define service{
use generic-passive-service
host_name devhost
service_description swap usage
}
define service{
use generic-passive-service
host_name devhost
service_description memory usage
}
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Thu Oct 17, 2013 9:36 am
by skynardo
I found a bunch of these files in my /tmp directory on my Nagios Server. It looks like the alerts are getting to Nagios but it is not processing them for some reason. I'm guessing I have something configured wrong in my server config yet.
[root@nagiosServer tmp]# cat cmBRg6w
### NRDP Check ###
start_time=1382019953.0
# Time: Thu, 17 Oct 2013 09:25:53 -0500
host_name=
devhost
check_type=1
early_timeout=1
exited_ok=1
return_code=1
output=
WARNING: Percent was 11.8%|'percent_0'=11.8%;9;80
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Thu Oct 17, 2013 2:06 pm
by sreinhardt
Your configs look pretty good, unless I missed something.

What permissions do these temp files have?
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Fri Oct 18, 2013 6:10 am
by skynardo
They are owned by apache and have an accompanying ok file
-rw-r--r-- 1 apache apache 0 Oct 18 06:05 cdvoyDP.ok
-rwxrwx--- 1 apache apache 230 Oct 18 06:05 cdvoyDP
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Fri Oct 18, 2013 10:48 am
by slansing
It doesn't look like you have a host name defined in your NRDP checks that are coming in, can you share your remote system's NRDP configuration?
Re: Nagios Core 4.0 with NCPA and NRDP
Posted: Fri Oct 18, 2013 11:31 am
by skynardo
excerpt from ncpa.cfg
[passive]
uid = nagios
handlers = nrdp
loglevel = info
gid = nagcmd
sleep = 300
logfile = var/ncpa_passive.log
pidfile = var/ncpa_passive.pid
[nrdp]
token = testtoken
hostname = devut514
parent =
http://nagiosserver.myco.com/nrdp/