graphing improvements

git-svn-id: http://www.observium.org/svn/observer/trunk@427 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-05-07 13:47:51 +00:00
parent 586de53358
commit cf1e2830cf
6 changed files with 170 additions and 154 deletions
+105 -70
View File
@@ -1,69 +1,104 @@
<?php
$rewrite_entSensorType = array (
'celsius' => 'C',
'unknown' => '',
'specialEnum' => 'C',
'watts' => 'W',
'truthvalue' => '',
);
$translate_ifOperStatus = array(
"1" => "up",
"2" => "down",
"3" => "testing",
"4" => "unknown",
"5" => "dormant",
"6" => "notPresent",
"7" => "lowerLayerDown",
);
function translate_ifOperStatus ($ifOperStatus) {
global $translate_ifOperStatus;
if($translate_ifOperStatus['$ifOperStatus']) {
$ifOperStatus = $translate_ifOperStatus['$ifOperStatus'];
}
return $ifOperStatus;
function entPhysical_scale($value, $scale) {
switch ($scale) {
case "nano":
$value = $value / 1000000000;
break;
case "micro":
$value = $value / 1000000;
break;
case "milli":
$value = $value / 1000;
break;
case "units":
break;
case "kilo":
$value = $value * 1000;
break;
case "mega":
$value = $value * 1000000;
break;
case "giga":
$value = $value * 1000000000;
break;
}
$translate_ifAdminStatus = array(
"1" => "up",
"2" => "down",
"3" => "testing",
);
return $value;
function translate_ifAdminStatus ($ifAdminStatus) {
global $translate_ifAdminStatus;
if($translate_ifAdminStatus['$ifAdminStatus']) {
$ifAdminStatus = $translate_ifAdminStatus['$ifAdminStatus'];
}
return $ifAdminStatus;
}
$translate_ifOperStatus = array(
"1" => "up",
"2" => "down",
"3" => "testing",
"4" => "unknown",
"5" => "dormant",
"6" => "notPresent",
"7" => "lowerLayerDown",
);
function translate_ifOperStatus ($ifOperStatus) {
global $translate_ifOperStatus;
if($translate_ifOperStatus['$ifOperStatus']) {
$ifOperStatus = $translate_ifOperStatus['$ifOperStatus'];
}
return $ifOperStatus;
}
$translate_ifAdminStatus = array(
"1" => "up",
"2" => "down",
"3" => "testing",
);
function translate_ifAdminStatus ($ifAdminStatus) {
global $translate_ifAdminStatus;
if($translate_ifAdminStatus['$ifAdminStatus']) {
$ifAdminStatus = $translate_ifAdminStatus['$ifAdminStatus'];
}
return $ifAdminStatus;
}
$rewrite_ios_features = array(
"PK9S" => "IP w/SSH LAN Only",
"LANBASEK9" => "Lan Base Crypto",
"LANBASE" => "Lan Base",
"ADVENTERPRISEK9" => "Advanced Enterprise Crypto",
"ADVSECURITYK9" => "Advanced Security Crypto",
"K91P" => "Provider Crypto",
"K4P" => "Provider Crypto",
"ADVIPSERVICESK9" => "Adv IP Services Crypto",
"ADVIPSERVICES" => "Adv IP Services",
"IK9P" => "IP Plus Crypto",
"K9O3SY7" => "IP ADSL FW IDS Plus IPSEC 3DES",
"SPSERVICESK9" => "SP Services Crypto",
"PK9SV" => "IP MPLS/IPV6 W/SSH + BGP",
"IS" => "IP Plus",
"IPSERVICESK9" => "IP Services Crypto",
"BROADBAND" => "Broadband",
"IPBASE" => "IP Base",
"IPSERVICE" => "IP Services",
"P" => "Service Provider",
"P11" => "Broadband Router",
"G4P5" => "NRP",
"JK9S" => "Enterprise Plus Crypto",
"IK9S" => "IP Plus Crypto",
"JK" => "Enterprise Plus",
"I6Q4L2" => "Layer 2",
"I6K2L2Q4" => "Layer 2 Crypto",
"C3H2S" => "Layer 2 SI/EI",
"_WAN" => " + WAN",
$rewrite_ios_features = array(
"PK9S" => "IP w/SSH LAN Only",
"LANBASEK9" => "Lan Base Crypto",
"LANBASE" => "Lan Base",
"ADVENTERPRISEK9" => "Advanced Enterprise Crypto",
"ADVSECURITYK9" => "Advanced Security Crypto",
"K91P" => "Provider Crypto",
"K4P" => "Provider Crypto",
"ADVIPSERVICESK9" => "Adv IP Services Crypto",
"ADVIPSERVICES" => "Adv IP Services",
"IK9P" => "IP Plus Crypto",
"K9O3SY7" => "IP ADSL FW IDS Plus IPSEC 3DES",
"SPSERVICESK9" => "SP Services Crypto",
"PK9SV" => "IP MPLS/IPV6 W/SSH + BGP",
"IS" => "IP Plus",
"IPSERVICESK9" => "IP Services Crypto",
"BROADBAND" => "Broadband",
"IPBASE" => "IP Base",
"IPSERVICE" => "IP Services",
"P" => "Service Provider",
"P11" => "Broadband Router",
"G4P5" => "NRP",
"JK9S" => "Enterprise Plus Crypto",
"IK9S" => "IP Plus Crypto",
"JK" => "Enterprise Plus",
"I6Q4L2" => "Layer 2",
"I6K2L2Q4" => "Layer 2 Crypto",
"C3H2S" => "Layer 2 SI/EI",
"_WAN" => " + WAN",
);
@@ -131,34 +166,34 @@
function makeshortif($if)
{
global $rewrite_shortif;
$if = fixifName ($if);
$if = strtolower($if);
$if = array_str_replace($rewrite_shortif, $if);
return $if;
global $rewrite_shortif;
$if = fixifName ($if);
$if = strtolower($if);
$if = array_str_replace($rewrite_shortif, $if);
return $if;
}
function rewrite_ios_features ($features)
{
global $rewrite_ios_features;
$type = array_preg_replace($rewrite_ios_features, $features);
return ($features);
global $rewrite_ios_features;
$type = array_preg_replace($rewrite_ios_features, $features);
return ($features);
}
function fixiftype ($type)
{
global $rewrite_iftype;
$type = array_preg_replace($rewrite_iftype, $type);
return ($type);
global $rewrite_iftype;
$type = array_preg_replace($rewrite_iftype, $type);
return ($type);
}
function fixifName ($inf)
{
global $rewrite_ifname;
$inf = strtolower($inf);
$inf = array_str_replace($rewrite_ifname, $inf);
return $inf;
global $rewrite_ifname;
$inf = strtolower($inf);
$inf = array_str_replace($rewrite_ifname, $inf);
return $inf;
}