mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
add service history RRD and graph
git-svn-id: http://www.observium.org/svn/observer/trunk@926 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -11,10 +11,10 @@ $ports['up'] = mysql_result(mysql_query("SELECT count(*) FROM ports WHERE devic
|
||||
$ports['down'] = mysql_result(mysql_query("SELECT count(*) FROM ports WHERE device_id = '" . $device['device_id'] . "' AND ifOperStatus = 'down' AND ifAdminStatus = 'up'"),0);
|
||||
$ports['disabled'] = mysql_result(mysql_query("SELECT count(*) FROM ports WHERE device_id = '" . $device['device_id'] . "' AND ifAdminStatus = 'down'"),0);
|
||||
|
||||
$services['total'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_host = '" . $device['device_id'] . "'"),0);
|
||||
$services['up'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_host = '" . $device['device_id'] . "' AND service_status = '1' AND service_ignore ='0'"),0);
|
||||
$services['down'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_host = '" . $device['device_id'] . "' AND service_status = '0' AND service_ignore = '0'"),0);
|
||||
$services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_host = '" . $device['device_id'] . "' AND service_ignore = '1'"),0);
|
||||
$services['total'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE device_id = '" . $device['device_id'] . "'"),0);
|
||||
$services['up'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE device_id = '" . $device['device_id'] . "' AND service_status = '1' AND service_ignore ='0'"),0);
|
||||
$services['down'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE device_id = '" . $device['device_id'] . "' AND service_status = '0' AND service_ignore = '0'"),0);
|
||||
$services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE device_id = '" . $device['device_id'] . "' AND service_ignore = '1'"),0);
|
||||
|
||||
if($services['down']) { $services_colour = $warn_colour_a; } else { $services_colour = $list_colour_a; }
|
||||
if($ports['down']) { $ports_colour = $warn_colour_a; } else { $ports_colour = $list_colour_a; }
|
||||
@@ -48,7 +48,7 @@ echo("
|
||||
|
||||
echo("<div style='padding: 8px; font-size: 11px; font-weight: bold;'>");
|
||||
|
||||
$sql = "SELECT * FROM services WHERE service_host = '" . $device['device_id'] . "' ORDER BY service_type";
|
||||
$sql = "SELECT * FROM services WHERE device_id = '" . $device['device_id'] . "' ORDER BY service_type";
|
||||
$query = mysql_query($sql);
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
if ($data[service_status] == "0" && $data[service_ignore] == "1") { $status = "grey"; }
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
$hostname = gethostbyid($_GET[id]);
|
||||
|
||||
if(mysql_result(mysql_query("select count(service_id) from services WHERE service_host = '$_GET[id]'"), 0) > '0') {
|
||||
if(mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '$_GET[id]'"), 0) > '0') {
|
||||
|
||||
echo("<div style='margin: 5px;'><table cellpadding=7 border=0 cellspacing=0 width=100%>");
|
||||
$i = "1";
|
||||
$service_query = mysql_query("select * from services WHERE service_host = '$_GET[id]' ORDER BY service_type");
|
||||
$service_query = mysql_query("select * from services WHERE device_id = '$_GET[id]' ORDER BY service_type");
|
||||
while($service = mysql_fetch_array($service_query)) {
|
||||
|
||||
include("includes/print-service.inc");
|
||||
|
||||
Reference in New Issue
Block a user