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@436 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -18,10 +18,8 @@ if($argv[1] && $argv[2] && $argv[3]) {
|
||||
if ( isPingable($argv[1])) {
|
||||
if ( mysql_result(mysql_query("SELECT COUNT(*) FROM `devices` WHERE `hostname` = '".mres($host)."'"), 0) == '0' ) {
|
||||
$snmphost = trim(str_replace("\"", "", shell_exec($config['snmpget'] ." -m SNMPv2-MIB -Oqv -$snmpver -c $community $host:$port sysName.0")));
|
||||
# var_dump($snmphost);
|
||||
if ($snmphost == $host || $hostshort = $host) {
|
||||
$return = createHost ($host, $community, $snmpver, $port);
|
||||
# var_dump($return);
|
||||
if($return) { echo($return . "\n"); } else { echo("Adding $host failed\n"); }
|
||||
} else { echo("Given hostname does not match SNMP-read hostname!\n"); }
|
||||
} else { echo("Already got host $host\n"); }
|
||||
|
@@ -17,6 +17,11 @@ RewriteRule ^devices/(.+)/ ?page=devices&type=$1
|
||||
|
||||
RewriteRule ^interfaces/(.+)/ ?page=interfaces&type=$1
|
||||
|
||||
RewriteRule ^vrf/(.+)/(.+)/(.+)/ ?page=vrf&id=$1&opta=$2&optb=$3
|
||||
RewriteRule ^vrf/(.+)/(.+)/ ?page=vrf&id=$1&opta=$2
|
||||
RewriteRule ^vrf/(.+)/ ?page=vrf&id=$1
|
||||
|
||||
|
||||
RewriteRule ^bill/([0-9]+) ?page=bills&bill=$1
|
||||
|
||||
RewriteRule ^device/([0-9]+)/([a-z]+)/(.+)/(.+)/ ?page=device&id=$1§ion=$2&opta=$3&optb=$4
|
||||
@@ -26,5 +31,5 @@ RewriteRule ^device/([0-9]+) ?page=device&id=$1
|
||||
|
||||
RewriteRule ^([a-z]+)/$ ?page=$1
|
||||
|
||||
RewriteRule ^([a-z]+)/([a-z]+)/$ ?page=$1&view=$2
|
||||
RewriteRule ^([a-z]+)/(.+)/$ ?page=$1&opta=$2
|
||||
|
||||
|
@@ -11,10 +11,10 @@
|
||||
$image = getImage($device['device_id']);
|
||||
|
||||
echo("
|
||||
<tr >
|
||||
<tr bgcolor=$device_colour>
|
||||
<td width='40' align=center valign=middle>$image</td>
|
||||
<td valign=middle><span style='font-weight: bold; font-size: 20px;'>" . generatedevicelink($device) . "</span>
|
||||
<br />" . $device['purpose'] . "</td>
|
||||
<br />" . $device['location'] . "</td>
|
||||
<td></td>
|
||||
</tr>");
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
# $ifHardType = $interface['ifHardType'];
|
||||
|
||||
if($bg == "#e5e5e5") { $bg = "#ffffff"; } else { $bg="#e5e5e5"; }
|
||||
if($int_colour) { $bg = $int_colour; }
|
||||
|
||||
if($interface['in_errors'] > 0 || $interface['out_errors'] > 0) {
|
||||
$error_img = generateiflink($interface,"<img src='images/16/chart_curve_error.png' alt='Interface Errors' border=0>",errors);
|
||||
|
@@ -134,10 +134,11 @@ if($config['enable_pseudowires']) { echo("<li><a href='vrfs/'><img src='images/1
|
||||
if($_SESSION['userlevel'] >= '5') {
|
||||
echo("<li><hr width=140 /></li>");
|
||||
if($config['int_customers']) { echo("<li><a href='customers/'><img src='images/16/group_link.png' border=0 align=absmiddle> Customers</a></li>"); $ifbreak = 1;}
|
||||
if($config['int_l2tp']) { echo("<li><a href='?page=iftype&type=l2tp'><img src='images/16/user.png'border=0 align=absmiddle> L2TP</a></li>"); $ifbreak = 1; }
|
||||
if($config['int_transit']) { echo("<li><a href='?page=iftype&type=transit'><img src='images/16/world_link.png' border=0 align=absmiddle> Transit</a></li>"); $ifbreak = 1; }
|
||||
if($config['int_peering']) { echo("<li><a href='?page=iftype&type=peering'><img src='images/16/bug_link.png' border=0 align=absmiddle> Peering</a></li>"); $ifbreak = 1; }
|
||||
if($config['int_core']) { echo("<li><a href='?page=iftype&type=core'><img src='images/16/brick_link.png' border=0 align=absmiddle> Core</a></li>"); $ifbreak = 1;}
|
||||
if($config['int_l2tp']) { echo("<li><a href='iftype/l2tp/'><img src='images/16/user.png'border=0 align=absmiddle> L2TP</a></li>"); $ifbreak = 1; }
|
||||
if($config['int_transit']) { echo("<li><a href='iftype/transit/'><img src='images/16/lorry_link.png' border=0 align=absmiddle> Transit</a></li>"); $ifbreak = 1; }
|
||||
if($config['int_peering']) { echo("<li><a href='iftype/peering/'><img src='images/16/bug_link.png' border=0 align=absmiddle> Peering</a></li>"); $ifbreak = 1; }
|
||||
if($config['int_peering'] && $config['int_transit']) { echo("<li><a href='iftype/peering,transit/'><img src='images/16/world_link.png' border=0 align=absmiddle> Peer + Transit</a></li>"); $ifbreak = 1; }
|
||||
if($config['int_core']) { echo("<li><a href='iftype/core/'><img src='images/16/brick_link.png' border=0 align=absmiddle> Core</a></li>"); $ifbreak = 1;}
|
||||
}
|
||||
|
||||
if($ifbreak) { echo("<li><hr width=140 /></li>"); }
|
||||
|
@@ -4,7 +4,7 @@ if(is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_
|
||||
|
||||
echo("<tr bgcolor='$bg_colour'>");
|
||||
|
||||
echo("<td class=list-large> " . $vrf['vrf_name'] . "</td>");
|
||||
echo("<td class=list-large><a href='vrf/".$vrf['mplsVpnVrfRouteDistinguisher']."/'>" . $vrf['vrf_name'] . "</a></td>");
|
||||
echo("<td class=box-desc>" . $vrf['mplsVpnVrfDescription'] . "</td>");
|
||||
echo("<td class=box-desc>" . $vrf['mplsVpnVrfRouteDistinguisher'] . "</td>");
|
||||
|
||||
|
@@ -4,11 +4,11 @@
|
||||
|
||||
$i = "1";
|
||||
|
||||
if($_GET['view'] == "alerts") {
|
||||
if($_GET['opta'] == "alerts") {
|
||||
$where = "AND B.bgpPeerAdminStatus = 'start' AND B.bgpPeerState != 'established'";
|
||||
} elseif ($_GET['view'] == "external") {
|
||||
} elseif ($_GET['opta'] == "external") {
|
||||
$where = "AND D.bgpLocalAs != B.bgpPeerRemoteAs";
|
||||
} elseif ($_GET['view'] == "internal") {
|
||||
} elseif ($_GET['opta'] == "internal") {
|
||||
$where = "AND D.bgpLocalAs = B.bgpPeerRemoteAs";
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,8 @@ echo("<li class=" . $select['graphs'] . ">
|
||||
</li>
|
||||
");
|
||||
|
||||
$health = mysql_result(mysql_query("select count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"), 0) +
|
||||
$health = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) +
|
||||
mysql_result(mysql_query("select count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"), 0) +
|
||||
mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0) +
|
||||
mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0);
|
||||
|
||||
|
@@ -2,10 +2,16 @@
|
||||
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
||||
echo("<table cellpadding=7 cellspacing=0 class=devicetable width=100%>");
|
||||
|
||||
if($_GET['type']) {
|
||||
#if($_GET['type']) {
|
||||
|
||||
$type = $_GET['type'];
|
||||
$sql = "select * from interfaces as I, devices as D WHERE `ifAlias` like '$type: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
|
||||
$type_where = " (";
|
||||
foreach(split(",", $_GET['opta']) as $type) {
|
||||
$type_where .= " $or `ifAlias` like '$type: %' ";
|
||||
$or = "OR";
|
||||
}
|
||||
$type_where .= ") ";
|
||||
|
||||
$sql = "select * from interfaces as I, devices as D WHERE $type_where AND I.device_id = D.device_id ORDER BY I.ifAlias";
|
||||
$query = mysql_query($sql);
|
||||
while($interface = mysql_fetch_array($query)) {
|
||||
$if_list .= $seperator . $interface['interface_id'];
|
||||
@@ -14,7 +20,7 @@ if($_GET['type']) {
|
||||
unset($seperator);
|
||||
|
||||
echo("<tr bgcolor='$bg'>
|
||||
<td><span class=list-large>Total Graph for interfaces of type : ".$type."</span></td></tr>");
|
||||
<td><span class=list-large>Total Graph for interfaces of type : ".$_GET['opta']."</span></td></tr>");
|
||||
|
||||
echo("<tr bgcolor='$bg'><td>");
|
||||
$graph_type = "multi_bits";
|
||||
@@ -23,7 +29,7 @@ if($_GET['type']) {
|
||||
echo("</td></tr>");
|
||||
|
||||
|
||||
$sql = "select * from interfaces as I, devices as D WHERE `ifAlias` like '$type: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
|
||||
$sql = "select * from interfaces as I, devices as D WHERE $type_where AND I.device_id = D.device_id ORDER BY I.ifAlias";
|
||||
$query = mysql_query($sql);
|
||||
while($interface = mysql_fetch_array($query)) {
|
||||
$done = "yes";
|
||||
@@ -51,7 +57,7 @@ if(file_exists($config['rrd_dir'] . "/" . $interface['hostname'] . "/" . $interf
|
||||
}
|
||||
echo("</td></tr>");
|
||||
}
|
||||
}
|
||||
#}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
echo("<tr valign=top bgcolor='$bg_colour'>");
|
||||
|
||||
echo("<td width=200 class=list-large>" . $vrf['vrf_name'] . "</td>");
|
||||
echo("<td width=200 class=list-large><a href='vrf/".$vrf['mplsVpnVrfRouteDistinguisher']."/'>" . $vrf['vrf_name'] . "</a></td>");
|
||||
echo("<td width=100 class=box-desc>" . $vrf['mplsVpnVrfRouteDistinguisher'] . "</td>");
|
||||
|
||||
echo("<td width=200 class=box-desc>" . $vrf['mplsVpnVrfDescription'] . "</td>");
|
||||
|
@@ -33,7 +33,7 @@
|
||||
echo("+");
|
||||
} else { echo("."); }
|
||||
|
||||
$full_address = "$oid/$cidr";
|
||||
$full_address = "$oid/$cidr|$ifIndex";
|
||||
$valid_v4[$full_address] = 1;
|
||||
|
||||
} else { echo("!"); }
|
||||
@@ -43,7 +43,7 @@
|
||||
$sql = "SELECT * FROM ipv4_addresses AS A, interfaces AS I WHERE I.device_id = '".$device['device_id']."' AND A.interface_id = I.interface_id";
|
||||
$data = mysql_query($sql);
|
||||
while($row = mysql_fetch_array($data)) {
|
||||
$full_address = $row['ipv4_address'] . "/" . $row['ipv4_prefixlen'];
|
||||
$full_address = $row['ipv4_address'] . "/" . $row['ipv4_prefixlen'] . "|" . $row['ifIndex'];
|
||||
if(!$valid_v4[$full_address]) {
|
||||
echo("-");
|
||||
$query = @mysql_query("DELETE FROM `ipv4_addresses` WHERE `ipv4_address_id` = '".$row['ipv4_address_id']."'");
|
||||
|
@@ -23,7 +23,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
echo("$fstype\n");
|
||||
# echo("$fstype\n");
|
||||
|
||||
if(strstr($fstype, "FixedDisk") && $size > '0' && $allow) {
|
||||
if(mysql_result(mysql_query("SELECT count(storage_id) FROM `storage` WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'"),0) == '0') {
|
||||
|
@@ -400,6 +400,7 @@ function graph_bits ($rrd, $graph, $from, $to, $width, $height, $title, $vertica
|
||||
$options .= " LINE1:d95thout#aa0000";
|
||||
} else {
|
||||
$options .= " AREA:inbits_max#aDEB7B:";
|
||||
$options .= " AREA:inbits#CDEB8B:";
|
||||
$options .= " COMMENT:BPS\ \ \ \ Current\ \ \ Average\ \ \ \ \ \ Max\ \ \ 95th\ %\\\\n";
|
||||
$options .= " LINE1.25:inbits#006600:In\ ";
|
||||
$options .= " GPRINT:inbits:LAST:%6.2lf%s";
|
||||
@@ -407,6 +408,7 @@ function graph_bits ($rrd, $graph, $from, $to, $width, $height, $title, $vertica
|
||||
$options .= " GPRINT:inbits_max:MAX:%6.2lf%s";
|
||||
$options .= " GPRINT:95thin:%6.2lf%s\\\\n";
|
||||
$options .= " AREA:doutbits_max#a3b9FF:";
|
||||
$options .= " AREA:doutbits#C3D9FF:";
|
||||
$options .= " LINE1.25:doutbits#000099:Out";
|
||||
$options .= " GPRINT:outbits:LAST:%6.2lf%s";
|
||||
$options .= " GPRINT:outbits:AVERAGE:%6.2lf%s";
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -39,10 +39,13 @@ if ($argv[2] == "--type" && $argv[3]) {
|
||||
|
||||
$devices_polled = 0;
|
||||
|
||||
echo("includes/discovery/".$type.".php \n");
|
||||
|
||||
|
||||
$device_query = mysql_query("SELECT * FROM `devices` WHERE status = '1' $where ORDER BY device_id ASC");
|
||||
while ($device = mysql_fetch_array($device_query)) {
|
||||
|
||||
echo("includes/discovery/".$type.".php");
|
||||
echo($device['hostname'] . "(".$device['sysName'].")\n");
|
||||
|
||||
include("includes/discovery/".$type.".php");
|
||||
|
||||
|
Reference in New Issue
Block a user