more crap from falz, something about alerts and... TLDR

git-svn-id: http://www.observium.org/svn/observer/trunk@2078 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-04-13 16:37:29 +00:00
parent b593df2549
commit e7e2ec8213
6 changed files with 266 additions and 40 deletions
+16 -13
View File
@@ -76,20 +76,23 @@ if (isset($config['enable_bgp']) && $config['enable_bgp'])
}
}
if ($_SESSION['userlevel'] == '10')
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0)
{
$sql = mysql_query("SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime < '84600' AND D.ignore = 0");
} else {
$sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '1' AND D.uptime < '84600' AND D.ignore = 0");
}
while ($device = mysql_fetch_assoc($sql))
{
generate_front_box("#aaffaa", "<center><strong>".generate_device_link($device, shorthost($device['hostname']))."</strong><br />
<span style='font-size: 14px; font-weight: bold; margin: 5px; color: #009;'>Device<br />Rebooted</span><br />
<span class=body-date-1>".formatUptime($device['uptime'], 'short')."</span>
</center>");
if ($_SESSION['userlevel'] == '10')
{
$sql = mysql_query("SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0");
} else {
$sql = mysql_query("SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.status = '1' AND D.uptime < '" .
$config['uptime_warning'] . "' AND D.ignore = 0");
}
while ($device = mysql_fetch_assoc($sql))
{
generate_front_box("#aaffaa", "<center><strong>".generate_device_link($device, shorthost($device['hostname']))."</strong><br />
<span style='font-size: 14px; font-weight: bold; margin: 5px; color: #009;'>Device<br />Rebooted</span><br />
<span class=body-date-1>".formatUptime($device['uptime'], 'short')."</span>
</center>");
}
}
if ($config['enable_syslog'])
@@ -140,4 +143,4 @@ if ($config['enable_syslog'])
echo("</div>");
?>
?>