From b34cb35a46a727352a2f34d1a6a8790d92299cbb Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 30 Jul 2010 16:24:01 +0000 Subject: [PATCH] fix addhost that got borked a few commits back git-svn-id: http://www.observium.org/svn/observer/trunk@1549 61d68cd4-352d-0410-923a-c4978735b2b8 --- addhost.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addhost.php b/addhost.php index a82a7bac1a..496def78f2 100755 --- a/addhost.php +++ b/addhost.php @@ -21,8 +21,9 @@ if($argv[1]) { if ( mysql_result(mysql_query("SELECT COUNT(*) FROM `devices` WHERE `hostname` = '".mres($host)."'"), 0) == '0' ) { if ( isDomainResolves($argv[1])){ if ( isPingable($argv[1])) { - if ( isSNMPable($argv[1], $community, $snmpver, $port)) { # FIXME should be a foreach $config['snmp']['community'][0] as $community + $community = $config['snmp']['community'][0]; + if ( isSNMPable($argv[1], $community, $snmpver, $port)) { $snmphost = trim(str_replace("\"", "", shell_exec($config['snmpget'] ." -m SNMPv2-MIB -Oqv -$snmpver -c ".$config['snmp']['community'][0]." $host:$port sysName.0"))); if ($snmphost == "" || ($snmphost && ($snmphost == $host || $hostshort = $host))) { $return = createHost ($host, $community, $snmpver, $port);