mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
redesigned graph defining system (still seems a bit batshit, but nevermind). lots of improvements to various pollers, only writing RRDs if valid data is returned, etc.
git-svn-id: http://www.observium.org/svn/observer/trunk@1506 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -6,6 +6,4 @@ if(is_numeric($id)) {
|
||||
|
||||
$title = generatedevicelink($device);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$query = mysql_query("SELECT * FROM `processors` where `device_id` = '".$id."'");
|
||||
|
||||
$i=0;
|
||||
while($proc = mysql_fetch_array($query)) {
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
|
||||
|
||||
if(is_file($rrd_filename)) {
|
||||
|
||||
$descr = short_hrDeviceDescr($proc['processor_descr']);
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['rra'] = "usage";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units='%';
|
||||
$total_units='%';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list) {
|
||||
include ("includes/graphs/generic_multi_line.inc.php");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units='%';
|
||||
$total_units='%';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/powerconnect-cpu.rrd";
|
||||
|
||||
$rrd_options .= " DEF:load=$database:LOAD:AVERAGE";
|
||||
$rrd_options .= " DEF:load_max=$database:LOAD:MAX";
|
||||
$rrd_options .= " DEF:load_min=$database:LOAD:MIN";
|
||||
$rrd_options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n";
|
||||
$rrd_options .= " AREA:load#ffee99: LINE1.25:load#aa2200:Load\ %";
|
||||
$rrd_options .= " GPRINT:load:LAST:%6.2lf\ GPRINT:load_min:AVERAGE:%6.2lf\ ";
|
||||
$rrd_options .= " GPRINT:load_max:MAX:%6.2lf\ GPRINT:load:AVERAGE:%6.2lf\\\\n";
|
||||
|
||||
?>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units='%';
|
||||
$total_units='%';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/procurve-cpu.rrd";
|
||||
|
||||
$rrd_options .= " DEF:load=$database:LOAD:AVERAGE";
|
||||
$rrd_options .= " DEF:load_max=$database:LOAD:MAX";
|
||||
$rrd_options .= " DEF:load_min=$database:LOAD:MIN";
|
||||
$rrd_options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n";
|
||||
$rrd_options .= " AREA:load#ffee99: LINE1.25:load#aa2200:Load\ %";
|
||||
$rrd_options .= " GPRINT:load:LAST:%6.2lf\ GPRINT:load_min:AVERAGE:%6.2lf\ ";
|
||||
$rrd_options .= " GPRINT:load_max:MAX:%6.2lf\ GPRINT:load:AVERAGE:%6.2lf\\\\n";
|
||||
|
||||
?>
|
||||
+1
-1
@@ -6,7 +6,7 @@ $scale_min = "0";
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hrSystem.rrd";
|
||||
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_processes.rrd";
|
||||
|
||||
$rrd_options .= " DEF:procs=$database:procs:AVERAGE";
|
||||
$rrd_options .= " COMMENT:Processes\ \ \ \ Cur\ \ \ \ \ Ave\ \ \ \ \ \ Min\ \ \ \ \ Max\\\\n";
|
||||
+1
-1
@@ -6,7 +6,7 @@ $scale_min = "0";
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hrSystem.rrd";
|
||||
$database = $config['rrd_dir'] . "/" . $device['hostname'] . "/hr_users.rrd";
|
||||
|
||||
$rrd_options .= " DEF:users=$database:users:AVERAGE";
|
||||
$rrd_options .= " DEF:users_max=$database:users:MAX";
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ipSystemStats-ipv4.rrd";
|
||||
|
||||
$rrd_options .= " DEF:ipInDelivers=$rrd_filename:InDelivers:AVERAGE";
|
||||
$rrd_options .= " DEF:ipReasmReqds=$rrd_filename:ReasmReqds:AVERAGE";
|
||||
$rrd_options .= " DEF:ipReasmOKs=$rrd_filename:ReasmOKs:AVERAGE";
|
||||
$rrd_options .= " DEF:ipReasmFails=$rrd_filename:ReasmFails:AVERAGE";
|
||||
$rrd_options .= " DEF:ipFragFails=$rrd_filename:OutFragFails:AVERAGE";
|
||||
$rrd_options .= " DEF:ipFragCreates=$rrd_filename:OutFragCreates:AVERAGE";
|
||||
|
||||
$rrd_options .= " DEF:MipInDelivers=$rrd_filename:InDelivers:MAX";
|
||||
$rrd_options .= " DEF:MipReasmOKs=$rrd_filename:ReasmOKs:MAX";
|
||||
$rrd_options .= " DEF:MipReasmReqds=$rrd_filename:ReasmReqds:MAX";
|
||||
$rrd_options .= " DEF:MipReasmFails=$rrd_filename:ReasmFails:MAX";
|
||||
$rrd_options .= " DEF:MipFragFails=$rrd_filename:OutFragFails:MAX";
|
||||
$rrd_options .= " DEF:MipFragCreates=$rrd_filename:OutFragCreates:MAX";
|
||||
|
||||
$rrd_options .= " CDEF:ReasmReqds=ipReasmReqds,ipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:ReasmOKs=ipReasmOKs,ipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:ReasmFails=ipReasmFails,ipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:FragFails=ipFragFails,ipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:FragCreates=ipFragCreates,ipInDelivers,/,100,*";
|
||||
|
||||
$rrd_options .= " CDEF:FragFails_n=FragFails,-1,*";
|
||||
$rrd_options .= " CDEF:FragCreates_n=FragCreates,-1,*";
|
||||
|
||||
$rrd_options .= " CDEF:MReasmReqds=MipReasmReqds,MipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:MReasmOKs=MipReasmOKs,MipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:MReasmFails=MipReasmFails,MipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:MFragFails=MipFragFails,MipInDelivers,/,100,*";
|
||||
$rrd_options .= " CDEF:MFragCreates=MipFragCreates,MipInDelivers,/,100,*";
|
||||
|
||||
$rrd_options .= " COMMENT:'% ipInDelivers Current Average Maximum\\n'";
|
||||
|
||||
$rrd_options .= " LINE1.25:FragFails_n#cc0000:'Frag Fail '";
|
||||
$rrd_options .= " GPRINT:FragFails:LAST:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:FragFails:AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:MFragFails:MAX:%6.2lf%s\\\\n";
|
||||
|
||||
$rrd_options .= " LINE1.25:FragCreates#00cc:'Frag Create '";
|
||||
$rrd_options .= " GPRINT:FragCreates:LAST:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:FragCreates:AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:MFragCreates:MAX:%6.2lf%s\\\\n";
|
||||
|
||||
$rrd_options .= " LINE1.25:ReasmOKs#006600:'Reasm OK '";
|
||||
$rrd_options .= " GPRINT:ReasmOKs:LAST:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:ReasmOKs:AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:MReasmOKs:MAX:%6.2lf%s\\\\n";
|
||||
|
||||
$rrd_options .= " LINE1.25:ReasmFails#660000:'Reasm Fail '";
|
||||
$rrd_options .= " GPRINT:ReasmFails:LAST:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:ReasmFails:AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:MReasmFails:MAX:%6.2lf%s\\\\n";
|
||||
|
||||
$rrd_options .= " LINE1.25:ReasmReqds#000066:'Reasm Reqd '";
|
||||
$rrd_options .= " GPRINT:ReasmReqds:LAST:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:ReasmReqds:AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:MReasmReqds:MAX:%6.2lf%s\\\\n";
|
||||
|
||||
?>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
$scale_min = "0";
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/procurve-mem.rrd";
|
||||
|
||||
$rrd_options .= " -b 1024";
|
||||
$rrd_options .= " DEF:TOTAL=$rrd_filename:TOTAL:AVERAGE";
|
||||
$rrd_options .= " DEF:FREE=$rrd_filename:FREE:AVERAGE";
|
||||
$rrd_options .= " DEF:USED=$rrd_filename:USED:AVERAGE";
|
||||
$rrd_options .= " DEF:FREE_max=$rrd_filename:FREE:MAX";
|
||||
$rrd_options .= " DEF:USED_max=$rrd_filename:USED:MAX";
|
||||
$rrd_options .= " DEF:FREE_min=$rrd_filename:FREE:MIN";
|
||||
$rrd_options .= " DEF:USED_min=$rrd_filename:USED:MIN";
|
||||
$rrd_options .= " CDEF:tot=FREE,USED,+";
|
||||
|
||||
$rrd_options .= " COMMENT:'Bytes Current Average Maximum\\n'";
|
||||
|
||||
$rrd_options .= " LINE1:USED#d0b080:";
|
||||
$rrd_options .= " AREA:USED#f0e0a0:used";
|
||||
$rrd_options .= " GPRINT:USED:LAST:\ \ \ %7.2lf%sB";
|
||||
$rrd_options .= " GPRINT:USED:AVERAGE:%7.2lf%sB";
|
||||
$rrd_options .= " GPRINT:USED:MAX:%7.2lf%sB\\\\n";
|
||||
$rrd_options .= " AREA:FREE#e5e5e5:free:STACK";
|
||||
$rrd_options .= " GPRINT:FREE:LAST:\ \ \ %7.2lf%sB";
|
||||
$rrd_options .= " GPRINT:FREE:AVERAGE:%7.2lf%sB";
|
||||
$rrd_options .= " GPRINT:FREE:MAX:%7.2lf%sB\\\\n";
|
||||
|
||||
$rrd_options .= " LINE1.5:USED#c03030:";
|
||||
$rrd_options .= " LINE1.5:TOTAL#808080:";
|
||||
|
||||
?>
|
||||
-39
@@ -1,42 +1,5 @@
|
||||
<?php
|
||||
|
||||
$query = mysql_query("SELECT * FROM `hrDevice` where `device_id` = '".mres($_GET['id'])."' AND hrDeviceType = 'hrDeviceProcessor'");
|
||||
$device = device_by_id_cache(mres($device_id));
|
||||
|
||||
|
||||
$i=0;
|
||||
while($proc = mysql_fetch_array($query)) {
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("hrProcessor-" . $proc['hrDeviceIndex'] . ".rrd");
|
||||
|
||||
if(is_file($rrd_filename)) {
|
||||
|
||||
$descr = short_hrDeviceDescr($proc['hrDeviceDescr']);
|
||||
$descr = str_replace(":", "\:", $descr);
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['rra'] = "usage";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units='%';
|
||||
$total_units='%';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list) {
|
||||
|
||||
include ("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
} else {
|
||||
include("includes/graphs/common.inc.php");
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . "ucd_cpu.rrd";
|
||||
$rrd_options .= " DEF:user=$rrd_filename:user:AVERAGE";
|
||||
@@ -66,6 +29,4 @@ include ("includes/graphs/generic_multi_line.inc.php");
|
||||
$rrd_options .= " GPRINT:idle_perc:AVERAGE:\ \ \ %5.2lf%%";
|
||||
$rrd_options .= " GPRINT:idle_perc:MAX:\ \ \ %5.2lf%%\\\\n";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_load.rrd";
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_load.rrd";
|
||||
|
||||
$rrd_options .= " DEF:1min=$rrd_filename:1min:AVERAGE";
|
||||
$rrd_options .= " DEF:5min=$rrd_filename:5min:AVERAGE";
|
||||
@@ -12,6 +12,7 @@ if($_GET['debug']) {
|
||||
include("../config.php");
|
||||
include("../includes/common.php");
|
||||
include("../includes/rewrites.php");
|
||||
include("includes/functions.inc.php");
|
||||
include("includes/authenticate.inc.php");
|
||||
|
||||
if(!$config['allow_unauth_graphs']) {
|
||||
@@ -47,9 +48,8 @@ if($_GET['debug']) {
|
||||
|
||||
$graphfile = $config['temp_dir'] . "/" . strgen() . ".png";
|
||||
|
||||
$os = gethostosbyid($device_id);
|
||||
if($config['os'][$os]['group']) {$os_group = $config['os'][$os]['group'];}
|
||||
|
||||
# $os = gethostosbyid($device_id);
|
||||
# if($config['os'][$os]['group']) {$os_group = $config['os'][$os]['group'];}
|
||||
# if(is_file($config['install_dir'] . "/html/includes/graphs/".$type."_".$os.".inc.php")) {
|
||||
# /// Type + OS Specific
|
||||
# include($config['install_dir'] . "/html/includes/graphs/".$type."_".$os.".inc.php");
|
||||
@@ -62,6 +62,7 @@ if($_GET['debug']) {
|
||||
# }
|
||||
|
||||
if(is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php")) {
|
||||
include($config['install_dir'] . "/html/includes/graphs/$type/auth.inc.php");
|
||||
include($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user