mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
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
This commit is contained in:
parent
4696c7f02a
commit
b34cb35a46
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user