Commit b6d0a34b authored by mcramer's avatar mcramer
Browse files

Implemented new function for ispconfig monitor app

parent 6e054f5d
...@@ -29,6 +29,11 @@ if($token == '' or $secret == '' or $token != $secret) { ...@@ -29,6 +29,11 @@ if($token == '' or $secret == '' or $token != $secret) {
if($type == 'serverlist') { if($type == 'serverlist') {
$sql = 'SELECT server_id, server_name FROM server WHERE 1 ORDER BY server_id'; $sql = 'SELECT server_id, server_name FROM server WHERE 1 ORDER BY server_id';
$records = $app->db->queryAllRecords($sql); $records = $app->db->queryAllRecords($sql);
foreach($records as $index => $rec) {
$rec = $app->db->queryOneRecord("SELECT * FROM monitor_data WHERE server_id = " . $rec['server_id'] . " AND state NOT IN ('ok', 'no_state')");
if($rec) $records[$index]['state'] = 'warn';
else $records[$index]['state'] = 'ok';
}
$out['state'] = 'ok'; $out['state'] = 'ok';
$out['data'] = $records; $out['data'] = $records;
$out['time'] = date('Y-m-d H:i',$rec['created']); $out['time'] = date('Y-m-d H:i',$rec['created']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment