NRDP Config Problem

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.
tacchino
Posts: 18
Joined: Mon Mar 16, 2015 12:29 pm

NRDP Config Problem

Post by tacchino »

I'm having trouble getting NRDP properly set up and passing checks through on a Nagios Core install. I have the app installed and can successfully access /nrdp/. From there I can successfully submit a command as well as check data. However, I never see the result of the check data showing up in my host status. Remote submissions of check data likewise receives a success response but don't see the result of the check on the host. I was able to get the remote client working with NagiosXI so I don't believe there is any problem on that end. Various config details below, anyone see a problem? Hints on how to further debug?

One strange thing to note is that I continue to get objects written to /tmp/ by the apache process despite having change config to point to /usr/local/nagios/var/tmp/

Nagios Core 4.0.2
nagios user = nagios
uid=1111(nagios) gid=1111(nagios) groups=1111(nagios)

apache user = apache
uid=2222(apache) gid=1111(nagios) groups=1111(nagios)

nagios.cfg
temp_file=/usr/local/nagios/var/nagios.tmp
temp_path=/usr/local/nagios/var/tmp
accept_passive_service_checks=1

drwxrwxr-x 2 nagios nagios 4096 Mar 16 13:24 /usr/local/nagios/var/tmp
prwxrwxrwx 1 nagios nagios 0 Mar 16 12:55 /usr/local/nagios/var/rw/nagios.cmd
drwxrwxr-x 2 nagios nagios 4096 Mar 16 14:33 /usr/local/nagios/var/spool/checkresults

/usr/local/nrdp/server/config.inc.php

Code: Select all

<?php

$cfg['authorized_tokens'] = array(
        "xxxxxxxx",
        );

$cfg["require_https"]=false;

$cfg["require_basic_auth"]=false;

$cfg["valid_basic_auth_users"]=array();

$cfg["nagios_command_group"]="nagios";

$cfg["command_file"]="/usr/local/nagios/var/rw/nagios.cmd";

$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";

$cfg["tmp_dir"]="/usr/local/nagios/var/tmp";

$cfg['product_name']='nrdp';
$cfg['product_version']='1.0'
?>
/etc/httpd/conf.d/nrpd.conf

Code: Select all

<Directory "/usr/local/nrdp">
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

Alias /nrdp "/usr/local/nrdp/server"
Host Config

Code: Select all

define host {
       name                                     generic_host
       check_command                            check-host-alive
       max_check_attempts                       5
       check_interval                           5
       retry_interval                           1
       check_period                             24x7
       event_handler_enabled                    1
       flap_detection_enabled                   1
       process_perf_data                        1
       retain_status_information                1
       retain_nonstatus_information             1
       notification_interval                    60
       notification_period                      24x7
       notifications_enabled                    1
       register                                 0

}

define host {
       name                                     passive_host
       check_command                            check_dummy!0!"No data received yet."
       use                                      generic_host
       max_check_attempts                       1
       active_checks_enabled                    0
       passive_checks_enabled                   1
       register                                 0

}

define host {
        host_name nrdp-core-centos-65
        use                             passive_host
        address                         nrdp-core-centos-65
        initial_state                   u
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        active_checks_enabled           0
        passive_checks_enabled          1
        notification_interval           60
        stalking_options                n
        register                        1
        }
Service Config

Code: Select all

define service {
       name                                     generic_service
       check_command                            check_dummy!0!"No data received yet."
       is_volatile                              0
       max_check_attempts                       5
       check_interval                           5
       retry_interval                           1
       active_checks_enabled                    1
       passive_checks_enabled                   1
       check_period                             24x7
       parallelize_check                        1
       obsess_over_service                      1
       check_freshness                          0
       event_handler_enabled                    1
       flap_detection_enabled                   1
       process_perf_data                        1
       retain_status_information                1
       retain_nonstatus_information             1
       notification_interval                    60
       notification_period                      24x7
       notifications_enabled                    1
       register                                 0

}

