mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	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:
		| @@ -133,6 +133,10 @@ $config['ignore_mount'] = array("/kern", "/mnt/cdrom", "/dev", "/dev/pts", "/pro | |||||||
| $config['ignore_mount_regexp'] = array(); | $config['ignore_mount_regexp'] = array(); | ||||||
| $config['ignore_mount_string'] = array("/.*\/dev\/?$/"); | $config['ignore_mount_string'] = array("/.*\/dev\/?$/"); | ||||||
|  |  | ||||||
|  | ### Hardcoded ASN descriptions | ||||||
|  |  | ||||||
|  | # $config['astext'][65333] = "Cymru Bogon Feed"; | ||||||
|  |  | ||||||
| ### Style Options | ### Style Options | ||||||
|  |  | ||||||
| $list_colour_a = "#ffffff"; | $list_colour_a = "#ffffff"; | ||||||
|   | |||||||
| @@ -733,9 +733,18 @@ function discover_process_ipv6($ifIndex,$ipv6_address,$ipv6_prefixlen,$ipv6_orig | |||||||
|  |  | ||||||
| function get_astext($asn) | function get_astext($asn) | ||||||
| { | { | ||||||
|   $result = dns_get_record("AS$asn.asn.cymru.com",DNS_TXT); |   global $config; | ||||||
|   $txt = explode('|',$result[0]['txt']); |  | ||||||
|   return trim(str_replace('"', '', $txt[4])); |   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 = "") | function eventlog($eventtext,$device_id = "", $interface_id = "") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user