I was able to narrow the problem down a bit myself.
The file to be read must apparently have the extension .json in the standard call.
Without it, the plugin will not recognize the file as json.
Does anyone know if this can be changed by parameter?
Or if there are other ways to make the plugin recognize files without extension as json?
According to the source code of the plugin, it checks the headers of the stream.
if ($response->is_success) {
if (!($response->header("content-type") =~ $np->opts->contenttype)) {
$np->nagios_exit(UNKNOWN,"Content type is not JSON: ".$response->header("content-type"));
}
According to the error you have, the headers of the stream say “text/plain” instead of “application/json”.
Check the URL with curl or a similar tool to confirm this. I am not sure on how to fix this but one way could be to edit out the script part checking for this. The best approach of course would be to fix this in the webserver/application level.