define service {
       name                                     passive_service
       service_description                      Passive Service
       use                                      generic_service
       check_command                            check_dummy!0!"No data received yet."
       is_volatile                              0
       initial_state                            o
       max_check_attempts                       1
       active_checks_enabled                    0
       passive_checks_enabled                   1
       flap_detection_enabled                   0
       stalking_options                         o,w,u,c
       register                                 0

}

define service {
        host_name                       nrdp-core-centos-65
        service_description             chef-client
        use                             passive_service
        max_check_attempts              1
        check_interval                  1
        retry_interval                  1
        check_period                    24x7
        notification_interval           60
        notification_period             24x7
        stalking_options                n
        register                        1
        }
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRDP Config Problem

Post by ssax »

Go into http://YOURSERVER/nrdp/ and under the Submit Check Data section type in your token, paste in the following code and click the Submit Check Data button.

Code: Select all

<?xml version='1.0'?> 
<checkresults>
	<checkresult type='host'>
		<hostname>nrdp-core-centos-65</hostname>
		<state>0</state>
		<output>Everything looks okay!|perfdata</output>
	</checkresult>
	<checkresult type='service'>
		<hostname>nrdp-core-centos-65</hostname>
		<servicename>chef-client</servicename>
		<state>1</state>
		<output>WARNING: Danger Will Robinson!|perfdata</output>
	</checkresult>
</checkresults>
Post the results from the next page.

Then go into your Nagios Core web interface. Click on Hosts, does it say "Everything looks okay!" in the status information next to that host? Click on Services, Does it say "WARNING: Danger Will Robinson!" next to the chef-client service?
tacchino
Posts: 18
Joined: Mon Mar 16, 2015 12:29 pm

Re: NRDP Config Problem

Post by tacchino »

Response:

Code: Select all

<result>
<status>0</status>
<message>OK</message>
<meta>
<output>2 checks processed.</output>
</meta>
</result>
Host State Information
This host has not yet been checked, so status information is not available.

