newdevice: Changed Solaris and Allied discovery to yaml (#6900)

Add SunOS to callback sanitize
This commit is contained in:
Tony Murray
2017-06-28 01:53:25 -05:00
committed by Neil Lathwood
parent 092f6922a9
commit d47b58bf6d
12 changed files with 26 additions and 48 deletions

View File

@@ -79,8 +79,8 @@ if ($enabled == 1) {
// sanitize sysDescr
$device_info = array_map(function ($entry) {
// remove hostnames from linux and macosx
$entry['sysDescr'] = preg_replace_callback('/^(Linux |Darwin |FreeBSD )[A-Za-z0-9._\-]+ ([0-9.]{3,9})/', function ($matches) {
// remove hostnames from linux, macosx, and SunOS
$entry['sysDescr'] = preg_replace_callback('/^(Linux |Darwin |FreeBSD |SunOS )[A-Za-z0-9._\-]+ ([0-9.]{3,9})/', function ($matches) {
return $matches[1] . 'hostname ' .$matches[2];
}, $entry['sysDescr']);

View File

@@ -4,3 +4,7 @@ type: network
ifname: 1
over:
- { graph: device_bits, text: Traffic }
discovery:
-
sysObjectId: .1.3.6.1.4.1.207.
sysObjectId_except: .1.3.6.1.4.1.207.1.4.126

View File

@@ -6,3 +6,7 @@ processor_stacked: 1
over:
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_ucd_memory, text: 'Memory Usage' }
discovery:
-
sysObjectId: .1.3.6.1.4.1.8072.3.2.3
sysDescr_regex: '/^SunOS oi_.* 5\.11/'

View File

@@ -6,3 +6,7 @@ processor_stacked: 1
over:
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_ucd_memory, text: 'Memory Usage' }
discovery:
-
sysObjectId: .1.3.6.1.4.1.8072.3.2.3
sysDescr_regex: '/^SunOS .+ 5\.11 [^1]/'

View File

@@ -6,3 +6,11 @@ processor_stacked: 1
over:
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_ucd_memory, text: 'Memory Usage' }
discovery:
- sysObjectId: .1.3.6.1.4.1.42.2.1.1
-
sysObjectId: .1.3.6.1.4.1.8072.3.2.3
sysDescr_regex: '/^SunOS .+ 5\.10/'
-
sysObjectId: .1.3.6.1.4.1.8072.3.2.3
sysDescr_regex: '/^SunOS .+ 5\.11 11/'

View File

@@ -1,5 +0,0 @@
<?php
if (starts_with($sysObjectId, '.1.3.6.1.4.1.207') && !starts_with($sysObjectId, '.1.3.6.1.4.1.207.1.4.126')) {
$os = 'allied';
}

View File

@@ -1,15 +0,0 @@
<?php
if (starts_with($sysDescr, 'SunOS')) {
list(,,$version) = explode(' ', $sysDescr);
if (version_compare($version, '5.10', '>')) {
if (str_contains($sysDescr, 'oi_')) {
$os = 'openindiana';
}
}
}
if (starts_with($sysObjectId, '.1.3.6.1.4.1.42.2.1.1')) {
$os = 'solaris';
}

View File

@@ -1,11 +0,0 @@
<?php
if (starts_with($sysDescr, 'SunOS')) {
list(,,$version) = explode(' ', $sysDescr);
if (version_compare($version, '5.10', '>')) {
if (!str_contains($sysDescr, 'oi_')) {
$os = 'opensolaris';
}
}
}

View File

@@ -1,14 +0,0 @@
<?php
if (starts_with($sysDescr, 'SunOS')) {
$os = 'solaris';
list(,,$version) = explode(' ', $sysDescr);
if (version_compare($version, '5.10', '>')) {
unset($os);
}
}
if (starts_with($sysObjectId, '.1.3.6.1.4.1.42.2.1.1')) {
$os = 'solaris';
}

View File

@@ -1 +1,2 @@
1.3.6.1.2.1.1.1.0|4|SunOS oi_ 5.11
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.3

View File

@@ -1,2 +1,2 @@
1.3.6.1.2.1.1.1.0|4|SunOS Something 5.10
1.3.6.1.2.1.1.1.0|4|SunOS host-name 5.10 Generic_144488-06 sun4u
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.3

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|SunOS hostname 5.11 11.3 i86pc
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.3