diff --git a/includes/polling/os/saf-integra-b.inc.php b/includes/polling/os/saf-integra-b.inc.php index ab60937259..e36aaeced8 100644 --- a/includes/polling/os/saf-integra-b.inc.php +++ b/includes/polling/os/saf-integra-b.inc.php @@ -23,6 +23,8 @@ * @author Neil Lathwood */ -$saf_integra = preg_split('/;/', $poll_device['sysDescr']); +preg_match('/Prod: ([A-Za-z-_]+);Vers: ([0-9.]+);.*;S\/N: ([0-9]+)/', $poll_device['sysDescr'], $matches); -$serial = str_replace('S/N: ', '', $saf_integra[8]); +$hardware = $matches[1]; +$version = $matches[2]; +$serial = $matches[3]; diff --git a/includes/polling/os/saf-integra-w.inc.php b/includes/polling/os/saf-integra-w.inc.php index b87fdd930d..d53a19e6ec 100644 --- a/includes/polling/os/saf-integra-w.inc.php +++ b/includes/polling/os/saf-integra-w.inc.php @@ -23,6 +23,8 @@ * @author Neil Lathwood */ -$saf_integra = preg_split('/;/', $poll_device['sysDescr']); +preg_match('/Prod: ([A-Za-z-_]+);Vers: ([0-9.]+-(mux|esw));.*;S\/N: ([0-9]+)/', $poll_device['sysDescr'], $matches); -$serial = str_replace('S/N: ', '', $saf_integra[8]); +$hardware = $matches[1]; +$version = $matches[2]; +$serial = $matches[4]; diff --git a/includes/polling/os/saf.inc.php b/includes/polling/os/saf.inc.php index 4824af2948..1bb0430531 100644 --- a/includes/polling/os/saf.inc.php +++ b/includes/polling/os/saf.inc.php @@ -12,6 +12,8 @@ * the source code distribution for details. */ -list(,$version,,$hardware,$serial,,) = explode(";", $poll_device['sysDescr']); -list(,$hardware) = explode(":", $hardware); -list(,$serial) = explode(":", $serial); +preg_match('/ radio;(.*) v([0-9.]*);.*;SN: ([0-9]+);/', $poll_device['sysDescr'], $matches); + +$hardware = $matches[1]; +$version = $matches[2]; +$serial = $matches[3];