Hi,
Maybe you could try curl directly to see if it works on the REST url. Something like:
$ curl -LknX GET '
https://127.0.0.1/rest/check/nagiosconfig?json=\{"folder":"local","verbose":"false"\}'
["Total Warnings: 0, Total Errors: 0"]
-L for redoing the request for redirects. Try with and without this option.
If that works then try modifying the file, '/usr/share/nagrestconf/htdocs/nagrestconf/index.php'.
Copy that file somewhere safe then edit it.
Find the function 'setCurlOpts' and add a follow-redirects option.
This is the original function:
# --------------------------------------------------------------------
protected function setCurlOpts (&$curlHandle)
# --------------------------------------------------------------------
{
curl_setopt($curlHandle, CURLOPT_TIMEOUT, 300);
curl_setopt($curlHandle, CURLOPT_PROXY, "");
curl_setopt($curlHandle, CURLOPT_URL, $this->url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array ('Accept: ' . $this->acceptType));
}
And add the line:
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, true);
to make it look like:
# --------------------------------------------------------------------
protected function setCurlOpts (&$curlHandle)
# --------------------------------------------------------------------
{
curl_setopt($curlHandle, CURLOPT_TIMEOUT, 300);
curl_setopt($curlHandle, CURLOPT_PROXY, "");
curl_setopt($curlHandle, CURLOPT_URL, $this->url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array ('Accept: ' . $this->acceptType));
}
Hopefully this will work for you.
ALTERNATIVELY you could put the redirect address directly into /etc/nagrestconf.ini.
Cheers!
Mark