Hi Team,
While doing one passive check using send_nrdp.sh in one of the remote server we are getting below error while running it from crontab. But it is getting executed if running locally.
we gave full permissions to the script we are running and also to the send_nrdp.sh script
"ERROR: could not connect to NRDP server at https://nagiosxi-****.rwe.com/nrdp"
Any help would be highly appreciated.
send_nrdp error
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: send_nrdp error
From the remote machine where the crontab is running can you run the following and show the output (replacing the actual hostname)
Code: Select all
curl -k -L -vvv https://nagiosxi-****.rwe.com/nrdp-
vinayvemula
- Posts: 18
- Joined: Mon Jun 03, 2019 2:09 am
Re: send_nrdp error
Below is the output:
[root@LN****** NRPE_Restart]# curl -k -L -vvv https://nagiosxi-****.rwe.com/nrdp
* About to connect() to nagiosxi-****.rwe.com port 443 (#0)
* Trying 10.90.4.233...
* Connected to nagiosxi-****.rwe.com (10.90.4.233) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* subject: CN=nagiosxi-****.rwe.com,O=RWE IT,C=DE
* start date: Apr 19 13:30:10 2016 GMT
* expire date: Apr 18 13:30:10 2021 GMT
* common name: nagiosxi-****.rwe.com
* issuer: CN=RWE CA 03 Device,DC=root,DC=rwe,DC=com
> GET /nrdp HTTP/1.1
> User-Agent: curl/7.29.0
> Host: nagiosxi-****.rwe.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=iso-8859-1
< Date: Thu, 27 Feb 2020 11:54:48 GMT
< Location: https://nagiosxi-****.rwe.com/nrdp/
< Server: Apache/2.2.15 (Red Hat)
< Content-Length: 330
< Connection: keep-alive
<
* Ignoring the response-body
* Connection #0 to host nagiosxi-****.rwe.com left intact
* Issue another request to this URL: 'https://nagiosxi-****.rwe.com/nrdp/'
* Found bundle for host nagiosxi-****.rwe.com: 0x17c0ec0
* Re-using existing connection! (#0) with host nagiosxi-****.rwe.com
* Connected to nagiosxi-****.rwe.com (10.90.4.233) port 443 (#0)
> GET /nrdp/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: nagiosxi-****.rwe.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=UTF-8
< Date: Thu, 27 Feb 2020 11:54:48 GMT
< Server: Apache/2.2.15 (Red Hat)
< X-Powered-By: PHP/5.3.3
< Content-Length: 1243
< Connection: keep-alive
<
<strong>Submit Nagios Command:</strong><br>
<form action="" method="get">
<input type="hidden" name="cmd" value="submitcmd">
Token: <input type="text" name="token" value="" size="15"><br>
Command: <input type="text" name="command" size="50" value="DISABLE_HOST_NOTIFICATIONS;somehost"><br>
<input type="submit" name="btnSubmit" value="Submit Command">
</form>
<hr>
<strong>Submit Check Data</strong><br>
<form action="" method="post">
<input type="hidden" name="cmd" value="submitcheck">
Token: <input type="text" name="token" value="" size="15"><br>
Check Data:<br>
<textarea cols="80" rows="15" name="XMLDATA">
<?xml version='1.0'?>
<checkresults>
<checkresult type='host'>
<hostname>somehost</hostname>
<state>0</state>
<output>Everything looks okay!|perfdata</output>
</checkresult>
<checkresult type='service'>
<hostname>somehost</hostname>
<servicename>someservice</servicename>
<state>1</state>
<output>WARNING: Danger Will Robinson!|perfdata</output>
</checkresult>
</checkresults>
</textarea><br>
<input type="submit" name="btnSubmit" value="Submit Check Data">
</form>
* Connection #0 to host nagiosxi-****.rwe.com left intact
[root@LN****** NRPE_Restart]# curl -k -L -vvv https://nagiosxi-****.rwe.com/nrdp
* About to connect() to nagiosxi-****.rwe.com port 443 (#0)
* Trying 10.90.4.233...
* Connected to nagiosxi-****.rwe.com (10.90.4.233) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* subject: CN=nagiosxi-****.rwe.com,O=RWE IT,C=DE
* start date: Apr 19 13:30:10 2016 GMT
* expire date: Apr 18 13:30:10 2021 GMT
* common name: nagiosxi-****.rwe.com
* issuer: CN=RWE CA 03 Device,DC=root,DC=rwe,DC=com
> GET /nrdp HTTP/1.1
> User-Agent: curl/7.29.0
> Host: nagiosxi-****.rwe.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Content-Type: text/html; charset=iso-8859-1
< Date: Thu, 27 Feb 2020 11:54:48 GMT
< Location: https://nagiosxi-****.rwe.com/nrdp/
< Server: Apache/2.2.15 (Red Hat)
< Content-Length: 330
< Connection: keep-alive
<
* Ignoring the response-body
* Connection #0 to host nagiosxi-****.rwe.com left intact
* Issue another request to this URL: 'https://nagiosxi-****.rwe.com/nrdp/'
* Found bundle for host nagiosxi-****.rwe.com: 0x17c0ec0
* Re-using existing connection! (#0) with host nagiosxi-****.rwe.com
* Connected to nagiosxi-****.rwe.com (10.90.4.233) port 443 (#0)
> GET /nrdp/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: nagiosxi-****.rwe.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=UTF-8
< Date: Thu, 27 Feb 2020 11:54:48 GMT
< Server: Apache/2.2.15 (Red Hat)
< X-Powered-By: PHP/5.3.3
< Content-Length: 1243
< Connection: keep-alive
<
<strong>Submit Nagios Command:</strong><br>
<form action="" method="get">
<input type="hidden" name="cmd" value="submitcmd">
Token: <input type="text" name="token" value="" size="15"><br>
Command: <input type="text" name="command" size="50" value="DISABLE_HOST_NOTIFICATIONS;somehost"><br>
<input type="submit" name="btnSubmit" value="Submit Command">
</form>
<hr>
<strong>Submit Check Data</strong><br>
<form action="" method="post">
<input type="hidden" name="cmd" value="submitcheck">
Token: <input type="text" name="token" value="" size="15"><br>
Check Data:<br>
<textarea cols="80" rows="15" name="XMLDATA">
<?xml version='1.0'?>
<checkresults>
<checkresult type='host'>
<hostname>somehost</hostname>
<state>0</state>
<output>Everything looks okay!|perfdata</output>
</checkresult>
<checkresult type='service'>
<hostname>somehost</hostname>
<servicename>someservice</servicename>
<state>1</state>
<output>WARNING: Danger Will Robinson!|perfdata</output>
</checkresult>
</checkresults>
</textarea><br>
<input type="submit" name="btnSubmit" value="Submit Check Data">
</form>
* Connection #0 to host nagiosxi-****.rwe.com left intact
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: send_nrdp error
I believe the problem is you need to add the trailing / to your URL when calling the script
instead of
because the post data cannot follow the redirect
Code: Select all
https://nagiosxi-****.rwe.com/nrdp/Code: Select all
https://nagiosxi-****.rwe.com/nrdp