Service State Information
Current Status: OK (for 0d 1h 30m 59s)
Status Information: Manual
Performance Data:
Current Attempt: 1/1 (HARD state)
Last Check Time: 03-16-2015 14:52:35
Check Type: PASSIVE
Check Latency / Duration: N/A / 0.000 seconds
Next Scheduled Check: N/A
Last State Change: 03-16-2015 14:52:35
Last Notification: N/A (notification 0)
Is This Service Flapping? N/A
In Scheduled Downtime? NO
Last Update: 03-16-2015 16:23:29 ( 0d 0h 0m 5s ago

The status information of "Manual" represents the a passive check that I submitted manually through "Submit passive check result for this service" in the web console.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRDP Config Problem

Post by ssax »

Please PM me the last 100 or so lines from your /usr/local/nagios/var/nagios.log
tacchino
Posts: 18
Joined: Mon Mar 16, 2015 12:29 pm

Re: NRDP Config Problem

Post by tacchino »

Nothing gets logged on submit of the checkresults. I did verify that log_passive_checks = 1
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRDP Config Problem

Post by ssax »

Can you also validate that your nagios.cfg has these set:

Code: Select all

accept_passive_service_checks=1
accept_passive_host_checks=1
Can you still send the last 100 or so lines of your nagios.log?

Post the output of the following command:

Code: Select all

iptables -L
And also:

Code: Select all

sestatus
tacchino
Posts: 18
Joined: Mon Mar 16, 2015 12:29 pm

Re: NRDP Config Problem

Post by tacchino »

Sure, sent.

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


SELinux status: disabled
tacchino
Posts: 18
Joined: Mon Mar 16, 2015 12:29 pm

Re: NRDP Config Problem

Post by tacchino »

Any thoughts on why on the submit of check results files end up being written to /tmp instead of /usr/local/nagios/var/tmp/? Config file says directly that /tmp/ won't work and even though I've removed all references I continue to get files written there for each check result submitted.

Code: Select all

-rw-r--r--  1 apache    apache      0 Mar 17 07:29 cqzBhjD.ok
-rwxrwx---  1 apache    apache    249 Mar 17 07:29 cqzBhjD
-rw-r--r--  1 apache    apache      0 Mar 17 07:29 cCQ6EQi.ok
-rwxrwx---  1 apache    apache    209 Mar 17 07:29 cCQ6EQi
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRDP Config Problem

Post by ssax »

There wasn't any file attached to the PM you sent, is it empty?

Please run the commands below:

Code: Select all

chown -R nagios.nagios /usr/local/nrdp
service nagios restart
service httpd restart
Then try it again and see if it's still outputting to /tmp and if it's showing in the web interface.

Also, post the output of the following:

Code: Select all

ls -l /usr/local/nagios
ls -l /usr/local/nagios/var
ls -l /usr/local/nagios/var/rw
Edit: Added the httpd restart
Edit 2: PM of logfile receive and placed in shared directory
tacchino
Posts: 18
Joined: Mon Mar 16, 2015 12:29 pm

Re: NRDP Config Problem

Post by tacchino »

Done and it still goes to /tmp and does not show in the web console.

Code: Select all

grep -r tmp /usr/local/nagios/etc/*
/usr/local/nagios/etc/nagios.cfg:temp_file=/usr/local/nagios/var/nagios.tmp
/usr/local/nagios/etc/nagios.cfg:#temp_path=/tmp
/usr/local/nagios/etc/nagios.cfg:temp_path=/usr/local/nagios/var/tmp
/usr/local/nagios/

Code: Select all

drwxrwxr-x  2 nagios nagios 4096 Jan 28 17:48 bin
drwxrwxr-x  3 nagios nagios 4096 Mar 17 09:51 etc
drwxr-xr-x  2 root   root   4096 Nov 25  2013 include
drwxrwxr-x  4 nagios nagios 4096 Feb 26 10:54 libexec
drwxrwxr-x  2 nagios nagios 4096 Oct 22 12:16 sbin
drwxrwxr-x 11 nagios nagios 4096 Oct 22 13:24 share
drwxrwxr-x  7 nagios nagios 4096 Mar 17 11:24 var
/usr/local/nagios/var/

Code: Select all

drwxrwxr-x   2 nagios nagios   24576 Mar 17 00:00 archives
-rw-r--r--   1 nagios nagios       0 Oct 17 12:06 livestatus.log
-rwxr-xr-x   1 nagios root         0 Dec 26  2013 nagiosgraph-cgi.log
-rw-r--r--   1 nagios nagios       0 Nov 13 23:28 nagiosgraph.log
-rw-r--r--   1 nagios nagios       6 Mar 16 13:01 nagios.lock
-rw-r--r--   1 nagios nagios       5 Jan 10  2014 nagios.lock.old
-rw-r--r--   1 nagios nagios 2029947 Mar 17 11:26 nagios.log
-rw-r--r--   1 nagios nagios 3557884 Mar 16 13:24 objects.cache
-rw-r--r--   1 nagios nagios 3557884 Mar 17 11:23 objects.precache
-rw-r--r--   1 nagios nagios       0 Mar 17 11:26 perfdata.log
-rw-------   1 nagios nagios 5369295 Mar 17 11:24 retention.dat
drwxr-xr-x 147 nagios nagios   12288 Jul 16  2014 rrd
drwxrwsr-x   2 nagios nagios    4096 Mar 16 13:24 rw
drwxrwxr-x   3 nagios nagios    4096 Nov 25  2013 spool
-rw-rw-r--   1 nagios nagios 5332744 Mar 17 11:26 status.dat
drwxrwxr-x   2 nagios nagios    4096 Mar 17 11:23 tmp
/usr/local/nagios/var/rw/

Code: Select all

prwxrwxrwx 1 nagios nagios 0 Mar 16 14:52 nagios.cmd
srw-rw---- 1 nagios nagios 0 Mar 16 13:24 nagios.qh
Locked