Page 1 of 2

Issue with NRDP check

Posted: Wed Oct 09, 2019 7:19 am
by bsivavani
Hi,

We are using nrdp version 0.3 and trying to do send alert from remote server using nrdp, but getting below error

[root@XXXX Syslog_duplication]# bash /usr/local/nagios/scripts/Syslog_duplication/send_nrdp.sh -u http://XXXX/nrdp/ -t 0pujUkihCQvd -H XXXX -s 'LIN_Server_Syslog_Monitoring' -S 2 -o "ok"
ERROR: could not connect to NRDP server at http://XXXX/nrdp/
[root@XXXX Syslog_duplication]#

From browser also I am unable to connect, please find the screenshot.

Kindly advice ?

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 10:56 am
by scottwilkerson
This error makes it look like there isn't a webserver running on XXXX or it is not accessible from your browser OR the server you are trying to send from

from the server you are trying to send from can you run the following replacing XXXX with the host you have in the URL and report the output

Code: Select all

ping XXXX
curl -vvv "http://XXXX/nrdp/"

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 12:12 pm
by bsivavani
Ping is working.

Please find curl command

[root@remoteserver file_log]# curl -vvv "http://nagiosserver/nrdp/"
* About to connect() to nagiosserver port 80 (#0)
* Trying 10.90.3.132...
* Connected to nagiosserver (nagiosserverip) port 80 (#0)
> GET /nrdp/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: nagiosserver
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 500 Internal Server Error
< Date: Wed, 09 Oct 2019 17:08:05 GMT
< Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
< X-Powered-By: PHP/5.4.16
< Content-Length: 0
< Connection: close
< Content-Type: text/html; charset=UTF-8
<
* Closing connection 0
[root@nagiosserver file_log]#

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 12:25 pm
by scottwilkerson
Something is causing an error on nagiosserver

Can you log into nagiosserver and run the following

Code: Select all

grep nrdp /var/log/httpd/error_log 
or

Code: Select all

grep nrdp /var/log/apache2/error.log
what OS and version is this Nagios XI server?

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 1:01 pm
by bsivavani
I am using Nagios XI 5.6.7 with CentOS 7.

Whenever I am running command from remote server, getting the below error in log

[root@XXXX ~]# grep nrdp /var/log/httpd/error_log
[Wed Oct 09 17:50:02.330340 2019] [:error] [pid 4509] [client remoteserver:65158] PHP Parse error: syntax error, unexpected 'pujUkihCQvd' (T_STRING), expecting ')' in /drbd/nrdp/server/config.inc.php on line 11
[Wed Oct 09 17:52:14.370884 2019] [:error] [pid 30931] [client remoteserver:65160] PHP Parse error: syntax error, unexpected 'pujUkihCQvd' (T_STRING), expecting ')' in /drbd/nrdp/server/config.inc.php on line 11
[root@XXXX ~]#

Command using
[root@nagiosserver Syslog_duplication]# bash /usr/local/nagios/scripts/Syslog_duplication/send_nrdp.sh -u http://nagiosserver/nrdp/ -t 0pujUkihCQvd -H remoteserver -s 'LIN_Server_Syslog_Monitoring' -S 2 -o "ok"
ERROR: could not connect to NRDP server at http://nagiosserver/nrdp/
[root@nagiosserver Syslog_duplication]#

I have observed that the token which I am using in command (taken from Inbound Transfers) is different then which is logged in log file.

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 1:07 pm
by scottwilkerson
There is a PHP error, please show the following

Code: Select all

grep pujUkihCQvd /drbd/nrdp/server/config.inc.php

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 1:18 pm
by bsivavani
Please find output

[root@XXXX ~]# grep pujUkihCQvd /drbd/nrdp/server/config.inc.php
$cfg['authorized_tokens'] = array(0pujUkihCQvd);
[root@XXXX ~]#

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 1:29 pm
by scottwilkerson
Edit the file and change this

Code: Select all

$cfg['authorized_tokens'] = array(0pujUkihCQvd);
to this

Code: Select all

$cfg['authorized_tokens'] = array('0pujUkihCQvd');

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 1:50 pm
by bsivavani
Now I am getting the other error

[root@XXXX Syslog_duplication]# bash /usr/local/nagios/scripts/Syslog_duplication/send_nrdp.sh -u http://nagiosserver/nrdp/ -t 0pujUkihCQvd -H remoteserver -s 'LIN_Server_Syslog_Monitoring' -S 2 -o "ok"
ERROR: The NRDP Server said BAD CHECK RESULTS DIR
[root@XXXX Syslog_duplication]#

checkresults file permissions
[root@nagioserver nagios]# ls -ld /usr/local/nagios/var/spool/checkresults
drwsrwsr-x. 2 nagios nagios 6 Oct 9 13:04 /usr/local/nagios/var/spool/checkresults
[root@nagiosserver nagios]#

Re: Issue with NRDP check

Posted: Wed Oct 09, 2019 1:53 pm
by scottwilkerson
Same as before, lets check the following

Code: Select all

grep nagios /etc/group
make sure apache is a member of the nagios group
https://support.nagios.com/forum/viewto ... 10#p294282