mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixes to memory and CPU graphs on IOS. adding mixed colourscheme to static-config
git-svn-id: http://www.observium.org/svn/observer/trunk@523 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -4,14 +4,10 @@ $query = mysql_query("SELECT * FROM `cpmCPU` where `device_id` = '".mres($device
|
|||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
while($proc = mysql_fetch_array($query)) {
|
while($proc = mysql_fetch_array($query)) {
|
||||||
|
|
||||||
$rrd_filename = $config['rrd_dir'] . "/$hostname/cpmCPU-" . $proc['cpmCPU_oid'] . ".rrd";
|
$rrd_filename = $config['rrd_dir'] . "/$hostname/cpmCPU-" . $proc['cpmCPU_oid'] . ".rrd";
|
||||||
|
|
||||||
if(is_file($rrd_filename)) {
|
if(is_file($rrd_filename)) {
|
||||||
|
|
||||||
$descr = str_pad($proc['entPhysicalDescr'], 8);
|
$descr = str_pad($proc['entPhysicalDescr'], 8);
|
||||||
$descr = substr($descr,0,8);
|
$descr = substr($descr,0,8);
|
||||||
|
|
||||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||||
$rrd_list[$i]['descr'] = $descr;
|
$rrd_list[$i]['descr'] = $descr;
|
||||||
$rrd_list[$i]['rra'] = "usage";
|
$rrd_list[$i]['rra'] = "usage";
|
||||||
@@ -42,5 +38,4 @@ if($rrd_list) {include ("generic_multi_line.inc.php"); } else {
|
|||||||
$rrd_options .= " GPRINT:5m_max:MAX:%6.2lf\ GPRINT:5m:AVERAGE:%6.2lf\\\\n";
|
$rrd_options .= " GPRINT:5m_max:MAX:%6.2lf\ GPRINT:5m:AVERAGE:%6.2lf\\\\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -34,7 +34,7 @@ if(mysql_result(mysql_query("SELECT COUNT(*) FROM `cempMemPool` WHERE `device_id
|
|||||||
$rrd_options .= " GPRINT:mempool" . $iter . "total:MAX:%3.0lf%%\\\\n";
|
$rrd_options .= " GPRINT:mempool" . $iter . "total:MAX:%3.0lf%%\\\\n";
|
||||||
$iter++;
|
$iter++;
|
||||||
}
|
}
|
||||||
} else {
|
} elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `cmpMemPool` WHERE `device_id` = '$device_id'"),0) > '0') {
|
||||||
$iter = "1";
|
$iter = "1";
|
||||||
$rrd_options .= " COMMENT:' Currently Used Max\\n'";
|
$rrd_options .= " COMMENT:' Currently Used Max\\n'";
|
||||||
$sql = mysql_query("SELECT * FROM `cmpMemPool` where `device_id` = '$device_id'");
|
$sql = mysql_query("SELECT * FROM `cmpMemPool` where `device_id` = '$device_id'");
|
||||||
@@ -58,6 +58,8 @@ if(mysql_result(mysql_query("SELECT COUNT(*) FROM `cempMemPool` WHERE `device_id
|
|||||||
$rrd_options .= " GPRINT:mempool" . $iter . "total:MAX:%3.0lf%%\\\\n";
|
$rrd_options .= " GPRINT:mempool" . $iter . "total:MAX:%3.0lf%%\\\\n";
|
||||||
$iter++;
|
$iter++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -39,6 +39,10 @@ if(!$config['graph_colours']['purples']) {
|
|||||||
if(!$config['graph_colours']['default']) {
|
if(!$config['graph_colours']['default']) {
|
||||||
$config['graph_colours']['default'] = $config['graph_colours']['blues'];
|
$config['graph_colours']['default'] = $config['graph_colours']['blues'];
|
||||||
}
|
}
|
||||||
|
if(!$config['graph_colours']['mixed']) {
|
||||||
|
$config['graph_colours']['mixed'] = array("CC0000", "008C00", "4096EE", "73880A", "D01F3C", "36393D", "FF0084");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# No changes below this line #
|
# No changes below this line #
|
||||||
@@ -74,36 +78,4 @@ $week = time() - (7 * 24 * 60 * 60);
|
|||||||
$month = time() - (31 * 24 * 60 * 60);
|
$month = time() - (31 * 24 * 60 * 60);
|
||||||
$year = time() - (365 * 24 * 60 * 60);
|
$year = time() - (365 * 24 * 60 * 60);
|
||||||
|
|
||||||
|
|
||||||
### Update Database between 0.6.0 and 0.6.1 (slight slowdown)
|
|
||||||
|
|
||||||
$exists = false;
|
|
||||||
$columns = @mysql_query("SHOW columns FROM `interfaces`");
|
|
||||||
while($c = @mysql_fetch_assoc($columns)){
|
|
||||||
if($c['Field'] == "pagpOperationMode"){
|
|
||||||
$db_pagp = true;
|
|
||||||
}
|
|
||||||
if($c['Field'] == "portName"){
|
|
||||||
$db_portName = true;
|
|
||||||
}
|
|
||||||
if($c['Field'] == "ifHighSpeed"){
|
|
||||||
$db_ifHighSpeed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!$db_pagp) {
|
|
||||||
mysql_query("ALTER TABLE `interfaces` ADD `pagpOperationMode` VARCHAR( 32 ) NULL ,
|
|
||||||
ADD `pagpPortState` VARCHAR( 16 ) NULL ,
|
|
||||||
ADD `pagpPartnerDeviceId` VARCHAR( 48 ) NULL ,
|
|
||||||
ADD `pagpPartnerLearnMethod` VARCHAR( 16 ) NULL ,
|
|
||||||
ADD `pagpPartnerIfIndex` INT NULL ,
|
|
||||||
ADD `pagpPartnerGroupIfIndex` INT NULL ,
|
|
||||||
ADD `pagpPartnerDeviceName` VARCHAR( 128 ) NULL ,
|
|
||||||
ADD `pagpEthcOperationMode` VARCHAR( 16 ) NULL ,
|
|
||||||
ADD `pagpDeviceId` VARCHAR( 48 ) NULL ,
|
|
||||||
ADD `pagpGroupIfIndex` INT NULL"); }
|
|
||||||
|
|
||||||
if(!$db_portName) { mysql_query("ALTER TABLE `interfaces` ADD `portName` VARCHAR( 128 ) NULL DEFAULT NULL AFTER `ifName`"); }
|
|
||||||
if(!$db_ifHighSpeed) { mysql_query("ALTER TABLE `interfaces` ADD `ifHighSpeed` INT ( 11 ) NULL DEFAULT NULL AFTER `ifSpeed`"); }
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user