@@ -264,13 +264,11 @@ function _getServerState($serverId, $serverName) {
264264 */
265265 $ html_verbose = $ html_server ;
266266 foreach ($ messages as $ key => $ state ) {
267- {
268- $ html_verbose .= $ key . ':<br /> ' ;
269- foreach ($ state as $ msg ) {
270- $ html_verbose .= $ msg . '<br /> ' ;
271- }
272- $ html_verbose .= '<br /> ' ;
267+ $ html_verbose .= $ key . ':<br /> ' ;
268+ foreach ($ state as $ msg ) {
269+ $ html_verbose .= $ msg . '<br /> ' ;
273270 }
271+ $ html_verbose .= '<br /> ' ;
274272 }
275273
276274 /*
@@ -299,7 +297,7 @@ function _getServerState($serverId, $serverName) {
299297}
300298
301299/*
302- * gets the state from the db and process it
300+ * gets the state from the db and process it
303301*/
304302function _processDbState ($ type , $ serverId , $ serverState , $ messages ) {
305303 global $ app ;
@@ -308,10 +306,17 @@ function _processDbState($type, $serverId, $serverState, $messages) {
308306 * Always the NEWEST record of each monitoring is responsible for the
309307 * state
310308 */
311- // get the State from the DB
309+ // get the State from the DB
312310 $ record = $ app ->db ->queryOneRecord ("SELECT state FROM monitor_data WHERE type = ' " . $ type . "' and server_id = " . $ serverId . " order by created desc " );
313- // change the new state to the highest state
314- $ serverState = _setState ($ serverState , $ record ['state ' ]);
311+
312+ // change the new state to the highest state
313+ /*
314+ * Monitoring the user_beancounter of a VE is not as easy as i thought, so for now ignore
315+ * this state (if we have a better solution)
316+ */
317+ if ($ type != 'openvz_beancounter ' ) {
318+ $ serverState = _setState ($ serverState , $ record ['state ' ]);
319+ }
315320
316321 /*
317322 * The message depands on the type and the state
@@ -449,32 +454,35 @@ function _processDbState($type, $serverId, $serverState, $messages) {
449454 }
450455 }
451456
452- if ($ type == 'openvz_beancounter ' ) {
453- switch ($ record ['state ' ]) {
454- case 'ok ' :
455- $ messages [$ app ->lng ("monitor_serverstate_listok_txt " )][] = $ app ->lng ("monitor_serverstate_beancounterok_txt " ) . ' ' .
456- "<a href='#' onclick='loadContent( \"monitor/show_data.php?type=openvz_beancounter \");'>[ " . $ app ->lng ("monitor_serverstate_more_txt " ) . "]</a> " ;
457- break ;
458- case 'info ' :
459- $ messages [$ app ->lng ("monitor_serverstate_listinfo_txt " )][] = $ app ->lng ("monitor_serverstate_beancounterinfo_txt " ) . ' ' .
460- "<a href='#' onclick='loadContent( \"monitor/show_data.php?type=openvz_beancounter \");'>[ " . $ app ->lng ("monitor_serverstate_more_txt " ) . "]</a> " ;
461- break ;
462- case 'warning ' :
463- $ messages [$ app ->lng ("monitor_serverstate_listinfo_txt " )][] = $ app ->lng ("monitor_serverstate_beancounterwarning_txt " ) . ' ' .
464- "<a href='#' onclick='loadContent( \"monitor/show_data.php?type=openvz_beancounter \");'>[ " . $ app ->lng ("monitor_serverstate_more_txt " ) . "]</a> " ;
465- break ;
466- case 'critical ' :
467- $ messages [$ app ->lng ("monitor_serverstate_listcritical_txt " )][] = $ app ->lng ("monitor_serverstate_beancountercritical_txt " ) . ' ' .
468- "<a href='#' onclick='loadContent( \"monitor/show_data.php?type=openvz_beancounter \");'>[ " . $ app ->lng ("monitor_serverstate_more_txt " ) . "]</a> " ;
469- break ;
470- case 'error ' :
471- $ messages [$ app ->lng ("monitor_serverstate_listerror_txt " )][] = $ app ->lng ("monitor_serverstate_beancountererror_txt " ) . ' ' .
472- "<a href='#' onclick='loadContent( \"monitor/show_data.php?type=openvz_beancounter \");'>[ " . $ app ->lng ("monitor_serverstate_more_txt " ) . "]</a> " ;
473- break ;
474- default :
475- break ;
476- }
477- }
457+ /*
458+ * ignore, until we find a better solution
459+ */
460+ // if ($type == 'openvz_beancounter') {
461+ // switch ($record['state']) {
462+ // case 'ok':
463+ // $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_beancounterok_txt") . ' ' .
464+ // "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
465+ // break;
466+ // case 'info':
467+ // $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_beancounterinfo_txt") . ' ' .
468+ // "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
469+ // break;
470+ // case 'warning':
471+ // $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_beancounterwarning_txt") . ' ' .
472+ // "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
473+ // break;
474+ // case 'critical':
475+ // $messages[$app->lng("monitor_serverstate_listcritical_txt")][] = $app->lng("monitor_serverstate_beancountercritical_txt") . ' ' .
476+ // "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
477+ // break;
478+ // case 'error':
479+ // $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_beancountererror_txt") . ' ' .
480+ // "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
481+ // break;
482+ // default:
483+ // break;
484+ // }
485+ // }
478486
479487
480488 if ($ type == 'mailq ' ) {
0 commit comments