From 781d7debb9afaa774e1b22dd48cc4a1d6a90efed Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 18 Mar 2011 15:38:13 +0000 Subject: [PATCH] minor cleanups + hopefully allow adding of ipv6-only hosts with fping6 git-svn-id: http://www.observium.org/svn/observer/trunk@1924 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/defaults.inc.php | 1 + includes/discovery/cisco-pw.inc.php | 4 ++-- includes/discovery/cisco-vrf.inc.php | 4 ++-- includes/functions.php | 8 +++++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index fe2474760e..ec271e8d70 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -12,6 +12,7 @@ $config['log_file'] = $config['install_dir'] . "/observium.log"; $config['rrdtool'] = "/usr/bin/rrdtool"; $config['fping'] = "/usr/bin/fping"; +$config['fping6'] = "/usr/bin/fping6"; $config['snmpwalk'] = "/usr/bin/snmpwalk"; $config['snmpget'] = "/usr/bin/snmpget"; $config['snmpbulkwalk'] = "/usr/bin/snmpbulkwalk"; diff --git a/includes/discovery/cisco-pw.inc.php b/includes/discovery/cisco-pw.inc.php index d8c6c6a654..42fca0d940 100755 --- a/includes/discovery/cisco-pw.inc.php +++ b/includes/discovery/cisco-pw.inc.php @@ -2,8 +2,8 @@ if ($config['enable_pseudowires'] && $device['os_group'] == "ios") { - unset( $cpw_count ); - unset( $cpw_exists ); + unset($cpw_count); + unset($cpw_exists); echo("Cisco Pseudowires : "); diff --git a/includes/discovery/cisco-vrf.inc.php b/includes/discovery/cisco-vrf.inc.php index ed9643780f..56e0374129 100755 --- a/includes/discovery/cisco-vrf.inc.php +++ b/includes/discovery/cisco-vrf.inc.php @@ -2,7 +2,7 @@ if ($device['os_group'] == "ios" || $device['os_group'] == "junos" || $device['os'] == "ironware") { - unset( $vrf_count ); + unset($vrf_count); echo("VRFs : "); @@ -16,7 +16,7 @@ if ($device['os_group'] == "ios" || $device['os_group'] == "junos" || $device['o $oids = str_replace("\"", "", $oids); $oids = trim($oids); - foreach ( explode("\n", $oids) as $oid ) + foreach (explode("\n", $oids) as $oid) { if ($oid) { diff --git a/includes/functions.php b/includes/functions.php index 87ab2ad7f3..a0d597399d 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -400,7 +400,13 @@ function isPingable($hostname) { return TRUE; } else { - return FALSE; + $status = shell_exec($config['fping6'] . " $hostname"); + if (strstr($status, "alive")) + { + return TRUE; + } else { + return FALSE; + } } }