blob: 258d03d06d5c77ee4e6269d9565f0b50dc02105b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<?php
if (Dnbd3::isEnabled()) {
$res = Database::simpleQuery('SELECT s.fixedip, s.lastseen AS dnbd3lastseen, s.errormsg, m.clientip, m.hostname
FROM dnbd3_server s
LEFT JOIN machine m USING (machineuuid)
WHERE errormsg IS NOT NULL');
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
$error = $row['errormsg'] ? $row['errormsg'] : '<unknown error>';
$lastSeen = date('d.m.Y H:i', $row['dnbd3lastseen']);
if ($row['fixedip'] === '<self>') {
Message::addError('dnbd3.main-dnbd3-unreachable', true, $error, $lastSeen);
continue;
}
if (!is_null($row['fixedip'])) {
$ip = $row['fixedip'];
} else {
$ip = $row['clientip'] . '/' . $row['hostname'];
}
Message::addWarning('dnbd3.dnbd3-proxy-unreachable', true, $ip, $error, $lastSeen);
}
unset($res);
}
|