Fix reachability script

git-svn-id: http://www.observium.org/svn/observer/trunk@167 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-03-17 00:24:06 +00:00
parent 861acd6bc0
commit 1ce54ae835

View File

@@ -18,18 +18,16 @@ while ($device = mysql_fetch_array($device_query)) {
echo("$hostname\n");
$status = `$fping $hostname | cut -d " " -f 3`;
$status = shell_exec($config['fping'] . " $hostname | cut -d ' ' -f 3");
$status = trim($status);
if(strstr($status, "alive")) {
$pos = `snmpget -$snmpver -c $community -t 1 $hostname sysDescr.0`;
# echo("pos - $pos/n");
$pos = shell_exec($config['snmpget'] . " -$snmpver -c $community -t 1 $hostname sysDescr.0");
if($pos == '') {
$status='0';
$posb = `snmpget -$snmpver -c $community -t 1 $hostname 1.3.6.1.2.1.7526.2.4`;
$posb = shell_exec($config['snmpget'] . " -$snmpver -c $community -t 1 $hostname 1.3.6.1.2.1.7526.2.4");
if($posb == '') { } else {
$status='1';
# echo("posb - $posb/n");
}
} else {
$status='1';