NRDP server side ==> GET OK , POST not OK
NRDP server side ==> GET OK , POST not OK
I have Configure NRDP in Server side
Submit Nagios Command / http get request ==> OK
<result><status>0</status><message>OK</message></result>
[1360724821] EXTERNAL COMMAND: DISABLE_HOST_NOTIFICATIONS;somehost
Submit Check Data / http post request ==> NOT OK
<result><status>0</status><message>OK</message><meta><output>2 checks processed.</output></meta></result>
No response in nagios.log
Anybody can give me advice ?
Submit Nagios Command / http get request ==> OK
<result><status>0</status><message>OK</message></result>
[1360724821] EXTERNAL COMMAND: DISABLE_HOST_NOTIFICATIONS;somehost
Submit Check Data / http post request ==> NOT OK
<result><status>0</status><message>OK</message><meta><output>2 checks processed.</output></meta></result>
No response in nagios.log
Anybody can give me advice ?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRDP server side ==> GET OK , POST not OK
Check your check_result_path in your nagios.cfg
then look in /usr/local/nrdp/server/config.inc.php and verify $cfg["check_results_dir"] is set to the same path
then look in /usr/local/nrdp/server/config.inc.php and verify $cfg["check_results_dir"] is set to the same path
Re: NRDP server side ==> GET OK , POST not OK
the directory is same.
config.inc.php
$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
nagios.cfg
check_result_path=/usr/local/nagios/var/spool/checkresults
config.inc.php
$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
nagios.cfg
check_result_path=/usr/local/nagios/var/spool/checkresults
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: NRDP server side ==> GET OK , POST not OK
What version of NRDP are you currently running?
Re: NRDP server side ==> GET OK , POST not OK
more index.php
<?php
//
// Nagios Remote Data Processor (NRDP)
// Copyright (c) 2010 Nagios Enterprises, LLC.
//
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: index.php 12 2010-06-19 04:19:35Z egalstad $
more config.inc.php
<?php
// NRDP Config File
// Copyright (c) 2010 Nagios Enterprises, LLC.
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: config.inc.php 12 2010-06-19 04:19:35Z egalstad $
$cfg['product_name']='nrdp';
$cfg['product_version']='1.0'
more includes/utils.inc.php
<?php
//
// NRDP Utils
// Copyright (c) 2008-2010 Nagios Enterprises, LLC.
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: utils.inc.php 12 2010-06-19 04:19:35Z egalstad $
<?php
//
// Nagios Remote Data Processor (NRDP)
// Copyright (c) 2010 Nagios Enterprises, LLC.
//
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: index.php 12 2010-06-19 04:19:35Z egalstad $
more config.inc.php
<?php
// NRDP Config File
// Copyright (c) 2010 Nagios Enterprises, LLC.
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: config.inc.php 12 2010-06-19 04:19:35Z egalstad $
$cfg['product_name']='nrdp';
$cfg['product_version']='1.0'
more includes/utils.inc.php
<?php
//
// NRDP Utils
// Copyright (c) 2008-2010 Nagios Enterprises, LLC.
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: utils.inc.php 12 2010-06-19 04:19:35Z egalstad $
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRDP server side ==> GET OK , POST not OK
Are you sure you have a host/service setup in Nagios core already with the name you are submitting?
Re: NRDP server side ==> GET OK , POST not OK
sure ...
echo command :
echo "`date +[%s]` PROCESS_SERVICE_CHECK_RESULT;NMS1-10.147.252.11;03_Current_Users_Pnrdp;0;test" > /usr/local/nagios/var/rw/nagios.cmd
nagios.log
[1361327411] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;NMS1-10.147.252.11;03_Current_Users_Pnrdp;0;test
[1361327413] PASSIVE SERVICE CHECK: NMS1-10.147.252.11;03_Current_Users_Pnrdp;0;test
nrdp post :
<?xml version='1.0'?>
<checkresults>
<checkresult type='host'>
<hostname>NMS1-10.147.252.11</hostname>
<state>0</state>
<output>Everything looks okay!|perfdata</output>
</checkresult>
<checkresult type='service'>
<hostname>NMS1-10.147.252.11</hostname>
<servicename>03_Current_Users_Pnrdp</servicename>
<state>0</state>
<output>WARNING: Danger Will Robinson!|perfdata</output>
</checkresult>
</checkresults>
<result><status>0</status><message>OK</message><meta><output>2 checks processed.</output></meta></result>
access.log
xx.xxx.xxx.xx - - [20/Feb/2013:09:35:42 +0700] "POST /nrdp/ HTTP/1.1" 200 170 "http://192.168.31.168/nrdp/" "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0"
echo command :
echo "`date +[%s]` PROCESS_SERVICE_CHECK_RESULT;NMS1-10.147.252.11;03_Current_Users_Pnrdp;0;test" > /usr/local/nagios/var/rw/nagios.cmd
nagios.log
[1361327411] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;NMS1-10.147.252.11;03_Current_Users_Pnrdp;0;test
[1361327413] PASSIVE SERVICE CHECK: NMS1-10.147.252.11;03_Current_Users_Pnrdp;0;test
nrdp post :
<?xml version='1.0'?>
<checkresults>
<checkresult type='host'>
<hostname>NMS1-10.147.252.11</hostname>
<state>0</state>
<output>Everything looks okay!|perfdata</output>
</checkresult>
<checkresult type='service'>
<hostname>NMS1-10.147.252.11</hostname>
<servicename>03_Current_Users_Pnrdp</servicename>
<state>0</state>
<output>WARNING: Danger Will Robinson!|perfdata</output>
</checkresult>
</checkresults>
<result><status>0</status><message>OK</message><meta><output>2 checks processed.</output></meta></result>
access.log
xx.xxx.xxx.xx - - [20/Feb/2013:09:35:42 +0700] "POST /nrdp/ HTTP/1.1" 200 170 "http://192.168.31.168/nrdp/" "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0"
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRDP server side ==> GET OK , POST not OK
Let's check a couple other things
should look like this
Code: Select all
ls -ld /usr/local/nagios/var/spool/checkresults
cat /etc/group|grep nagCode: Select all
[root@localhost libexec]# ls -ld /usr/local/nagios/var/spool/checkresults
drwxrwxr-x 2 nagios nagios 73728 Feb 20 15:26 /usr/local/nagios/var/spool/checkresults
[root@localhost libexec]# cat /etc/group|grep nag
nagios:x:500:nagios,apache
nagcmd:x:501:nagios,apache
nagioscmd:x:502:nagios
Re: NRDP server side ==> GET OK , POST not OK
ls -ld /usr/local/nagios/var/spool/checkresults
drwxr-xr-x 2 nagios nagios 4096 Feb 21 11:23 /usr/local/nagios/var/spool/checkresults
cat /etc/group|grep nag
wheel
10:root,nagios
nagios
498:apache
nagcmd
501:nagios
drwxr-xr-x 2 nagios nagios 4096 Feb 21 11:23 /usr/local/nagios/var/spool/checkresults
cat /etc/group|grep nag
wheel
nagios
nagcmd
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NRDP server side ==> GET OK , POST not OK
This is the problem, permissions are wrong, in multiple waysmacling66 wrote:ls -ld /usr/local/nagios/var/spool/checkresults
drwxr-xr-x 2 nagios nagios 4096 Feb 21 11:23 /usr/local/nagios/var/spool/checkresults
cat /etc/group|grep nag
wheel10:root,nagios
nagios498:apache
nagcmd501:nagios
Code: Select all
chmod g+w /usr/local/nagios/var/spool/checkresults
useradd -G nagcmd apache