From 3f3b6c1c86bc7e8fd30f3857f4d41e3bd411604d Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Thu, 15 Jul 2010 17:21:02 +0000 Subject: [PATCH] actually commit powervault detection + minor polling git-svn-id: http://www.observium.org/svn/observer/trunk@1357 61d68cd4-352d-0410-923a-c4978735b2b8 --- addhost.php | 4 ++-- includes/functions.php | 1 - includes/osdiscovery/discover-powervault.php | 9 +++++++++ includes/polling/device-powervault.inc.php | 5 +++++ includes/static-config.php | 2 ++ 5 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 includes/osdiscovery/discover-powervault.php create mode 100644 includes/polling/device-powervault.inc.php diff --git a/addhost.php b/addhost.php index b33cd60583..a54cf9ceb1 100755 --- a/addhost.php +++ b/addhost.php @@ -23,10 +23,10 @@ if($argv[1]) { if ( isPingable($argv[1])) { if ( isSNMPable($argv[1], $community, $snmpver, $port)) { $snmphost = trim(str_replace("\"", "", shell_exec($config['snmpget'] ." -m SNMPv2-MIB -Oqv -$snmpver -c $community $host:$port sysName.0"))); - if ($snmphost != "" || $snmphost && ($snmphost == $host || $hostshort = $host)) { + if ($snmphost == "" || ($snmphost && ($snmphost == $host || $hostshort = $host))) { $return = createHost ($host, $community, $snmpver, $port); if($return) { echo($return . "\n"); } else { echo("Adding $host failed\n"); } - } else { echo("Given hostname does not match SNMP-read hostname!\n"); } + } else { echo("Given hostname does not match SNMP-read hostname ($snmphost)!\n"); } } else { echo("Could not reach $host with SNMP\n"); } } else { echo("Could not ping $host\n"); } } else { echo("Could not resolve $host\n"); } diff --git a/includes/functions.php b/includes/functions.php index 8429a29049..aaba84555e 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -102,7 +102,6 @@ function getHostOS($device) $sysDescr = snmp_get ($device, "sysDescr.0", "-Ovq"); $sysObjectId = snmp_get ($device, "sysObjectID.0", "-Ovqn"); - $dir_handle = @opendir($config['install_dir'] . "/includes/osdiscovery") or die("Unable to open $path"); while ($file = readdir($dir_handle)) { diff --git a/includes/osdiscovery/discover-powervault.php b/includes/osdiscovery/discover-powervault.php new file mode 100644 index 0000000000..31ce8a2415 --- /dev/null +++ b/includes/osdiscovery/discover-powervault.php @@ -0,0 +1,9 @@ + diff --git a/includes/polling/device-powervault.inc.php b/includes/polling/device-powervault.inc.php new file mode 100644 index 0000000000..763c945d19 --- /dev/null +++ b/includes/polling/device-powervault.inc.php @@ -0,0 +1,5 @@ + diff --git a/includes/static-config.php b/includes/static-config.php index d4d176319e..0eddef1d33 100644 --- a/includes/static-config.php +++ b/includes/static-config.php @@ -101,6 +101,8 @@ $config['os']['powerconnect']['text'] = "Dell PowerConnect"; $config['os']['powerconnect']['ifname'] = 1; $config['os']['powerconnect']['type'] = "network"; +$config['os']['powervault']['text'] = "Dell PowerVault"; + $config['os']['airport']['type'] = "network"; $config['os']['airport']['text'] = "Apple AirPort";