mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updates
git-svn-id: http://www.observium.org/svn/observer/trunk@483 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -26,7 +26,7 @@ function graph_multi_bits ($args) {
|
|||||||
$options .= " CDEF:inbits=inoctets,8,*";
|
$options .= " CDEF:inbits=inoctets,8,*";
|
||||||
$options .= " CDEF:outbits=outoctets,8,*";
|
$options .= " CDEF:outbits=outoctets,8,*";
|
||||||
$options .= " CDEF:doutbits=doutoctets,8,*";
|
$options .= " CDEF:doutbits=doutoctets,8,*";
|
||||||
if($args['legend'] == '0') {
|
if($args['legend'] == 'no' || $args['legend'] == '1') {
|
||||||
$options .= " AREA:inbits#CDEB8B:";
|
$options .= " AREA:inbits#CDEB8B:";
|
||||||
$options .= " LINE1.25:inbits#006600:";
|
$options .= " LINE1.25:inbits#006600:";
|
||||||
$options .= " AREA:doutbits#C3D9FF:";
|
$options .= " AREA:doutbits#C3D9FF:";
|
||||||
@@ -57,7 +57,9 @@ $args['from'] = $from;
|
|||||||
$args['to'] = $to;
|
$args['to'] = $to;
|
||||||
$args['width'] = $width;
|
$args['width'] = $width;
|
||||||
$args['height'] = $height;
|
$args['height'] = $height;
|
||||||
|
if($_GET['legend']) {
|
||||||
|
$args['legend'] = $_GET['legend'];
|
||||||
|
}
|
||||||
$graph = graph_multi_bits ($args);
|
$graph = graph_multi_bits ($args);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -493,22 +493,6 @@ function temp_graph_dev ($device, $graph, $from, $to, $width, $height, $title, $
|
|||||||
return $imgfile;
|
return $imgfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
function graph_device_bits ($device, $graph, $from, $to, $width, $height, $title, $vertical, $inverse, $legend = '1') {
|
|
||||||
global $config;
|
|
||||||
$hostname = gethostbyid($device);
|
|
||||||
$query = mysql_query("SELECT `ifIndex`,`interface_id` FROM `interfaces` WHERE `device_id` = '$device' AND `ifType` NOT LIKE '%oopback%' AND `ifType` NOT LIKE '%SVI%' AND `ifType` != 'l2vlan'");
|
|
||||||
if($width <= "300") { $options .= "--font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
|
|
||||||
$pluses = "";
|
|
||||||
while($int = mysql_fetch_row($query)) {
|
|
||||||
if(is_file($config['rrd_dir'] . "/" . $hostname . "/" . $int[0] . ".rrd")) {
|
|
||||||
$interfaces .= $seperator . $int[1];
|
|
||||||
$seperator = ",";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$imgfile = graph_multi_bits($interfaces, $graph, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
|
|
||||||
return $imgfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
function graph_mac_acc ($id, $graph, $from, $to, $width, $height) {
|
function graph_mac_acc ($id, $graph, $from, $to, $width, $height) {
|
||||||
global $config;
|
global $config;
|
||||||
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
|
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
|
||||||
|
@@ -79,27 +79,29 @@ while ($interface = mysql_fetch_array($interface_query)) {
|
|||||||
$ifPhysAddress = strtolower(str_replace("\"", "", $ifPhysAddress));
|
$ifPhysAddress = strtolower(str_replace("\"", "", $ifPhysAddress));
|
||||||
$ifPhysAddress = str_replace(" ", ":", $ifPhysAddress);
|
$ifPhysAddress = str_replace(" ", ":", $ifPhysAddress);
|
||||||
|
|
||||||
if ( $interface['ifDescr'] != $ifDescr && $ifDescr != "" ) {
|
# if ( $interface['ifDescr'] != $ifDescr && $ifDescr != "" ) {
|
||||||
$update .= $seperator . "`ifDescr` = '$ifDescr'";
|
# $update .= $seperator . "`ifDescr` = '$ifDescr'";
|
||||||
$seperator = ", ";
|
# $seperator = ", ";
|
||||||
mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Name -> " . $ifDescr . "')");
|
# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Name -> " . $ifDescr . "')");
|
||||||
}
|
# }
|
||||||
if ( $interface['ifAlias'] != $ifAlias ) {
|
# if ( $interface['ifAlias'] != $ifAlias ) {
|
||||||
$update .= $seperator . "`ifAlias` = '$ifAlias'";
|
# $update .= $seperator . "`ifAlias` = '$ifAlias'";
|
||||||
$seperator = ", ";
|
# $seperator = ", ";
|
||||||
mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Desc -> $ifAlias')");
|
# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Desc -> $ifAlias')");
|
||||||
}
|
# }
|
||||||
if ( $interface['ifOperStatus'] != $ifOperStatus && $ifOperStatus != "" ) {
|
|
||||||
$update .= $seperator . "`ifOperStatus` = '$ifOperStatus'";
|
# if ( $interface['ifOperStatus'] != $ifOperStatus && $ifOperStatus != "" ) {
|
||||||
$seperator = ", ";
|
# $update .= $seperator . "`ifOperStatus` = '$ifOperStatus'";
|
||||||
mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface went $ifOperStatus')");
|
# $seperator = ", ";
|
||||||
}
|
# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface went $ifOperStatus')");
|
||||||
if ( $interface['ifAdminStatus'] != $ifAdminStatus && $ifAdminStatus != "" ) {
|
# }
|
||||||
$update .= $seperator . "`ifAdminStatus` = '$ifAdminStatus'";
|
# if ( $interface['ifAdminStatus'] != $ifAdminStatus && $ifAdminStatus != "" ) {
|
||||||
$seperator = ", ";
|
# $update .= $seperator . "`ifAdminStatus` = '$ifAdminStatus'";
|
||||||
if($ifAdminStatus == "up") { $admin = "enabled"; } else { $admin = "disabled"; }
|
# $seperator = ", ";
|
||||||
mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface $admin')");
|
# if($ifAdminStatus == "up") { $admin = "enabled"; } else { $admin = "disabled"; }
|
||||||
}
|
# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface $admin')");
|
||||||
|
# }
|
||||||
|
|
||||||
if ( $interface['ifDuplex'] != $ifDuplex && $ifDuplex != "" ) {
|
if ( $interface['ifDuplex'] != $ifDuplex && $ifDuplex != "" ) {
|
||||||
$update .= $seperator . "`ifDuplex` = '$ifDuplex'";
|
$update .= $seperator . "`ifDuplex` = '$ifDuplex'";
|
||||||
$seperator = ", ";
|
$seperator = ", ";
|
||||||
|
Reference in New Issue
Block a user