- ');
if (device_permitted($_GET['id']))
{
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(sensor_id) from sensors 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) +
mysql_result(mysql_query("select count(current_id) from current WHERE device_id = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(freq_id) from frequencies WHERE device_id = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(volt_id) from voltage WHERE device_id = '" . $device['device_id'] . "'"), 0) +
mysql_result(mysql_query("select count(fan_id) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"), 0);
if ($health)
{
echo(' -
Health
');
}
if (@mysql_result(mysql_query("select count(app_id) from applications WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0')
{
echo(' -
Apps
');
}
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
');
}
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 ( device_permitted($_GET['id']) && $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(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
');
}
if (device_permitted($_GET['id']))
{
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("
');
## FIXME safe??
include("pages/device/".mres($section).".inc.php");
echo("
");
}
}
else
{
include("includes/error-no-perm.inc.php");
}
?>