fix front page. fix port poller and port descr parser a little.

git-svn-id: http://www.observium.org/svn/observer/trunk@1486 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-26 20:05:14 +00:00
parent 3f2b5982c0
commit 5263fa9238
5 changed files with 27 additions and 27 deletions

View File

@@ -139,11 +139,11 @@ if($_SESSION['userlevel'] >= '5')
if($ports['peering'] && $ports['transit']) {
echo("<div style='width: 235px; '>
<a href='internet/' onmouseover=\"return overlib('\
<img src=\'graph.php?type=multi_bits_duo&ports=".$ports['peering']."&ports_b=".$ports['transit']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multi_bits_duo&ports=".$ports['peering']."&ports_b=".$ports['transit']."&from=".$week."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits_duo&ports=".$ports['peering']."&ports_b=".$ports['transit']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits_duo&ports=".$ports['peering']."&ports_b=".$ports['transit']."&from=".$week."&to=".$now."&width=400&height=150\'>\
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
"<div style='font-size: 16px; font-weight: bold; color: #555555;'>Aggregate Internet Traffic</div>".
"<img src='graph.php?type=multi_bits_duo&ports=".$ports['peering']."&ports_b=".$ports['transit'].
"<img src='graph.php?type=multiport_bits_duo&ports=".$ports['peering']."&ports_b=".$ports['transit'].
"&from=".$day."&to=".$now."&width=385&height=100&legend=no'></a></div>");
}
@@ -154,22 +154,22 @@ if($_SESSION['userlevel'] >= '5')
if($ports['transit']) {
echo("<div style='width: 235px; float: left;'>
<a href='iftype/transit/' onmouseover=\"return overlib('\
<img src=\'graph.php?type=multi_bits&ports=".$ports['transit']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multi_bits&ports=".$ports['transit']."&from=".$week."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['transit']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['transit']."&from=".$week."&to=".$now."&width=400&height=150\'>\
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
"<div style='font-size: 16px; font-weight: bold; color: #555555;'>Internet Transit</div>".
"<img src='graph.php?type=multi_bits&ports=".$ports['transit'].
"<img src='graph.php?type=multiport_bits&ports=".$ports['transit'].
"&from=".$day."&to=".$now."&width=155&height=100&legend=no'></a></div>");
}
if($ports['peering']) {
echo("<div style='width: 235px; float: right;'>
<a href='iftype/peering/' onmouseover=\"return overlib('\
<img src=\'graph.php?type=multi_bits&ports=".$ports['peering']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multi_bits&ports=".$ports['peering']."&from=".$week."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['peering']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['peering']."&from=".$week."&to=".$now."&width=400&height=150\'>\
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
"<div style='font-size: 16px; font-weight: bold; color: #555555;'>Internet Peering</div>".
"<img src='graph.php?type=multi_bits&ports=".$ports['peering'].
"<img src='graph.php?type=multiport_bits&ports=".$ports['peering'].
"&from=".$day."&to=".$now."&width=155&height=100&legend=no'></a></div>");
}
@@ -180,11 +180,11 @@ if($_SESSION['userlevel'] >= '5')
if($ports['broadband'] && $ports['wave_broadband'] && $ports['new_broadband']) {
echo("<div style='width: 466px; '>
<a href='broadband/' onmouseover=\"return overlib('\
<img src=\'graph.php?type=multi_bits_trio&ports=".$ports['broadband']."&ports_b=".$ports['new_broadband']."&ports_c=".$ports['wave_broadband']."&from=".$day."&to=".$now."&width=400&height=150&inverse=c\'>\
<img src=\'graph.php?type=multi_bits_trio&ports=".$ports['broadband']."&ports_b=".$ports['new_broadband']."&ports_c=".$ports['wave_broadband']."&from=".$week."&to=".$now."&width=400&height=150&inverse=c\'>\
<img src=\'graph.php?type=multiport_bits_trio&ports=".$ports['broadband']."&ports_b=".$ports['new_broadband']."&ports_c=".$ports['wave_broadband']."&from=".$day."&to=".$now."&width=400&height=150&inverse=c\'>\
<img src=\'graph.php?type=multiport_bits_trio&ports=".$ports['broadband']."&ports_b=".$ports['new_broadband']."&ports_c=".$ports['wave_broadband']."&from=".$week."&to=".$now."&width=400&height=150&inverse=c\'>\
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
"<div style='font-size: 16px; font-weight: bold; color: #555555;'>Aggregate Broadband Traffic</div>".
"<img src='graph.php?type=multi_bits_trio&ports=".$ports['broadband']."&ports_b=".$ports['new_broadband']."&ports_c=".$ports['wave_broadband'].
"<img src='graph.php?type=multiport_bits_trio&ports=".$ports['broadband']."&ports_b=".$ports['new_broadband']."&ports_c=".$ports['wave_broadband'].
"&from=".$day."&to=".$now."&width=385&height=100&legend=no&inverse=c'></a></div>");
}
@@ -195,11 +195,11 @@ if($_SESSION['userlevel'] >= '5')
if($ports['broadband']) {
echo("<div style='width: 235px; float: left;'>
<a onmouseover=\"return overlib('\
<img src=\'graph.php?type=multi_bits&ports=".$ports['broadband']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multi_bits&ports=".$ports['broadband']."&from=".$week."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['broadband']."&from=".$day."&to=".$now."&width=400&height=150\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['broadband']."&from=".$week."&to=".$now."&width=400&height=150\'>\
', LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
"<div style='font-size: 16px; font-weight: bold; color: #555555;'>Jersey Broadband ATM</div>".
"<img src='graph.php?type=multi_bits&ports=".$ports['broadband'].
"<img src='graph.php?type=multiport_bits&ports=".$ports['broadband'].
"&from=".$day."&to=".$now."&width=155&height=100&legend=no'></a></div>");
}
@@ -208,11 +208,11 @@ if($_SESSION['userlevel'] >= '5')
if($ports['new_broadband']) {
echo("<div style='width: 235px; float: left;'>
<a onmouseover=\"return overlib('\
<img src=\'graph.php?type=multi_bits&ports=".$ports['new_broadband']."&from=".$day."&to=".$now."&width=400&height=150&inverse=0\'>\
<img src=\'graph.php?type=multi_bits&ports=".$ports['new_broadband']."&from=".$week."&to=".$now."&width=400&height=150&inverse=0\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['new_broadband']."&from=".$day."&to=".$now."&width=400&height=150&inverse=0\'>\
<img src=\'graph.php?type=multiport_bits&ports=".$ports['new_broadband']."&from=".$week."&to=".$now."&width=400&height=150&inverse=0\'>\
', LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >".
"<div style='font-size: 16px; font-weight: bold; color: #555555;'>Jersey Broadband NGN</div>".
"<img src='graph.php?type=multi_bits&ports=".$ports['new_broadband']."&from=".$day."&to=".$now."&width=155&height=100&inverse=0&legend=no'></a></div>");
"<img src='graph.php?type=multiport_bits&ports=".$ports['new_broadband']."&from=".$day."&to=".$now."&width=155&height=100&inverse=0&legend=no'></a></div>");
}
echo("</div>");

