From 1a1750b0c3fb4f8f5dae1e8dcf4f9da00667a8fb Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sat, 10 Jul 2010 12:52:04 +0000 Subject: [PATCH] inc.php plx git-svn-id: http://www.observium.org/svn/observer/trunk@1336 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/{about.php => about.inc.php} | 0 html/pages/{addhost.php => addhost.inc.php} | 0 html/pages/{addsrv.php => addsrv.inc.php} | 0 html/pages/{adduser.php => adduser.inc.php} | 0 html/pages/{alerts.php => alerts.inc.php} | 0 html/pages/{authlog.php => authlog.inc.php} | 0 html/pages/{bgp.php => bgp.inc.php} | 0 html/pages/{bill.php => bill.inc.php} | 0 html/pages/{bills.php => bills.inc.php} | 0 ...onfiguration.php => configuration.inc.php} | 0 .../{customers.php => customers.inc.php} | 0 html/pages/default-jt.php | 211 ------------------ html/pages/{delsrv.php => delsrv.inc.php} | 0 html/pages/{deluser.php => deluser.inc.php} | 0 html/pages/{device.php => device.inc.php} | 0 html/pages/{devices.php => devices.inc.php} | 0 html/pages/{edituser.php => edituser.inc.php} | 0 html/pages/{eventlog.php => eventlog.inc.php} | 0 html/pages/{health.php => health.inc.php} | 0 html/pages/{iftype.php => iftype.inc.php} | 0 .../{inventory.php => inventory.inc.php} | 0 html/pages/{ipv4.php => ipv4.inc.php} | 0 html/pages/{ipv6.php => ipv6.inc.php} | 0 html/pages/{list.php => list.inc.php} | 0 .../{locations.php => locations.inc.php} | 0 html/pages/{logon.inc => logon.inc.php} | 0 html/pages/{ports.php => ports.inc.php} | 0 .../{preferences.php => preferences.inc.php} | 0 .../{pseudowires.php => pseudowires.inc.php} | 0 .../{purgeports.php => purgeports.inc.php} | 0 html/pages/{services.php => services.inc.php} | 0 html/pages/{storage.php => storage.inc.php} | 0 html/pages/{syslog.php => syslog.inc.php} | 0 html/pages/{vrf.php => vrf.inc.php} | 0 html/pages/{vrfs.php => vrfs.inc.php} | 0 35 files changed, 211 deletions(-) rename html/pages/{about.php => about.inc.php} (100%) rename html/pages/{addhost.php => addhost.inc.php} (100%) rename html/pages/{addsrv.php => addsrv.inc.php} (100%) rename html/pages/{adduser.php => adduser.inc.php} (100%) rename html/pages/{alerts.php => alerts.inc.php} (100%) rename html/pages/{authlog.php => authlog.inc.php} (100%) rename html/pages/{bgp.php => bgp.inc.php} (100%) rename html/pages/{bill.php => bill.inc.php} (100%) rename html/pages/{bills.php => bills.inc.php} (100%) rename html/pages/{configuration.php => configuration.inc.php} (100%) rename html/pages/{customers.php => customers.inc.php} (100%) delete mode 100644 html/pages/default-jt.php rename html/pages/{delsrv.php => delsrv.inc.php} (100%) rename html/pages/{deluser.php => deluser.inc.php} (100%) rename html/pages/{device.php => device.inc.php} (100%) rename html/pages/{devices.php => devices.inc.php} (100%) rename html/pages/{edituser.php => edituser.inc.php} (100%) rename html/pages/{eventlog.php => eventlog.inc.php} (100%) rename html/pages/{health.php => health.inc.php} (100%) rename html/pages/{iftype.php => iftype.inc.php} (100%) rename html/pages/{inventory.php => inventory.inc.php} (100%) rename html/pages/{ipv4.php => ipv4.inc.php} (100%) rename html/pages/{ipv6.php => ipv6.inc.php} (100%) rename html/pages/{list.php => list.inc.php} (100%) rename html/pages/{locations.php => locations.inc.php} (100%) rename html/pages/{logon.inc => logon.inc.php} (100%) rename html/pages/{ports.php => ports.inc.php} (100%) rename html/pages/{preferences.php => preferences.inc.php} (100%) rename html/pages/{pseudowires.php => pseudowires.inc.php} (100%) rename html/pages/{purgeports.php => purgeports.inc.php} (100%) rename html/pages/{services.php => services.inc.php} (100%) rename html/pages/{storage.php => storage.inc.php} (100%) rename html/pages/{syslog.php => syslog.inc.php} (100%) rename html/pages/{vrf.php => vrf.inc.php} (100%) rename html/pages/{vrfs.php => vrfs.inc.php} (100%) diff --git a/html/pages/about.php b/html/pages/about.inc.php similarity index 100% rename from html/pages/about.php rename to html/pages/about.inc.php diff --git a/html/pages/addhost.php b/html/pages/addhost.inc.php similarity index 100% rename from html/pages/addhost.php rename to html/pages/addhost.inc.php diff --git a/html/pages/addsrv.php b/html/pages/addsrv.inc.php similarity index 100% rename from html/pages/addsrv.php rename to html/pages/addsrv.inc.php diff --git a/html/pages/adduser.php b/html/pages/adduser.inc.php similarity index 100% rename from html/pages/adduser.php rename to html/pages/adduser.inc.php diff --git a/html/pages/alerts.php b/html/pages/alerts.inc.php similarity index 100% rename from html/pages/alerts.php rename to html/pages/alerts.inc.php diff --git a/html/pages/authlog.php b/html/pages/authlog.inc.php similarity index 100% rename from html/pages/authlog.php rename to html/pages/authlog.inc.php diff --git a/html/pages/bgp.php b/html/pages/bgp.inc.php similarity index 100% rename from html/pages/bgp.php rename to html/pages/bgp.inc.php diff --git a/html/pages/bill.php b/html/pages/bill.inc.php similarity index 100% rename from html/pages/bill.php rename to html/pages/bill.inc.php diff --git a/html/pages/bills.php b/html/pages/bills.inc.php similarity index 100% rename from html/pages/bills.php rename to html/pages/bills.inc.php diff --git a/html/pages/configuration.php b/html/pages/configuration.inc.php similarity index 100% rename from html/pages/configuration.php rename to html/pages/configuration.inc.php diff --git a/html/pages/customers.php b/html/pages/customers.inc.php similarity index 100% rename from html/pages/customers.php rename to html/pages/customers.inc.php diff --git a/html/pages/default-jt.php b/html/pages/default-jt.php deleted file mode 100644 index fb3dec26f..000000000 --- a/html/pages/default-jt.php +++ /dev/null @@ -1,211 +0,0 @@ - - $content -"); - - -# echo("
-# -# -# -# -# -# -#
-# ".$content." -#
-# -# -# -# -# -# -#
"); -} - -echo("
"); - -$sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'"); -while($device = mysql_fetch_array($sql)){ - - generate_front_box("alert", "
".generatedevicelink($device, shorthost($device['hostname']))."
- Device Down - ".truncate($device['location'], 20)." -
"); - - -} - -$sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'"); -while($interface = mysql_fetch_array($sql)){ - - generate_front_box("warn", "
".generatedevicelink($interface, shorthost($interface['hostname']))."
- Port Down - - ".generateiflink($interface, makeshortif($interface['ifDescr']))."
- ".truncate($interface['ifAlias'], 20)." -
"); - -} - -$sql = mysql_query("SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'"); -while($service = mysql_fetch_array($sql)){ - - - generate_front_box("alert", "
".generatedevicelink($service, shorthost($service['hostname']))."
- Service Down - ".$service['service_type']."
- ".truncate($interface['ifAlias'], 20)." -
"); - -} - -$sql = mysql_query("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerState != 'established' AND B.device_id = D.device_id"); -while($peer = mysql_fetch_array($sql)){ - - generate_front_box("alert", "
".generatedevicelink($peer, shorthost($peer['hostname']))."
- BGP Down - ".$peer['bgpPeerIdentifier']."
- AS".$peer['bgpPeerRemoteAs']." ".truncate($peer['astext'], 10)." -
"); - -} - -$sql = mysql_query("SELECT * FROM `devices` AS D, devices_attribs AS A WHERE A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value < '84600'"); -while($device = mysql_fetch_array($sql)){ - - - generate_front_box("info", "
".generatedevicelink($device, shorthost($device['hostname']))."
- Device
Rebooted

- ".formatUptime($device['attrib_value'], 'short')." -
"); - -} - -if($config['frontpage_display'] == 'syslog') { - - ## Open Syslog Div - echo("
-

Recent Syslog Messages

- "); - - $sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog ORDER BY timestamp DESC LIMIT 20"; - $query = mysql_query($sql); - echo(""); - while($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); } - echo("
"); - - echo("
"); ## Close Syslog Div - -} else { - - ## Open eventlog Div - echo("
-

Recent Eventlog Entries

- "); - -if($_SESSION['userlevel'] == '10') { - $query = "SELECT *,DATE_FORMAT(datetime, '%D %b %T') as humandate FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15"; -} else { - $query = "SELECT *,DATE_FORMAT(datetime, '%D %b %T') as humandate FROM `eventlog` AS E, devices_perms AS P WHERE E.host = - P.device_id AND P.user_id = " . $_SESSION['user_id'] . " ORDER BY `datetime` DESC LIMIT 0,15"; -} - -$data = mysql_query($query); - -echo(""); - -while($entry = mysql_fetch_array($data)) { - include("includes/print-event.inc"); -} - -echo("
"); - - - echo("
"); ## Close Syslog Div - - -} - -echo("
"); - -echo("
- - - - - - - -
"); - -/// this stuff can be customised to show whatever you want.... - -if($_SESSION['userlevel'] >= '5') { - - $sql = "select * from ports as I, devices as D WHERE `ifAlias` like 'Peering: %' AND I.device_id = D.device_id AND D.hostname LIKE '%"; - $sql .= $config['mydomain'] . "' ORDER BY I.ifAlias"; - $query = mysql_query($sql); - unset ($seperator); - while($interface = mysql_fetch_array($query)) { - $ports['peering'] .= $seperator . $interface['interface_id']; - $seperator = ","; - } - - $sql = "select * from ports as I, devices as D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id ORDER BY I.ifAlias"; - $query = mysql_query($sql); - unset ($seperator); - while($interface = mysql_fetch_array($query)) { - $ports['transit'] .= $seperator . $interface['interface_id']; - $seperator = ","; - } - - $ports['broadband'] = "2490,2509"; - $ports['wave_broadband'] = "2098"; - - if($ports['transit']) { - echo("', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >". - "
Internet Transit
". - "
"); - } - - if($ports['broadband']) { - echo("', LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >". - "
Broadband
". - "
"); - } - - if($ports['wave_broadband']) { - echo("', LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >". - "
Wave Broadhand
". - "
"); - } - -} - -echo("
- - - - - - - -
-"); - -#echo(""); - -/// END VOSTRON - -#} - -?> diff --git a/html/pages/delsrv.php b/html/pages/delsrv.inc.php similarity index 100% rename from html/pages/delsrv.php rename to html/pages/delsrv.inc.php diff --git a/html/pages/deluser.php b/html/pages/deluser.inc.php similarity index 100% rename from html/pages/deluser.php rename to html/pages/deluser.inc.php diff --git a/html/pages/device.php b/html/pages/device.inc.php similarity index 100% rename from html/pages/device.php rename to html/pages/device.inc.php diff --git a/html/pages/devices.php b/html/pages/devices.inc.php similarity index 100% rename from html/pages/devices.php rename to html/pages/devices.inc.php diff --git a/html/pages/edituser.php b/html/pages/edituser.inc.php similarity index 100% rename from html/pages/edituser.php rename to html/pages/edituser.inc.php diff --git a/html/pages/eventlog.php b/html/pages/eventlog.inc.php similarity index 100% rename from html/pages/eventlog.php rename to html/pages/eventlog.inc.php diff --git a/html/pages/health.php b/html/pages/health.inc.php similarity index 100% rename from html/pages/health.php rename to html/pages/health.inc.php diff --git a/html/pages/iftype.php b/html/pages/iftype.inc.php similarity index 100% rename from html/pages/iftype.php rename to html/pages/iftype.inc.php diff --git a/html/pages/inventory.php b/html/pages/inventory.inc.php similarity index 100% rename from html/pages/inventory.php rename to html/pages/inventory.inc.php diff --git a/html/pages/ipv4.php b/html/pages/ipv4.inc.php similarity index 100% rename from html/pages/ipv4.php rename to html/pages/ipv4.inc.php diff --git a/html/pages/ipv6.php b/html/pages/ipv6.inc.php similarity index 100% rename from html/pages/ipv6.php rename to html/pages/ipv6.inc.php diff --git a/html/pages/list.php b/html/pages/list.inc.php similarity index 100% rename from html/pages/list.php rename to html/pages/list.inc.php diff --git a/html/pages/locations.php b/html/pages/locations.inc.php similarity index 100% rename from html/pages/locations.php rename to html/pages/locations.inc.php diff --git a/html/pages/logon.inc b/html/pages/logon.inc.php similarity index 100% rename from html/pages/logon.inc rename to html/pages/logon.inc.php diff --git a/html/pages/ports.php b/html/pages/ports.inc.php similarity index 100% rename from html/pages/ports.php rename to html/pages/ports.inc.php diff --git a/html/pages/preferences.php b/html/pages/preferences.inc.php similarity index 100% rename from html/pages/preferences.php rename to html/pages/preferences.inc.php diff --git a/html/pages/pseudowires.php b/html/pages/pseudowires.inc.php similarity index 100% rename from html/pages/pseudowires.php rename to html/pages/pseudowires.inc.php diff --git a/html/pages/purgeports.php b/html/pages/purgeports.inc.php similarity index 100% rename from html/pages/purgeports.php rename to html/pages/purgeports.inc.php diff --git a/html/pages/services.php b/html/pages/services.inc.php similarity index 100% rename from html/pages/services.php rename to html/pages/services.inc.php diff --git a/html/pages/storage.php b/html/pages/storage.inc.php similarity index 100% rename from html/pages/storage.php rename to html/pages/storage.inc.php diff --git a/html/pages/syslog.php b/html/pages/syslog.inc.php similarity index 100% rename from html/pages/syslog.php rename to html/pages/syslog.inc.php diff --git a/html/pages/vrf.php b/html/pages/vrf.inc.php similarity index 100% rename from html/pages/vrf.php rename to html/pages/vrf.inc.php diff --git a/html/pages/vrfs.php b/html/pages/vrfs.inc.php similarity index 100% rename from html/pages/vrfs.php rename to html/pages/vrfs.inc.php