|
1 | 1 | <?php |
2 | 2 | /* |
3 | | -Copyright (c) 2007-2008, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com |
| 3 | +Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com |
4 | 4 | All rights reserved. |
5 | 5 |
|
6 | 6 | Redistribution and use in source and binary forms, with or without modification, |
@@ -135,23 +135,31 @@ function _getServerState($serverId, $serverName, $showAll) |
135 | 135 | * get all monitoring-data from the server als process then |
136 | 136 | * (count them and set the server-state) |
137 | 137 | */ |
138 | | - $records = $app->db->queryAllRecords("SELECT DISTINCT type FROM monitor_data WHERE server_id = " . $serverId); |
139 | | - foreach($records as $record){ |
140 | | - _processDbState($record['type'], $serverId, &$serverState, &$messages); |
| 138 | + $records = $app->db->queryAllRecords("SELECT DISTINCT type, data FROM monitor_data WHERE server_id = " . $serverId); |
| 139 | + $osData = null; |
| 140 | + foreach($records as $record){ |
| 141 | + /* get the state from the db-data */ |
| 142 | + _processDbState($record['type'], $serverId, &$serverState, &$messages); |
| 143 | + /* if we have the os-info, get it */ |
| 144 | + if ($record['type'] == 'os_info') $osData = unserialize($record['data']); |
141 | 145 | } |
142 | 146 |
|
143 | 147 | $res .= '<div class="systemmonitor-state state-'.$serverState.'">'; |
144 | 148 | $res .= '<div class="systemmonitor-device device-server">'; |
145 | 149 | $res .= '<div class="systemmonitor-content icons32 ico-'.$serverState.'">'; |
146 | | - $res .= $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName . '<br />'; |
147 | | - $res .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '<br />'; |
| 150 | + $res .= $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName; |
| 151 | + if ($osData != null){ |
| 152 | + $res .= ' (' . $osData['name'] . ' ' . $osData['version'] . ')'; |
| 153 | + } |
| 154 | + $res .= '<br />'; |
| 155 | + $res .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . ' ('; |
148 | 156 | // $res .= sizeof($messages[$app->lng("monitor_serverstate_listok_txt")]) . ' ok | '; |
149 | | - $res .= sizeof($messages[$app->lng("monitor_serverstate_listunknown_txt")]) . ' ' . $app->lng("monitor_serverstate_unknown_txt") . ' | '; |
150 | | - $res .= sizeof($messages[$app->lng("monitor_serverstate_listinfo_txt")]) . ' ' . $app->lng("monitor_serverstate_info_txt") . ' | '; |
151 | | - $res .= sizeof($messages[$app->lng("monitor_serverstate_listwarning_txt")]) . ' ' . $app->lng("monitor_serverstate_warning_txt") . ' | '; |
152 | | - $res .= sizeof($messages[$app->lng("monitor_serverstate_listcritical_txt")]) . ' ' . $app->lng("monitor_serverstate_critical_txt") . ' | '; |
153 | | - $res .= sizeof($messages[$app->lng("monitor_serverstate_listerror_txt")]) . ' ' . $app->lng("monitor_serverstate_error_txt") . '<br />'; |
154 | | - $res .= '<br />'; |
| 157 | + $res .= sizeof($messages[$app->lng("monitor_serverstate_listunknown_txt")]) . ' ' . $app->lng("monitor_serverstate_unknown_txt") . ', '; |
| 158 | + $res .= sizeof($messages[$app->lng("monitor_serverstate_listinfo_txt")]) . ' ' . $app->lng("monitor_serverstate_info_txt") . ', '; |
| 159 | + $res .= sizeof($messages[$app->lng("monitor_serverstate_listwarning_txt")]) . ' ' . $app->lng("monitor_serverstate_warning_txt") . ', '; |
| 160 | + $res .= sizeof($messages[$app->lng("monitor_serverstate_listcritical_txt")]) . ' ' . $app->lng("monitor_serverstate_critical_txt") . ', '; |
| 161 | + $res .= sizeof($messages[$app->lng("monitor_serverstate_listerror_txt")]) . ' ' . $app->lng("monitor_serverstate_error_txt") . ''; |
| 162 | + $res .= ')<br />'; |
155 | 163 |
|
156 | 164 | if ($showAll){ |
157 | 165 | /* |
|
0 commit comments