- ');
if($config['show_overview_tab']) {
echo("
-
Overview
");
}
echo(' -
Graphs
');
$health = mysql_result(mysql_query("select count(*) from storage WHERE device_id = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(temp_id) from temperature WHERE device_id = '" . $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) +
mysql_result(mysql_query("select count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"), 0);
if($health) {
echo(' -
Health
');
}
### This needs to die, rolled into generic sensors! (still need to implement booleans, tx/rx powers and currents)
#$cisco_sensors = mysql_result(mysql_query("SELECT count(*) FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entSensorType != '' AND entSensorType NOT LIKE 'No%'"),0);
#if($cisco_sensors) {
# echo(' -
#
#
Sensors # #
');
#}
if(is_dir($config['collectd_dir'] . "/" . $device['hostname'] ."/")) {
echo(' -
CollectD
');
}
if(@mysql_result(mysql_query("select count(interface_id) from ports WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
echo(' -
Ports
');
}
if(@mysql_result(mysql_query("select count(vlan_id) from vlans WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
echo(' -
VLANs
');
}
if(@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
echo(' -
VRFs
');
}
if($config['enable_bgp'] && $device['bgpLocalAs']) {
echo(' -
BGP
');
}
### This probably needs to die? DEATH TO NAGIOS!
#if(@mysql_result(mysql_query("SELECT count(*) FROM nagios_hosts WHERE address = '".$device['hostname']."'", $nagios_link), 0) > '0') {
# echo(' -
#
#
Nagios # #
');
#}
if($_SESSION['userlevel'] >= "5" && mysql_result(mysql_query("SELECT count(*) FROM links AS L, ports AS I WHERE I.device_id = '".$device['device_id']."' AND I.interface_id = L.local_interface_id"),0)) {
echo(' -
Map
');
}
if($config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
echo(' -
Inventory
');
} elseif ( $config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `hrDevice` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
echo(' -
Inventory
');
}
#if(mysql_result(mysql_query("select count(storage_id) from storage WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
# echo("
# -
#
#
Storage # #
#");
#}
if(mysql_result(mysql_query("select count(service_id) from services WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
echo(' -
Services
');
}
if(@mysql_result(mysql_query("select count(toner_id) from toner WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') {
echo(' -
Toner
');
}
echo(' -
Events
');
if($config['enable_syslog']) {
echo(' -
Syslog
');
}
if($_SESSION['userlevel'] >= "7") {
if(!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
foreach($config['rancid_configs'] as $configs) {
if ($configs[strlen($configs)-1] != '/') { $configs .= '/'; }
if(is_file($configs . $device['hostname'])) { $device_config_file = $configs . $device['hostname']; }
}
}
if($device_config_file) {
echo(' -
Config
');
}
if($_SESSION['userlevel'] >= "7") {
echo(' -
Settings
');
}
echo("
');
include("pages/device/".mres($section).".inc.php");
echo("
");
}
} else { include("includes/error-no-perm-dev.inc.php"); }
?>