NRDP

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.
kboeckx
Posts: 2
Joined: Fri Mar 23, 2012 3:14 pm

NRDP

Post by kboeckx »

Hi,

I want to move from NSCA to NRDP. I found the NRDP_overview document http://assets.nagios.com/downloads/nagi ... erview.pdf but this is oviously not enough explenation to get it working.

Does anyone have a working NRDP configuration and is there a way to debug NRDP so I can learn what' going wrong ?

Thanks !
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: NRDP

Post by mguthrie »

NRPD is PHP based, and runs from the public web server. Can you post some more information as to what you've done so far and where it appears to be failing?
kboeckx
Posts: 2
Joined: Fri Mar 23, 2012 3:14 pm

Re: NRDP

Post by kboeckx »

I followed the installation procedure that I found in http://assets.nagios.com/downloads/nagi ... erview.pdf (except that I use "cp nrdp.conf /etc/apache2/conf.d" as the place for the webconfig)

Code: Select all

Download and unpack the NRDP package in the /tmp directory:
  cd /tmp
  wget http://assets.nagios.com/downloads/nrdp/nrdp.zip
  unzip nrdp.zip

Create an installation directory for NRDP:
  mkdir /usr/local/nrdp

Copy the NRDP files to the installation directory:
  cd nrdp
  cp -r * /usr/local/nrdp

Set permissions on NRDP directory/files:
  chown -R nagios.nagios /usr/local/nrdp

Edit the NRDP server config file:
  nano -w /usr/local/nrdp/server/config.inc.php

And add at least one token string to the $cfg['authorized_tokens'] variable. Example:
  $cfg['authorized_tokens'] = array(
  "asd7fjk3l34",
  "df23m7jadI34",
  );

Copy the Apache configuration file for NRDP. Optionally edit the /etc/httpd/conf.d/nrdp.conf file to configure settings as you need to
restrict access by address or enable SSL or basic authentication.
  cp nrdp.conf /etc/apache2/conf.d

Restart Apache
  /etc/init.d/httpd restart

The NRDP server has now been installed!
Then I opened the URL http://<ipaddress>/nrdp

I'm getting the screen like the attachement.
I'm able to use the first part of this interface (submit nagios command).
I'm not able to use the second part of the interface (with altered data that exists in the nagios config of course)

The next step is using the php client. I'm able to run this client with all the proper parameters but nagios is not getting anything ...

If I was able to debug the NRDP process, I would get some more details where it's going wrong. Is this possible ?

Thanks,
Kris
Attachments
Nieuwe afbeelding.jpg
Nieuwe afbeelding.jpg (51.07 KiB) Viewed 4923 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRDP

Post by scottwilkerson »

When you submit data with the "Submit Check Data" what is returned?

Do you already have the cfg for the host/service you are submitting?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
wormfishin
Posts: 31
Joined: Tue Apr 10, 2012 8:11 am

Re: NRDP

Post by wormfishin »

I'm actually seeing the exact same behavior. I followed the document to the letter, and I'm testing with a brand new server and install of nagios core.

The "Submit Nagios Command" works perfectly, but the "Submit Check Data" it never seems to hit nagios.
The output on the webpage is:
<result>
<status>0</status>
<message>OK</message>

<meta>
<output>2 checks processed.</output>
</meta>
</result>

But monitoring the nagios log file and the nagios.debug file with it set to debug external commands nothing displays.

I do have the configurations for the host/services already defined.
wormfishin
Posts: 31
Joined: Tue Apr 10, 2012 8:11 am

Re: NRDP

Post by wormfishin »

Anyone have any suggestions, after lots of searching I find many people reporting the same problem but unfortunately no solutions.

Would I be better to use NSCA?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: NRDP

Post by mguthrie »

Got anything showing up in the apache log when these commands get submitted? I'm wondering if there's a PHP error somewhere.
wormfishin
Posts: 31
Joined: Tue Apr 10, 2012 8:11 am

Re: NRDP

Post by wormfishin »

Here are my access and html logs. I hadn't noticed the timezone error before, it doesn't occur when I use the "Submit Nagios Command" section:

==> error_log <==
[Tue Apr 17 12:48:05 2012] [error] [client x.x.x.x] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php on line 105, referer: http://y.y.y.y/nrdp/
[Tue Apr 17 12:48:05 2012] [error] [client x.x.x.x] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php on line 105, referer: http://y.y.y.y/nrdp/

==> access_log <==
x.x.x.x - - [17/Apr/2012:12:48:05 -0400] "POST /nrdp/ HTTP/1.1" 200 170 "http://y.y.y.y/nrdp/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 ( .NET CLR 3.5.30729; .NET4.0C)"

I replaced my IP's with x's and y's.
wormfishin
Posts: 31
Joined: Tue Apr 10, 2012 8:11 am

Re: NRDP

Post by wormfishin »

I updated my php.ini file and have resolved that error, now the logs aren't showing anything when I submit but it's still not working.

Should I increase the logging level of httpd?

***Update*** I increased the log level to dubug, and still did not see any errors.
wormfishin
Posts: 31
Joined: Tue Apr 10, 2012 8:11 am

Re: NRDP

Post by wormfishin »

Looking around some more I see it's creating files in my /tmp directory:


-rw-r--r--. 1 apache apache 0 Apr 16 08:26 cy8wSSw.ok
-rwxrwx---. 1 apache nagcmd 238 Mar 30 16:41 cYNHIQs
-rw-r--r--. 1 apache apache 0 Mar 30 16:41 cYNHIQs.ok
-rwxrwx---. 1 apache nagcmd 238 Apr 10 08:41 czGG3iA
-rw-r--r--. 1 apache apache 0 Apr 10 08:41 czGG3iA.ok
-rwxrwx---. 1 apache nagcmd 236 Apr 17 13:09 czUKjvG
-rw-r--r--. 1 apache apache 0 Apr 17 13:09 czUKjvG.ok


It looks like when nrpd is done it creates the *.ok file so the nagios core can pick it up and process it.

This is either not happening or happening too fast for me to catch it with the nagios command
Locked