basic support for polling number of connected clients on Aironet and Airport devices, minor fixups

git-svn-id: http://www.observium.org/svn/observer/trunk@1418 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-07-18 18:28:32 +00:00
parent 9cd59f41af
commit 93bfb66c3c
8 changed files with 601 additions and 64 deletions

View File

@@ -8,8 +8,8 @@ Release 0.10.7 ( 18th July 2010 )
* Support of ADSL-LINE-MIB and new ports display mode designed * Support of ADSL-LINE-MIB and new ports display mode designed
for service providers with DSLAMs and MSANs for service providers with DSLAMs and MSANs
* Discovery of new device/os types : * Discovery of new device/os types :
Apple Airport, Axis Camera, Motorola Netopia, APC Switch PDU, Apple Airport, Axis Camera, Motorola Netopia, APC Switched PDU,
Extreme Extremware, Redback, ZyXEL ZyWALL, DELL DRAC, Extreme Extremeware, Redback, ZyXEL ZyWALL, DELL DRAC,
Dell PowerVault, Allied Telesis, Cisco NX-OS, MGE Evolution UPS Dell PowerVault, Allied Telesis, Cisco NX-OS, MGE Evolution UPS
HP JetDirect printers, APC STS/ATS, Mikrotic RouterOS, HP JetDirect printers, APC STS/ATS, Mikrotic RouterOS,
AKCP SensorProbe3 AKCP SensorProbe3
@@ -17,7 +17,7 @@ Release 0.10.7 ( 18th July 2010 )
* Temperature detection from CISCO-ENTITY-SENSOR-MIB * Temperature detection from CISCO-ENTITY-SENSOR-MIB
* Graphing of statistics from DISKIO-MIB * Graphing of statistics from DISKIO-MIB
* Ongoing unification of all sensors into one 'sensors' framework * Ongoing unification of all sensors into one 'sensors' framework
* Detection and polling of frequency, voltage and ampage stats * Detection and polling of frequency, voltage and amperage stats
for many UPSes and power switching hardware for many UPSes and power switching hardware
* Detection of Extremeware / XOS versions and hardware * Detection of Extremeware / XOS versions and hardware
* Detection of several Allied Telesis devices and their versions * Detection of several Allied Telesis devices and their versions

View File

@@ -0,0 +1,29 @@
<?php
include("common.inc.php");
$device = device_by_id_cache($id);
$rrd_options .= " -l 0 -E ";
$radio1 = $config['rrd_dir'] . "/".$device['hostname']."/wificlients-radio1.rrd";
$radio2 = $config['rrd_dir'] . "/".$device['hostname']."/wificlients-radio2.rrd";
if (file_exists($radio1))
{
$rrd_options .= " COMMENT:' Cur Min Max\\n'";
$rrd_options .= " DEF:wificlients1=".$radio1.":wificlients:AVERAGE ";
$rrd_options .= " LINE1:wificlients1#CC0000:'Clients on Radio1 ' ";
$rrd_options .= " GPRINT:wificlients1:LAST:%3.0lf ";
$rrd_options .= " GPRINT:wificlients1:MIN:%3.0lf ";
$rrd_options .= " GPRINT:wificlients1:MAX:%3.0lf\\\l ";
if (file_exists($radio2))
{
$rrd_options .= " DEF:wificlients2=".$radio2.":wificlients:AVERAGE ";
$rrd_options .= " LINE1:wificlients2#008C00:'Clients on Radio2 ' ";
$rrd_options .= " GPRINT:wificlients2:LAST:%3.0lf ";
$rrd_options .= " GPRINT:wificlients2:MIN:%3.0lf ";
$rrd_options .= " GPRINT:wificlients2:MAX:%3.0lf\\\l ";
}
}
?>

View File

@@ -0,0 +1,9 @@
<?php
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/wificlients-all.rrd")) {
$graph_title = "Wireless clients";
$graph_type = "device_wificlients";
include ("includes/print-device-graph.php");
}
?>

