diff options
author | Simon Rettberg | 2017-10-12 16:14:39 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-10-12 16:14:39 +0200 |
commit | e10e538a0c46012175b98f8fbda6910a1295a722 (patch) | |
tree | 295ea1024db58ff4a084b227dad43754ce3223ef /modules-available/dnbd3/inc/dnbd3util.inc.php | |
parent | [runmode] Return lastseen too in detailed mode (diff) | |
download | slx-admin-e10e538a0c46012175b98f8fbda6910a1295a722.tar.gz slx-admin-e10e538a0c46012175b98f8fbda6910a1295a722.tar.xz slx-admin-e10e538a0c46012175b98f8fbda6910a1295a722.zip |
[dnbd3] Show free space, fix styling, add help texts and strings (de)
Diffstat (limited to 'modules-available/dnbd3/inc/dnbd3util.inc.php')
-rw-r--r-- | modules-available/dnbd3/inc/dnbd3util.inc.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules-available/dnbd3/inc/dnbd3util.inc.php b/modules-available/dnbd3/inc/dnbd3util.inc.php index 45ae6135..ae5e0cd7 100644 --- a/modules-available/dnbd3/inc/dnbd3util.inc.php +++ b/modules-available/dnbd3/inc/dnbd3util.inc.php @@ -49,7 +49,7 @@ class Dnbd3Util { // Now query them all $NOW = time(); foreach ($servers as $server) { - $data = Dnbd3Rpc::query(true, false, false, $server['addr']); + $data = Dnbd3Rpc::query($server['addr'], 5003, true, false, false, true); if (!is_array($data) || !isset($data['runId'])) { Database::exec('UPDATE dnbd3_server SET uptime = 0, clientcount = 0 WHERE serverid = :serverid', array('serverid' => $server['serverid'])); @@ -60,7 +60,7 @@ class Dnbd3Util { Database::exec('UPDATE dnbd3_server SET runid = :runid, lastseen = :now, uptime = :uptime, totalup = totalup + If(runid = :runid AND uptime <= :uptime, If(lastup < :up, :up - lastup, 0), If(:uptime < 1800, :up, 0)), totaldown = totaldown + If(runid = :runid AND uptime <= :uptime, If(lastdown < :down, :down - lastdown, 0), If(:uptime < 1800, :up, 0)), - lastup = :up, lastdown = :down, clientcount = :clientcount + lastup = :up, lastdown = :down, clientcount = :clientcount, disktotal = :disktotal, diskfree = :diskfree WHERE serverid = :serverid', array( 'runid' => $data['runId'], 'now' => $NOW, @@ -68,7 +68,9 @@ class Dnbd3Util { 'up' => $data['bytesSent'], 'down' => $data['bytesReceived'], 'clientcount' => $data['clientCount'], - 'serverid' => $server['serverid'] + 'serverid' => $server['serverid'], + 'disktotal' => $data['spaceTotal'], + 'diskfree' => $data['spaceFree'], )); } } |