View File

@@ -136,7 +136,6 @@ $config['billing']['customer_autoadd'] = 0; # Enable Auto-add bill per customer
$config['billing']['circuit_autoadd'] = 0; # Enable Auto-add bill per circuit_id
$config['billing']['bill_autoadd'] = 0; # Enable Auto-add bill per bill_id
### External Integration
#$config['rancid_configs'] = '/var/lib/rancid/network/configs/';

View File

@@ -124,20 +124,18 @@
/// Parse description (usually ifAlias) if config option set
if(isset($config['port_descr_parser']))
if(isset($config['port_descr_parser']) && is_file($config['install_dir'] . "/" . $config['port_descr_parser']))
{
$port_attribs = array('type','descr','circuit','speed','notes');
include($config['port_descr_parser']);
include($config['install_dir'] . "/" . $config['port_descr_parser']);
foreach ($port_attribs as $attrib) {
$attrib_key = "port_descr_".$attrib;
if($port_ifAlias[$attrib])
if($port_ifAlias[$attrib] != $port[$attrib_key])
{
if($port_ifAlias[$attrib] != $port[$attrib_key])
{
$update .= ", `".$attrib_key."` = '".$port_ifAlias[$attrib]."'";
log_event($attrib . ": ".$port[$attrib_key]." -> " . $port_ifAlias[$attrib], $device['device_id'], 'interface', $port['interface_id']);
}
$update .= ", `".$attrib_key."` = '".$port_ifAlias[$attrib]."'";
log_event($attrib . ": ".$port[$attrib_key]." -> " . $port_ifAlias[$attrib], $device['device_id'], 'interface', $port['interface_id']);
}
}
}

View File

@@ -14,6 +14,8 @@
$descr = trim($descr);
if($type && $descr) {
$type = strtolower($type);
$port_ifAlias['type'] = $type;
$port_ifAlias['descr'] = $descr;
$port_ifAlias['circuit'] = $circuit;

View File

@@ -22,6 +22,7 @@ while ($device = mysql_fetch_array($device_query)) {
if(strstr($status, "alive")) {
$pos = shell_exec($config['snmpget'] . " -m SNMPv2-MIB -$snmpver -c $community -t 1 $hostname:$port sysDescr.0");
echo($config['snmpget'] . " -m SNMPv2-MIB -$snmpver -c $community -t 1 $hostname:$port sysDescr.0");
if($pos == '') {
$status='0';
} else {