mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
make service graph make a tiny bit more sense. because moar.
git-svn-id: http://www.observium.org/svn/observer/trunk@928 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -11,17 +11,21 @@ include("common.inc.php");
|
||||
$query = mysql_query($sql);
|
||||
$service = mysql_fetch_array($query);
|
||||
|
||||
$service_text = substr(str_pad($service['service_type'], 28),0,28);
|
||||
|
||||
$rrd = $config['rrd_dir'] . "/" . $service['hostname'] . "/" . safename("service-" . $service['service_type'] . "-" . $service['service_id'] . ".rrd");
|
||||
|
||||
$rrd_options .= " COMMENT:' Cur Max\\n'";
|
||||
$rrd_options .= " DEF:status=$rrd:status:AVERAGE";
|
||||
$rrd_options .= " CDEF:percent=status,100,*";
|
||||
$rrd_options .= " CDEF:down=status,1,LT,status,UNKN,IF";
|
||||
$rrd_options .= " AREA:status#CCFFCC";
|
||||
$rrd_options .= " AREA:down#FFCCCC";
|
||||
$rrd_options .= " LINE1.5:status#009900:'" . $service['service_type'] . "'"; # Ugly hack :(
|
||||
$rrd_options .= " LINE1.5:down#cc0000";
|
||||
$rrd_options .= " CDEF:percentdown=down,100,*";
|
||||
$rrd_options .= " AREA:percent#CCFFCC";
|
||||
$rrd_options .= " AREA:percentdown#FFCCCC";
|
||||
$rrd_options .= " LINE1.5:percent#009900:'" . $service_text . "'"; # Ugly hack :(
|
||||
$rrd_options .= " LINE1.5:percentdown#cc0000";
|
||||
$rrd_options .= " GPRINT:status:LAST:%3.0lf";
|
||||
$rrd_options .= " GPRINT:status:MAX:%3.0lf\\\\l";
|
||||
$rrd_options .= " GPRINT:percent:AVERAGE:%3.0lf%%\\\\l";
|
||||
|
||||
|
||||
|
||||
|
@@ -23,6 +23,11 @@ if(!$samehost) {
|
||||
|
||||
$mini_url = $config['base_url'] . "/graph.php?id=".$service['service_id']."&type=service&from=".$day."&to=".$now."&width=80&height=20&bg=efefef";
|
||||
|
||||
$popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$service['service_type'];
|
||||
$popup .= "</div><img src=\'".$config['base_url']."/graph.php?id=" . $service['service_id'] . "&type=service&from=$day&to=$now&width=400&height=125\'>";
|
||||
$popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
|
||||
|
||||
echo("
|
||||
<tr style=\"background-color: $bg; padding: 5px;\">");
|
||||
@@ -41,7 +46,7 @@ echo("
|
||||
<td valign=top class=list-bold>
|
||||
$status
|
||||
</td>
|
||||
<td><img src='$mini_url'></td>
|
||||
<td valign=top><a $popup><img src='$mini_url'></a></td>
|
||||
<td valign=top width=175>
|
||||
$since
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user