I was able to write a simple PHP script that accomplished what the previous jQuery function did (192.168.3.87 is a separate machine from where this script was run):
Code: Select all
<?php
$url = 'http://nagiosadmin:[email protected]/nagios/cgi-bin/objectjson.cgi?query=hostlist&parenthost=none&childhost=none';
$obj = json_decode(file_get_contents($url), true);
print_r($obj);
?>
Code: Select all
Array ( [format_version] => 0 [result] => Array ( [query_time] => 1468945372000 [cgi] => objectjson.cgi [user] => nagiosadmin [query] => hostlist [query_status] => released [program_start] => 1468867888000 [last_data_update] => 1468867888000 [type_code] => 0 [type_text] => Success [message] => ) [data] => Array ( [selectors] => Array ( [parenthost] => none [childhost] => none ) [hostlist] => Array ( [0] => localhost ) ) )