NRDP send command

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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRDP send command

Post by tmcdonald »

As for displaying the source code, you probably have short tags disabled in your php. Try changing the first line of /usr/local/nrdp/clients/send_nrdp.php from this:

Code: Select all

<?
to this:

Code: Select all

<?php
and re-run it. Or just enable short-tags in your php config:

http://stackoverflow.com/questions/2185 ... short-tags
Former Nagios employee
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: NRDP send command

Post by tariqondego »

Thanks,its not displaying source code anymore after making that change.

I also checked /var/log/apache2/error.log and found this error:

Code: Select all

[Mon Sep 01 07:37:39.760883 2014] [authz_core:error] [pid 16670] [client 172.16.111.7:41908] AH01630: client denied by server configuration: /usr/local/nrdp/server/
So I changed the /etc/apache2/conf.d/nrdp.conf file to allow access to /usr/local/nrdp/server/

Code: Select all

<Directory "/usr/local/nrdp">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
#  AuthName "NRDP"
#  AuthType Basic
   AuthUserFile /usr/local/nrdp/htpasswd.users
   Require valid-user
</Directory>

Alias /nrdp "/usr/local/nrdp/server"

<Directory /usr/local/nrdp/server>
  Order allow,deny
  Allow from all
</Directory>
I also changed permission of /usr/local/nrdp/server

Code: Select all

drwxrw-rw- 4 nagios nagios 4096 Ful  1 05:50 server
But i still get error

Code: Select all

[Mon Sep 01 07:37:39.760883 2014] [authz_core:error] [pid 16670] [client 172.16.111.7:41908] AH01630: client denied by server configuration: /usr/local/nrdp/server/
I am using apache 2.4.7
Please advise.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRDP send command

Post by tmcdonald »

Try putting the basic auth in front of the URL like so:

Code: Select all

--url=username:password@http://192.168.1.5/nrdp
using whatever you would use to log in to your Nagios Core web interface.
Former Nagios employee
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: NRDP send command

Post by tariqondego »

I get below error when i try that:

Code: Select all

PHP Warning:  fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /usr/local/nrdp/clients/send_nrdp.php on line 368
PHP Warning:  fsockopen(): unable to connect to :80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /usr/local/nrdp/clients/send_nrdp.php on line 368
Please advise
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRDP send command

Post by tmcdonald »

Is it required that you have basic authentication on your NRDP directory? That seems to be the issue here and if it is not needed the script should work with the normal http://192.168.1.5/nrdp address.
Former Nagios employee
Locked