In your manual the format is for GET requests: http: <probe_ip> : <port_number> / <token> ?content= <valid XML_or_JSON>
This format works if I send it with the browser URL. The same code works on another server if using text only (no JSON, no XML) I do not even get an answer or an error from prtg
The json_encode shows: {"prtg":{"result":[{"channel":"MyChannel","value":2483}]}}
My code:
<!DOCTYPE html> <html> <body> <?php $temperature = 2483; $prtgJson = array( 'prtg' => array( 'result' => array(array( 'channel' => 'MyChannel', 'value' => $temperature )) ) ); $stringToPush = "http://probe_ip:5050/S19?content=" . $prtgJson; $xml = file_get_contents($stringToPush); ?> </body> </html>
Add comment