git-svn-id: http://www.observium.org/svn/observer/trunk@85 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-09 13:14:03 +00:00
parent b642b2be1a
commit b9e5bd25ee
2 changed files with 8 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ while ($device = mysql_fetch_array($device_query)) {
unset($update); unset($update_query); unset($seperator); unset($version); unset($uptime); unset($features);
unset($location); unset($hardware);
$pingable = isPingable($device['hostname']);
$snmpable = FALSE;
@@ -16,7 +17,7 @@ while ($device = mysql_fetch_array($device_query)) {
$snmpable = isSNMPable($device['hostname'], $device['community'], $device['snmpver']);
}
if ($pingable !== FALSE && $snmpable !== FALSE ) {
if ($pingable && $snmpable) {
$status = '1';
if($device['os'] == "FreeBSD" || $device['os'] == "OpenBSD" || $device['os'] == "Linux" || $device['os'] == "Windows") {
$uptimeoid = ".1.3.6.1.2.1.25.1.1.0";

View File

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