Skip to content

Commit 2ae58a2

Browse files
author
vogelor
committed
Small bugfixes and enhancements
1 parent 5a3f365 commit 2ae58a2

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

interface/web/monitor/show_sys_state.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ function _getServerState($serverId, $serverName, $showAll)
125125
/* The State of the server */
126126
$serverState = 'ok';
127127

128-
/** The Number of several infos, warnings, errors, ... */
129-
$count = array('unknown' => 0, 'info' => 0, 'warning' => 0, 'critical' => 0, 'error' => 0);
130-
131128
/** The messages */
132129
$messages = array();
133130

@@ -148,12 +145,12 @@ function _getServerState($serverId, $serverName, $showAll)
148145
$res .= '<div class="systemmonitor-content icons32 ico-'.$serverState.'">';
149146
$res .= $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName . '<br />';
150147
$res .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '<br />';
151-
// $res .= sizeof($messages['ok']) . ' ok | ';
152-
$res .= sizeof($messages['unknown']) . ' ' . $app->lng("monitor_serverstate_unknown_txt") . ' | ';
153-
$res .= sizeof($messages['info']) . ' ' . $app->lng("monitor_serverstate_info_txt") . ' | ';
154-
$res .= sizeof($messages['warning']) . ' ' . $app->lng("monitor_serverstate_warning_txt") . ' | ';
155-
$res .= sizeof($messages['critical']) . ' ' . $app->lng("monitor_serverstate_critical_txt") . ' | ';
156-
$res .= sizeof($messages['error']) . ' ' . $app->lng("monitor_serverstate_error_txt") . '<br />';
148+
// $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 />';
157154
$res .= '<br />';
158155

159156
if ($showAll){
@@ -218,8 +215,6 @@ function _processDbState($type, $serverId, &$serverState, &$messages)
218215
$record = $app->db->queryOneRecord("SELECT state FROM monitor_data WHERE type = '" . $type . "' and server_id = " . $serverId . " order by created desc");
219216
// change the new state to the highest state
220217
$serverState = _setState($serverState, $record['state']);
221-
// count the states
222-
$count[$record['state']]+= 1;
223218

224219
/*
225220
* The message depands on the type and the state

server/mods-available/monitor_core_module.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ function monitorDiskUsage() {
191191
/** The state of the disk-usage */
192192
$state = 'ok';
193193

194-
/** Fetch the data into a array */
195-
$dfData = shell_exec("df -hTx tmpfs");
194+
/** Fetch the data of ALL devices into a array (needed for monitoring!)*/
195+
$dfData = shell_exec("df -hT");
196196

197197
// split into array
198198
$df = explode("\n", $dfData);

0 commit comments

Comments
 (0)