From 0e64ef858d03190fc6a5a3825a74ac8876bbf8b7 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 7 Aug 2009 16:10:52 +0000 Subject: [PATCH] updates - nice rounded corners on page search git-svn-id: http://www.observium.org/svn/observer/trunk@445 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/bills.php | 56 +++++++++++---------- html/pages/device/ciscosensors.inc.php | 23 ++++++++- html/pages/device/entphysical.inc.php | 1 - html/pages/device/events.inc.php | 5 +- html/pages/device/health.inc.php | 24 ++++++++- html/pages/device/ports.inc.php | 22 ++++++++- html/pages/device/syslog.inc.php | 20 +++++++- html/pages/device/vrfs.inc.php | 23 +++++++-- html/pages/devices.php | 25 ++++++++-- html/pages/interfaces.php | 67 +++++++++++++++++++++----- html/pages/syslog.php | 18 ++++++- includes/functions.php | 26 ++++++++++ includes/rewrites.php | 1 + 13 files changed, 254 insertions(+), 57 deletions(-) diff --git a/html/pages/bills.php b/html/pages/bills.php index bf0d122f0..c6f656f13 100644 --- a/html/pages/bills.php +++ b/html/pages/bills.php @@ -1,33 +1,14 @@ - "); - if($_GET['opta'] == "add") { ?> -
Add Bill
+
Add Bill
-
- - - - - - +
-
- Content -
- - - - - - -
@@ -38,9 +19,21 @@ if($_GET['opta'] == "add") { ?> +
+ + + + + + +
+
+ + + -
Bills
@@ -69,13 +62,24 @@ if($_GET['opta'] == "add") { - Add Add Bill + Add Add Bill
+ +
+
+ + + + + + +
+ - - ".$bill['bill_name']." + ".$bill['bill_name']." $notes $type $allowed @@ -117,9 +121,9 @@ if($_GET['opta'] == "add") { Edit Edit "); + $i++; } echo(""); - $i++; } echo(""); diff --git a/html/pages/device/ciscosensors.inc.php b/html/pages/device/ciscosensors.inc.php index 0cda5aec0..b72a77d1d 100644 --- a/html/pages/device/ciscosensors.inc.php +++ b/html/pages/device/ciscosensors.inc.php @@ -1,6 +1,16 @@ "); +echo("
+ + + + + + +
+
+"); + unset ($sep); $query = mysql_query("SELECT `entSensorType` FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entSensorType != '' AND entSensorType NOT LIKE 'No%' GROUP BY `entSensorType` ORDER BY `entSensorType`"); while($data = mysql_fetch_array($query)) { @@ -13,7 +23,16 @@ $sep = ' | '; } unset ($sep); - echo("
"); + echo("
+
+ + + + + + + +"); $query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$device['device_id']."' and entSensorType = '".$_GET['opta']."' ORDER BY `entPhysicalName`"); while($data = mysql_fetch_array($query)) { diff --git a/html/pages/device/entphysical.inc.php b/html/pages/device/entphysical.inc.php index 57f34098c..025e00750 100644 --- a/html/pages/device/entphysical.inc.php +++ b/html/pages/device/entphysical.inc.php @@ -61,7 +61,6 @@ function printEntPhysical($ent, $level, $class) { } } - echo("

Inventory

"); echo("
Expand All Nodes Collapse All Nodes diff --git a/html/pages/device/events.inc.php b/html/pages/device/events.inc.php index 81818272a..d5e19330c 100644 --- a/html/pages/device/events.inc.php +++ b/html/pages/device/events.inc.php @@ -2,13 +2,10 @@ $query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,250"; $data = mysql_query($query); - echo(""); while($entry = mysql_fetch_array($data)) { - -include("includes/print-event.inc"); - + include("includes/print-event.inc"); } echo("
"); diff --git a/html/pages/device/health.inc.php b/html/pages/device/health.inc.php index 1408e6a04..356a36379 100644 --- a/html/pages/device/health.inc.php +++ b/html/pages/device/health.inc.php @@ -15,7 +15,17 @@ $type_text['cemp'] = "Memory Pools"; $type_text['cpm'] = "Processor Usage"; $type_text['storage'] = "Disk Usage"; - echo("
"); + echo("
+ + + + + + +
+
+"); + unset ($sep); foreach ($datas as $type) { if(!$_GET['opta']) { $_GET['opta'] = $type; } @@ -26,7 +36,17 @@ $type_text['storage'] = "Disk Usage"; $sep = ' | '; } unset ($sep); - echo("
"); + echo("
+
+ + + + + + +
+"); + if(is_file("pages/device/health/".mres($_GET['opta']).".inc.php")) { include("pages/device/health/".mres($_GET['opta']).".inc.php"); } diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php index aec9d01bb..03d2a4054 100644 --- a/html/pages/device/ports.inc.php +++ b/html/pages/device/ports.inc.php @@ -1,6 +1,15 @@ +
+ + + + + + +
+
+ Basic | Details | Graphs: Bits @@ -11,7 +20,16 @@ echo(" (Mini) | Errors (Mini) -
"); +
+
+ + + + + + +
+"); if($_GET['opta'] == graphs ) { if($_GET['optb']) { $graph_type = $_GET['optb']; } else { $graph_type = "bits"; } diff --git a/html/pages/device/syslog.inc.php b/html/pages/device/syslog.inc.php index 0f0cb6318..942757f34 100644 --- a/html/pages/device/syslog.inc.php +++ b/html/pages/device/syslog.inc.php @@ -1,5 +1,13 @@ -
-
+
+ + + + + + +
+
+ @@ -22,6 +30,14 @@
+
+ + + + + + +
+
+ + + + + + +
+
Basic | Graphs : Bits | Packets | NU Packets | Errors -
"); +
+
+ + + + + + +
+ "); echo("
"); - $i = "1"; + $i = "0"; $vrf_query = mysql_query("select * from vrfs WHERE device_id = '".$_GET['id']."' ORDER BY 'vrf_name'"); while($vrf = mysql_fetch_array($vrf_query)) { include("includes/print-vrf.inc"); diff --git a/html/pages/devices.php b/html/pages/devices.php index 96481b623..761d7f036 100644 --- a/html/pages/devices.php +++ b/html/pages/devices.php @@ -1,7 +1,16 @@ -
+
+ + + + + + +
+
+
- + + @@ -75,6 +84,16 @@
+
+ + + + + + + + + - +
+ + + + + + +
+
+ + + - - - - + +
+ + + + Deleted > +
+
+
+ + + + + + +
+ + '0' OR I.`in_errors` > '0' )"; } elseif ($_GET['type'] == "up" || $_POST['state'] == "up") { $where .= "AND I.ifOperStatus = 'up'"; +} elseif ($_GET['type'] == "l2vlan" || $_POST['state'] == "l2vlan") { + $where .= " AND I.ifType = 'l2vlan'"; +} elseif ($_GET['type'] == "ethernet" || $_POST['state'] == "ethernet") { + $where .= " AND I.ifType = 'ethernetCsmacd'"; +} elseif ($_GET['type'] == "loopback" || $_POST['state'] == "loopback") { + $where .= " AND I.ifType = 'softwareLoopback'"; +} elseif ($_GET['typee'] == "sonet" || $_POST['state'] == "sonet") { + $where .= " AND I.ifType = 'sonet'"; +} elseif ($_POST['state'] == "propvirtual") { + $where .= " AND I.ifType = 'propVirtual'"; +} elseif ($_POST['state'] == "ppp") { + $where .= " AND I.ifType = 'ppp'"; } + + if($_POST['device_id']) { $where .= " AND I.device_id = '".$_POST['device_id']."'"; } if($_POST['ifType']) { $where .= " AND I.ifType = '".$_POST['ifType']."'"; } if($_POST['ifSpeed']) { $where .= " AND I.ifSpeed = '".$_POST['ifSpeed']."'"; } @@ -87,7 +131,7 @@ $sql = "SELECT * FROM `interfaces` AS I, `devices` AS D WHERE I.device_id = D.de $query = mysql_query($sql); -echo(""); +echo(""); $row = 1; @@ -105,10 +149,11 @@ while($interface = mysql_fetch_array($query)) { if( interfacepermitted($interface['interface_id']) ) { echo(" - - - - + + + + + \n"); diff --git a/html/pages/syslog.php b/html/pages/syslog.php index a36fa5a9a..439e34a02 100644 --- a/html/pages/syslog.php +++ b/html/pages/syslog.php @@ -1,5 +1,13 @@ -
+
+ + + + + + +
+
+
+ + + + + + +
"); } +function retireHost($id) +{ + global $config; + $host = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '$id'"), 0); + mysql_query("DELETE FROM `devices` WHERE `device_id` = '$id'"); + $int_query = mysql_query("SELECT * FROM `interfaces` WHERE `device_id` = '$id'"); + while($int_data = mysql_fetch_array($int_query)) { + $int_if = $int_data['ifDescr']; + $int_id = $int_data['interface_id']; + mysql_query("DELETE from `adjacencies` WHERE `interface_id` = '$int_id'"); + mysql_query("DELETE from `links` WHERE `src_if` = '$int_id'"); + mysql_query("DELETE from `links` WHERE `dst_if` = '$int_id'"); + mysql_query("DELETE from `ipaddr` WHERE `interface_id` = '$int_id'"); + mysql_query("DELETE from `ip6adjacencies` WHERE `interface_id` = '$int_id'"); + mysql_query("DELETE from `ip6addr` WHERE `interface_id` = '$int_id'"); + mysql_query("DELETE from `pseudowires` WHERE `interface_id` = '$int_id'"); + echo("Removed interface $int_id ($int_if)
"); + } + mysql_query("DELETE FROM `entPhysical` WHERE `device_id` = '$id'"); + mysql_query("DELETE FROM `temperature` WHERE `temp_host` = '$id'"); + mysql_query("DELETE FROM `storage` WHERE `host_id` = '$id'"); + mysql_query("DELETE FROM `alerts` WHERE `device_id` = '$id'"); + mysql_query("DELETE FROM `services` WHERE `service_host` = '$id'"); + shell_exec("rm -rf ".$config['rrd_dir']."/$host"); + echo("Removed device $host
"); +} function addHost($host, $community, $snmpver, $port = 161) { diff --git a/includes/rewrites.php b/includes/rewrites.php index 6e74b2546..bd88eae1d 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -118,6 +118,7 @@ $rewrite_ios_features = array( 'dialer' => 'Di', 'vlan' => 'Vlan', 'tunnel' => 'Tunnel', + 'serviceinstance' => 'SI', ); $rewrite_iftype = array (
DeviceInterfaceSpeedMediaDescription
DeviceInterfaceSpeedMediaDescription
" . generatedevicelink($interface) . "" . generateiflink($interface, makeshortif(fixifname($interface['ifDescr']))) . " $error_img$speed$type" . generatedevicelink($interface) . "" . generateiflink($interface, makeshortif(fixifname($interface['ifDescr']))) . " $error_img$speed$type " . $interface['ifAlias'] . "