refactor: move ios detection to yaml using new sysDescr_except (#6456)

* refactor: move ios detection to yaml using new sysDescr_except

* Add IOS-XE too

* Add Catalyst 4500 test data, it needs IOS-XE for proper detection.
This commit is contained in:
Tony Murray
2017-04-19 05:02:29 -05:00
committed by Neil Lathwood
parent 0e6b42fc05
commit eebf0d263a
4 changed files with 13 additions and 5 deletions

View File

@@ -8,6 +8,16 @@ over:
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
icon: cisco
discovery:
-
sysDescr:
- 'Cisco Internetwork Operating System Software'
- 'IOS (tm)'
- 'Cisco IOS Software'
- 'Global Site Selector'
sysDescr_except:
- 'LINUX_IOSD'
- 'IOS-XE'
bad_ifXEntry:
- cisco1941
- cisco886Va

View File

@@ -1,5 +0,0 @@
<?php
if (str_contains($sysDescr, array('Cisco Internetwork Operating System Software', 'IOS (tm)', 'Cisco IOS Software', 'Global Site Selector')) && !str_contains($sysDescr, array('IOS-XE', 'X86_64_LINUX_IOSD'))) {
$os = 'ios';
}

View File

@@ -952,6 +952,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
{
$this->checkOS('iosxe');
$this->checkOS('iosxe', 'iosxe-asr1000');
$this->checkOS('iosxe', 'iosxe-c4500');
}
public function testIosxr()

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4x|436973636F20494F5320536F6674776172652C20494F532D584520536F6674776172652C20436174616C7973742034353030204C33205377697463682020536F6674776172652028636174343530306573382D554E4956455253414C4B392D4D292C2056657273696F6E2030332E30362E30362E452052454C4541534520534F465457415245202866633129DA546563686E6963616C20537570706F72743A20687474703A2F2F7777772E636973636F2E636F6D2F74656368737570706F7274DA436F707972696768742028632920313938362D3230313620627920436973636F2053797374656D732C20496E632EDA436F6D70696C656420536174
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.1.1287