allow for custom ASN textual descriptions

git-svn-id: http://www.observium.org/svn/observer/trunk@637 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-01-09 17:06:34 +00:00
parent 84cda687a2
commit 76bf3f54b4
2 changed files with 16 additions and 3 deletions

View File

@@ -733,9 +733,18 @@ function discover_process_ipv6($ifIndex,$ipv6_address,$ipv6_prefixlen,$ipv6_orig
function get_astext($asn)
{
$result = dns_get_record("AS$asn.asn.cymru.com",DNS_TXT);
$txt = explode('|',$result[0]['txt']);
return trim(str_replace('"', '', $txt[4]));
global $config;
if (isset($config['astext'][$asn]))
{
return $config['astext'][$asn];
}
else
{
$result = dns_get_record("AS$asn.asn.cymru.com",DNS_TXT);
$txt = explode('|',$result[0]['txt']);
return trim(str_replace('"', '', $txt[4]));
}
}
function eventlog($eventtext,$device_id = "", $interface_id = "")