View File

@@ -32,7 +32,7 @@ $config['nagios_plugins'] = "/usr/lib/nagios/plugins";
$config['title_image'] = "images/observium-logo.png"; $config['title_image'] = "images/observium-logo.png";
$config['stylesheet'] = "css/styles.css"; $config['stylesheet'] = "css/styles.css";
$config['mono_font'] = "DejaVuSansMono"; $config['mono_font'] = "DejaVuSansMono";
$config['favicon'] = "favicon.ico"; $config['favicon'] = "images/observium-icon.png";
$config['header_color'] = "#1F334E"; $config['header_color'] = "#1F334E";
$config['page_refresh'] = "300"; ## Refresh the page every xx seconds $config['page_refresh'] = "300"; ## Refresh the page every xx seconds
$config['frong_page'] = "pages/front/default.php"; $config['frong_page'] = "pages/front/default.php";

View File

@@ -0,0 +1,5 @@
<?php
$version = snmp_get($device, "sysConfFirmwareVersion.0 ", "-Ovq", "AIRPORT-BASESTATION-3-MIB");
?>

View File

@@ -0,0 +1,68 @@
<?php
echo "Wireless: ";
if ($device['type'] == 'network')
{
if ($device['os'] == 'airport')
{
echo "Checking Airport Wireless clients... ";
$wificlients1 = snmp_get($device, "wirelessNumber.0", "-OUqnv", "AIRPORT-BASESTATION-3-MIB") +0;
echo($wificlients1 . " clients\n");
# FIXME Also interesting to poll? dhcpNumber.0 for number of active dhcp leases
}
if ($device['os'] == 'ios' and substr($device['hardware'],0,4) == 'AIR-')
{
echo "Checking Aironet Wireless clients... ";
$wificlients1 = snmp_get($device, "cDot11ActiveWirelessClients.1", "-OUqnv", "CISCO-DOT11-ASSOCIATION-MIB");
$wificlients2 = snmp_get($device, "cDot11ActiveWirelessClients.2", "-OUqnv", "CISCO-DOT11-ASSOCIATION-MIB");
echo ($wificlients1 +0) . " clients on dot11Radio0, " . ($wificlients2 +0) . " clients on dot11Radio1\n";
}
if (isset($wificlients1) && $wificlients1 != "")
{
$wificlientsrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("wificlients-radio1.rrd");
if (!is_file($wificlientsrrd)) {
`rrdtool create $wificlientsrrd \
--step 300 \
DS:wificlients:GAUGE:600:-273:1000 \
RRA:AVERAGE:0.5:1:1200 \
RRA:MIN:0.5:12:2400 \
RRA:MAX:0.5:12:2400 \
RRA:AVERAGE:0.5:12:2400`;
}
rrdtool_update($wificlientsrrd,"N:".$wificlients1);
}
if (isset($wificlients2) && $wificlients2 != "")
{
$wificlientsrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("wificlients-radio2.rrd");
if (!is_file($wificlientsrrd)) {
`rrdtool create $wificlientsrrd \
--step 300 \
DS:wificlients:GAUGE:600:-273:1000 \
RRA:AVERAGE:0.5:1:1200 \
RRA:MIN:0.5:12:2400 \
RRA:MAX:0.5:12:2400 \
RRA:AVERAGE:0.5:12:2400`;
}
rrdtool_update($wificlientsrrd,"N:".$wificlients2);
}
}
echo "\n";
?>

View File

