From 0a547f54922db919a5231013cb4fb5cde0604352 Mon Sep 17 00:00:00 2001 From: Kevin Fleshman Date: Mon, 9 Mar 2015 10:36:59 -0700 Subject: [PATCH 1/4] Add detection of HP V1910 switches --- includes/discovery/os/hp.inc.php | 8 ++++++++ includes/polling/os/hp.inc.php | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 includes/discovery/os/hp.inc.php create mode 100644 includes/polling/os/hp.inc.php diff --git a/includes/discovery/os/hp.inc.php b/includes/discovery/os/hp.inc.php new file mode 100644 index 0000000000..4c3952ab4a --- /dev/null +++ b/includes/discovery/os/hp.inc.php @@ -0,0 +1,8 @@ + diff --git a/includes/polling/os/hp.inc.php b/includes/polling/os/hp.inc.php new file mode 100644 index 0000000000..a5a5145a36 --- /dev/null +++ b/includes/polling/os/hp.inc.php @@ -0,0 +1,6 @@ + From ab9c432b366578c0985a66694b74b60df8b57bca Mon Sep 17 00:00:00 2001 From: Kevin Fleshman Date: Mon, 9 Mar 2015 10:38:03 -0700 Subject: [PATCH 2/4] Add support for HP V1910 switches --- includes/definitions.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index bb202a28ea..da11b60130 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -982,6 +982,12 @@ $config['os'][$os]['text'] = "Hikvision"; $config['os'][$os]['type'] = "network"; $config['os'][$os]['icon'] = "hikvision"; +$os = "hp"; +$config['os'][$os]['text'] = "HP"; +$config['os'][$os]['over'][0]['graph'] = "device_bits"; +$config['os'][$os]['over'][0]['text'] = "Traffic"; +$config['os'][$os]['type'] = "network"; + foreach ($config['os'] as $this_os => $blah) { if (isset($config['os'][$this_os]['group'])) From 5c7ee6aad11119463bb07e18b8219cb21ee2c3d9 Mon Sep 17 00:00:00 2001 From: Kevin Fleshman Date: Mon, 9 Mar 2015 11:29:35 -0700 Subject: [PATCH 3/4] sysDescr is two lines --- includes/polling/os/hp.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/polling/os/hp.inc.php b/includes/polling/os/hp.inc.php index a5a5145a36..5525448862 100644 --- a/includes/polling/os/hp.inc.php +++ b/includes/polling/os/hp.inc.php @@ -1,6 +1,6 @@ From 728b9abd54253b2ce0e43e38a11511db53153eed Mon Sep 17 00:00:00 2001 From: Kevin Fleshman Date: Mon, 9 Mar 2015 12:11:40 -0700 Subject: [PATCH 4/4] More generic detection from laf --- includes/discovery/os/hp.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/os/hp.inc.php b/includes/discovery/os/hp.inc.php index 4c3952ab4a..22fbb1b7b8 100644 --- a/includes/discovery/os/hp.inc.php +++ b/includes/discovery/os/hp.inc.php @@ -2,7 +2,7 @@ if (!$os) { - if (strstr($sysDescr, "HP V1910-")) { $os = "hp"; } + if(preg_match('/HP [a-zA-Z0-9-]+ Switch Software Version/',$string)) { $os = "hp"; } } ?>