refactor: move hp jetdirect discovery to yaml (#5757)

This commit is contained in:
Tony Murray
2017-02-04 04:02:05 -06:00
committed by Neil Lathwood
parent 424ac80bff
commit 03f09118c1
3 changed files with 10 additions and 8 deletions

View File

@@ -10,4 +10,9 @@ discovery_modules:
toner: 1
poller_modules:
toner: 1
discovery:
- sysDescr:
- JETDIRECT
- HP ETHERNET MULTI-ENVIRONMENT
- sysObjectId_regex:
- '/^.1.3.6.1.4.1.11.1$/'

View File

@@ -1,7 +0,0 @@
<?php
if (str_contains($sysDescr, array('JETDIRECT', 'HP ETHERNET MULTI-ENVIRONMENT'))) {
$os = 'jetdirect';
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.11.1') && !starts_with($sysObjectId, '.1.3.6.1.4.1.11.10.2.1.3.25')) {
$os = 'jetdirect';
}

View File

@@ -160,6 +160,10 @@ function checkDiscovery($array, $sysObjectId, $sysDescr)
if (!preg_match_any($sysDescr, $value)) {
return false;
}
} elseif ($key == 'sysObjectId_regex') {
if (!preg_match_any($sysObjectId, $value)) {
return false;
}
}
}