mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: move hp jetdirect discovery to yaml (#5757)
This commit is contained in:
committed by
Neil Lathwood
parent
424ac80bff
commit
03f09118c1
@@ -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$/'
|
||||
|
@@ -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';
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user