mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
erm, forgot to add quite a bunch of files to the repo for the last few commits :/
git-svn-id: http://www.observium.org/svn/observer/trunk@1097 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
56
html/includes/graphs/device_frequencies.inc.php
Normal file
56
html/includes/graphs/device_frequencies.inc.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
include("common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$rrd_options .= " -l 0 -E ";
|
||||
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM frequency where device_id = '$id'");
|
||||
$rrd_options .= " COMMENT:' Cur Min Max\\n'";
|
||||
while($frequency = mysql_fetch_array($sql))
|
||||
{
|
||||
switch ($iter)
|
||||
{
|
||||
case "1":
|
||||
$colour= "CC0000";
|
||||
break;
|
||||
case "2":
|
||||
$colour= "008C00";
|
||||
break;
|
||||
case "3":
|
||||
$colour= "4096EE";
|
||||
break;
|
||||
case "4":
|
||||
$colour= "73880A";
|
||||
break;
|
||||
case "5":
|
||||
$colour= "D01F3C";
|
||||
break;
|
||||
case "6":
|
||||
$colour= "36393D";
|
||||
break;
|
||||
case "7":
|
||||
default:
|
||||
$colour= "FF0084";
|
||||
unset($iter);
|
||||
break;
|
||||
}
|
||||
|
||||
$hostname = gethostbyid($frequency['device_id']);
|
||||
|
||||
$descr = substr(str_pad($frequency['freq_descr'], 15),0,15);
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("freq-" . $frequency['freq_descr'] . ".rrd");
|
||||
$freq_id = $frequency['freq_id'];
|
||||
|
||||
$rrd_options .= " DEF:freq$freq_id=$rrd_filename:freq:AVERAGE";
|
||||
$rrd_options .= " LINE1:freq$freq_id#".$colour.":'" . $descr . "'";
|
||||
$rrd_options .= " GPRINT:freq$freq_id:AVERAGE:%5.2lfHz";
|
||||
$rrd_options .= " GPRINT:freq$freq_id:MIN:%5.2lfHz";
|
||||
$rrd_options .= " GPRINT:freq$freq_id:MAX:%5.2lfHz\\\\l";
|
||||
|
||||
$iter++;
|
||||
}
|
||||
|
||||
|
||||
?>
|
23
html/includes/graphs/frequency.inc.php
Normal file
23
html/includes/graphs/frequency.inc.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
include("common.inc.php");
|
||||
|
||||
$rrd_options .= " COMMENT:' Last Max\\n'";
|
||||
|
||||
$frequency = mysql_fetch_array(mysql_query("SELECT * FROM frequency where freq_id = '".mres($_GET['id'])."'"));
|
||||
|
||||
$hostname = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '" . $frequency['device_id'] . "'"),0);
|
||||
|
||||
$frequency['freq_descr_fixed'] = substr(str_pad($frequency['freq_descr'], 28),0,28);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$hostname."/" . safename("freq-" . $frequency['freq_descr'] . ".rrd");
|
||||
|
||||
$rrd_options .= " DEF:freq=$rrd_filename:freq:AVERAGE";
|
||||
$rrd_options .= " AREA:freq#FFFF99";
|
||||
$rrd_options .= " LINE1.5:freq#cc0000:'" . $frequency['freq_descr_fixed']."'";
|
||||
$rrd_options .= " GPRINT:freq:LAST:%3.0lfHz";
|
||||
$rrd_options .= " GPRINT:freq:MAX:%3.0lfHz\\\\l";
|
||||
|
||||
?>
|
Reference in New Issue
Block a user