@@ -0,0 +1,420 @@
AIRPORT-BASESTATION-3-MIB
DEFINITIONS ::= BEGIN
IMPORTS
enterprises, MODULE-IDENTITY, OBJECT-TYPE, IpAddress
FROM SNMPv2-SMI
PhysAddress
FROM RFC1213-MIB
DisplayString
FROM SNMPv2-TC;
baseStation3 MODULE-IDENTITY
LAST-UPDATED "200301160001Z"
ORGANIZATION "Apple Computer, Inc."
CONTACT-INFO
" Apple Computer, Inc.
Postal: 1 Infinite Loop
Cupertino, CA 95014
USA
Tel: +1-408-996-1010"
DESCRIPTION
"Management information base in SMI v2 for the AirPort and AirPort Extreme Base Station (v3)."
::= { airport 3 }
apple OBJECT IDENTIFIER ::= { enterprises 63 }
airport OBJECT IDENTIFIER ::= { apple 501 }
-- (c) 2003 Apple Computer, Inc. All rights reserved. Apple, the Apple logo,
-- AirPort, and AirPort Extreme are trademarks of Apple Computer, Inc.,
-- registered in the U.S. and other countries.
-- system configuration information
abs3SysConf OBJECT IDENTIFIER ::= { baseStation3 1 }
sysConfName OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION "Configured name of the AirPort Base Station."
::= { abs3SysConf 1 }
sysConfContact OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION "Configured name of the contact for the AirPort Base Station."
::= { abs3SysConf 2 }
sysConfLocation OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION "Configured name of where the AirPort Base Station is located."
::= { abs3SysConf 3 }
sysConfUptime OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Length of time, in seconds, the AirPort Base Station has been running."
::= { abs3SysConf 4 }
sysConfFirmwareVersion OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Current firmware revision running on the AirPort Base Station."
::= { abs3SysConf 5 }
-- TBD: additional configuration/status information
-- NAT state
-- DHCP state
-- briding state
-- product information (Snow, Extreme, etc)
-- USB information
-- list of attached devices, each one with status info
-- print server information
-- list of printers, each one with number of jobs received,
-- logging
-- information about wireless clients
wireless OBJECT IDENTIFIER ::= { baseStation3 2 }
wirelessNumber OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of wireless clients associated with this AP."
::= { wireless 1 }
wirelessClientsTable OBJECT-TYPE
SYNTAX SEQUENCE OF WirelessClient
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "A list of wireless clients."
::= { wireless 2 }
wirelessClient OBJECT-TYPE
SYNTAX WirelessClient
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "A wireless client entry containing information about the client."
INDEX { wirelessPhysAddress }
::= { wirelessClientsTable 1 }
WirelessClient ::= SEQUENCE {
-- the following information is provided by the access point driver (i.e., this is information it knows about the wireless STA)
wirelessPhysAddress
PhysAddress,
wirelessType
INTEGER,
wirelessDataRates
DisplayString,
wirelessTimeAssociated
INTEGER,
wirelessLastRefreshTime
INTEGER,
-- the following information is obtained from the client, via a communication protocol between the AP and STA/WDS node
-- and therefore, it is only supported by Apple STA/AP drivers
-- the information is refreshed once each time it is requested, but since some STAs will not implement this
-- protocol, we provide an indication of how long it has been since the data was refreshed. if that value
-- is zero, then it means we have never obtained this information from the clients
wirelessStrength
INTEGER,
wirelessNoise
INTEGER,
wirelessRate
INTEGER,
wirelessNumRX
INTEGER,
wirelessNumTX
INTEGER,
wirelessNumRXErrors
INTEGER,
wirelessNumTXErrors
INTEGER
}
wirelessPhysAddress OBJECT-TYPE
SYNTAX PhysAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The MAC address of the wireless client."
::= { wirelessClient 1 }
wirelessType OBJECT-TYPE
SYNTAX INTEGER {
sta(1),
wds(2)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The type of wireless client node."
::= { wirelessClient 2 }
wirelessDataRates OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The data rates available for the wireless client."
::= { wirelessClient 3 }
wirelessTimeAssociated OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The time that this wireless client associated."
::= { wirelessClient 4 }
wirelessLastRefreshTime OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of seconds since the client reported its statistics to the AirPort Base Station (-1 if never refreshed or not supported)."
::= { wirelessClient 5 }
wirelessStrength OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The signal strength reported by the wireless client (-1 if not supported)."
::= { wirelessClient 6 }
wirelessNoise OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The noise reported by the wireless client (-1 if not supported)."
::= { wirelessClient 7 }
wirelessRate OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The rate reported by the wireless client (-1 if not supported)."
::= { wirelessClient 8 }
wirelessNumRX OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of packets received reported by the wireless client (-1 if not supported)."
::= { wirelessClient 9 }
wirelessNumTX OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of packets transmitted reported by this wireless client (-1 if not supported)."
::= { wirelessClient 10 }
wirelessNumRXErrors OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of errors encountered receiving packets reported by this wireless client (-1 if not supported)."
::= { wirelessClient 11 }
wirelessNumTXErrors OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of errors encountered transmitting packets reported by this wireless client (-1 if not supported)."
::= { wirelessClient 12 }
-- information about DHCP server
dhcpServer OBJECT IDENTIFIER ::= { baseStation3 3 }
dhcpNumber OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of DHCP clients served by the AirPort base station."
::= { dhcpServer 1 }
dhcpClientsTable OBJECT-TYPE
SYNTAX SEQUENCE OF DHCPClient
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "A list of DHCP clients."
::= { dhcpServer 2 }
dhcpClient OBJECT-TYPE
SYNTAX DHCPClient
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "A DHCP client entry containing information about the client."
INDEX { dhcpPhysAddress }
::= { dhcpClientsTable 1 }
DHCPClient ::= SEQUENCE {
-- indexed by phys address, since it is unique per client
dhcpPhysAddress
PhysAddress,
dhcpIpAddress
IpAddress,
dhcpClientID
OCTET STRING,
dhcpLeaseTime
INTEGER
}
dhcpPhysAddress OBJECT-TYPE
SYNTAX PhysAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The MAC address of the DHCP client."
::= { dhcpClient 1 }
dhcpIpAddress OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The IP address of the DHCP client."
::= { dhcpClient 2 }
dhcpClientID OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The DHCP client ID of the DHCP client."
::= { dhcpClient 3 }
dhcpLeaseTime OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The lease time for the DHCP client."
::= { dhcpClient 4 }
-- physical interfaces table
physicalInterfaces OBJECT IDENTIFIER ::= { baseStation3 4 }
physicalInterfaceCount OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of physical interfaces on the AirPort Base Station. This is different than the number of IP interfaces, as reported by the system MIBs, as the AirPort's bridge typically multiplexes two or more interfaces."
::= { physicalInterfaces 1 }
physicalInterfacesTable OBJECT-TYPE
SYNTAX SEQUENCE OF PhysicalInterface
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "List of physical interfaces on the AirPort Base Station."
::= { physicalInterfaces 2 }
physicalInterface OBJECT-TYPE
SYNTAX PhysicalInterface
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "Entry containing data about the physical interface on the AirPort Base Station."
INDEX { physicalInterfaceIndex }
::= { physicalInterfacesTable 1 }
PhysicalInterface ::= SEQUENCE {
physicalInterfaceIndex INTEGER,
physicalInterfaceName OCTET STRING,
physicalInterfaceUnit INTEGER,
physicalInterfaceSpeed INTEGER,
physicalInterfaceState INTEGER,
physicalInterfaceDuplex INTEGER,
physicalInterfaceNumTX INTEGER,
physicalInterfaceNumRX INTEGER,
physicalInterfaceNumTXError INTEGER,
physicalInterfaceNumRXError INTEGER
}
physicalInterfaceIndex OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "A unique value for each physical interface. Its value ranges between 1 and the value of physicalInterfaceCount."
::= { physicalInterface 1 }
physicalInterfaceName OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The name of the physical interface."
::= { physicalInterface 2 }
physicalInterfaceUnit OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The unit number of the physical interface."
::= { physicalInterface 3 }
physicalInterfaceSpeed OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The speed, in bits per second, of the interface."
::= { physicalInterface 4 }
physicalInterfaceState OBJECT-TYPE
SYNTAX INTEGER {
linkDown(0),
linkUp(1)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The status of this interface."
::= { physicalInterface 5 }
physicalInterfaceDuplex OBJECT-TYPE
SYNTAX INTEGER {
half(0),
full(1)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The duplex-state of this interface."
::= { physicalInterface 6 }
physicalInterfaceNumTX OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of packets transmitted on this interface."
::= { physicalInterface 7 }
physicalInterfaceNumRX OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of packets received on this interface."
::= { physicalInterface 8 }
physicalInterfaceNumTXError OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of errors during transmission on this interface."
::= { physicalInterface 9 }
physicalInterfaceNumRXError OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The number of errors during reception on this interface."
::= { physicalInterface 10 }
END

View File

@@ -50,7 +50,8 @@ if (isset($options['d'])) { echo("DEBUG!\n"); $debug = 1; }
echo("Starting polling run:\n\n"); echo("Starting polling run:\n\n");
$polled_devices = 0; $polled_devices = 0;
$device_query = mysql_query("SELECT * FROM `devices` WHERE `ignore` = 0 AND `disabled` = 0 $where ORDER BY `device_id` ASC"); $device_query = mysql_query("SELECT * FROM `devices` WHERE `ignore` = 0 AND `disabled` = 0 $where ORDER BY `device_id` ASC");
while ($device = mysql_fetch_array($device_query)) { while ($device = mysql_fetch_array($device_query))
{
$status = 0; unset($array); $status = 0; unset($array);
$device_start = utime(); // Start counting device poll time $device_start = utime(); // Start counting device poll time
@@ -152,17 +153,22 @@ while ($device = mysql_fetch_array($device_query)) {
$poll_separator = ", "; $poll_separator = ", ";
} }
if (is_file($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php")) { if (is_file($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php"))
{
/// OS Specific /// OS Specific
include($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php"); include($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php");
}elseif ($device['os_group'] && is_file($config['install_dir'] . "/includes/polling/device-".$device['os_group'].".inc.php")) { }
elseif ($device['os_group'] && is_file($config['install_dir'] . "/includes/polling/device-".$device['os_group'].".inc.php"))
{
/// OS Group Specific /// OS Group Specific
include($config['install_dir'] . "/includes/polling/device-".$device['os_group'].".inc.php"); include($config['install_dir'] . "/includes/polling/device-".$device['os_group'].".inc.php");
}else{ }
echo("Generic :("); else
{
echo("Generic :(\n");
} }
echo("Hardware:".$hardware." Version:".$version." Features:".$features."\n"); echo("Hardware: ".$hardware." Version: ".$version." Features: ".$features."\n");
$sysLocation = str_replace("\"","", $sysLocation); $sysLocation = str_replace("\"","", $sysLocation);
@@ -183,62 +189,63 @@ while ($device = mysql_fetch_array($device_query)) {
include("includes/polling/toner.inc.php"); include("includes/polling/toner.inc.php");
include("includes/polling/ucd-diskio.inc.php"); include("includes/polling/ucd-diskio.inc.php");
include("includes/polling/applications.inc.php"); include("includes/polling/applications.inc.php");
include("includes/polling/wireless.inc.php");
unset( $update ) ; unset( $update ) ;
unset( $seperator) ; unset( $seperator) ;
if ( $serial && $serial != $device['serial'] ) {
$poll_update .= $poll_separator . "`serial` = '".mres($serial)."'";
$poll_separator = ", ";
log_event("Serial -> $serial", $device['device_id'], 'system');
}
if ( $sysContact && $sysContact != $device['sysContact'] ) {
$poll_update .= $poll_separator . "`sysContact` = '".mres($sysContact)."'";
$poll_separator = ", ";
log_event("Contact -> $sysContact", $device['device_id'], 'system');
}
if ( $sysName && $sysName != $device['sysName'] ) {
$poll_update .= $poll_separator . "`sysName` = '$sysName'";
$poll_separator = ", ";
log_event("sysName -> $sysName", $device['device_id'], 'system');
}
if ( $sysDescr && $sysDescr != $device['sysDescr'] ) {
$poll_update .= $poll_separator . "`sysDescr` = '$sysDescr'";
$poll_separator = ", ";
log_event("sysDescr -> $sysDescr", $device['device_id'], 'system');
}
if ( $sysLocation && $device['location'] != $sysLocation ) {
$poll_update .= $poll_separator . "`location` = '$sysLocation'";
$poll_separator = ", ";
log_event("Location -> $sysLocation", $device['device_id'], 'system');
}
if ( $version && $device['version'] != $version ) {
$poll_update .= $poll_separator . "`version` = '$version'";
$poll_separator = ", ";
log_event("OS Version -> $version", $device['device_id'], 'system');
}
if ( $features != $device['features'] ) {
$poll_update .= $poll_separator . "`features` = '$features'";
$poll_separator = ", ";
log_event("OS Features -> $features", $device['device_id'], 'system');
}
if ( $hardware && $hardware != $device['hardware'] ) {
$poll_update .= $poll_separator . "`hardware` = '$hardware'";
$poll_separator = ", ";
log_event("Hardware -> $hardware", $device['device_id'], 'system');
}
if ( $serial && $serial != $device['serial'] ) { $poll_update .= $poll_separator . "`last_polled` = NOW()";
$poll_update .= $poll_separator . "`serial` = '".mres($serial)."'";
$poll_separator = ", "; $poll_separator = ", ";
log_event("Serial -> $serial", $device['device_id'], 'system'); $polled_devices++;
} echo("\n");
if ( $sysContact && $sysContact != $device['sysContact'] ) {
$poll_update .= $poll_separator . "`sysContact` = '".mres($sysContact)."'";
$poll_separator = ", ";
log_event("Contact -> $sysContact", $device['device_id'], 'system');
}
if ( $sysName && $sysName != $device['sysName'] ) {
$poll_update .= $poll_separator . "`sysName` = '$sysName'";
$poll_separator = ", ";
log_event("sysName -> $sysName", $device['device_id'], 'system');
}
if ( $sysDescr && $sysDescr != $device['sysDescr'] ) {
$poll_update .= $poll_separator . "`sysDescr` = '$sysDescr'";
$poll_separator = ", ";
log_event("sysDescr -> $sysDescr", $device['device_id'], 'system');
}
if ( $sysLocation && $device['location'] != $sysLocation ) {
$poll_update .= $poll_separator . "`location` = '$sysLocation'";
$poll_separator = ", ";
log_event("Location -> $sysLocation", $device['device_id'], 'system');
}
if ( $version && $device['version'] != $version ) {
$poll_update .= $poll_separator . "`version` = '$version'";
$poll_separator = ", ";
log_event("OS Version -> $version", $device['device_id'], 'system');
}
if ( $features != $device['features'] ) {
$poll_update .= $poll_separator . "`features` = '$features'";
$poll_separator = ", ";
log_event("OS Features -> $features", $device['device_id'], 'system');
}
if ( $hardware && $hardware != $device['hardware'] ) {
$poll_update .= $poll_separator . "`hardware` = '$hardware'";
$poll_separator = ", ";
log_event("Hardware -> $hardware", $device['device_id'], 'system');
}
$poll_update .= $poll_separator . "`last_polled` = NOW()";
$poll_separator = ", ";
$polled_devices++;
echo("\n");
} }
if ($poll_update) { if ($poll_update) {
@@ -265,5 +272,4 @@ $string = $argv[0] . " $doing " . date("F j, Y, G:i") . " - $polled_devices dev
if ($debug) echo("$string\n"); if ($debug) echo("$string\n");
shell_exec("echo '".$string."' >> ".$config['install_dir']."/observium.log"); # FIXME EWW shell_exec("echo '".$string."' >> ".$config['install_dir']."/observium.log"); # FIXME EWW
?> ?>