2010-07-18 18:28:32 +00:00
< ? php
2015-07-13 20:10:26 +02:00
if ( $device [ 'type' ] == 'network' || $device [ 'type' ] == 'firewall' || $device [ 'type' ] == 'wireless' ) {
echo " Wireless: MAG \n " ;
2015-04-03 18:59:58 +01:00
2015-07-13 20:10:26 +02:00
if ( $device [ 'os' ] == 'airos' ) {
echo " It Is Airos \n " ;
include 'includes/polling/mib/ubnt-airmax-mib.inc.php' ;
}
2012-04-14 23:28:23 +00:00
2015-07-13 20:10:26 +02:00
if ( $device [ 'os' ] == 'airos-af' ) {
echo " It Is AirFIBER \n " ;
include 'includes/polling/mib/ubnt-airfiber-mib.inc.php' ;
}
2015-04-21 11:37:47 +01:00
2015-07-13 20:10:26 +02:00
if ( $device [ 'os' ] == 'siklu' ) {
echo " It is Siklu \n " ;
include 'includes/polling/mib/siklu-mib.inc.php' ;
}
2015-04-21 11:37:47 +01:00
2015-09-11 18:40:51 +01:00
if ( $device [ 'os' ] == 'sub10' ) {
echo " It is Sub10 \n " ;
include 'includes/polling/mib/sub10-mib.inc.php' ;
}
2015-07-13 20:10:26 +02:00
// # GENERIC FRAMEWORK, FILLING VARIABLES
if ( $device [ 'os' ] == 'airport' ) {
echo 'Checking Airport Wireless clients... ' ;
2015-04-21 11:37:47 +01:00
2015-07-13 20:10:26 +02:00
$wificlients1 = ( snmp_get ( $device , 'wirelessNumber.0' , '-OUqnv' , 'AIRPORT-BASESTATION-3-MIB' ) + 0 );
2010-07-18 18:28:32 +00:00
2015-07-13 20:10:26 +02:00
echo $wificlients1 . " clients \n " ;
2010-07-18 18:28:32 +00:00
2015-07-13 20:10:26 +02:00
// FIXME Also interesting to poll? dhcpNumber.0 for number of active dhcp leases
}
2010-07-18 18:28:32 +00:00
2015-07-13 20:10:26 +02:00
if ( $device [ 'os' ] == 'ios' and substr ( $device [ 'hardware' ], 0 , 4 ) == 'AIR-' ) {
echo 'Checking Aironet Wireless clients... ' ;
2011-03-16 01:11:27 +00:00
2015-07-13 20:10:26 +02:00
$wificlients1 = snmp_get ( $device , 'cDot11ActiveWirelessClients.1' , '-OUqnv' , 'CISCO-DOT11-ASSOCIATION-MIB' );
$wificlients2 = snmp_get ( $device , 'cDot11ActiveWirelessClients.2' , '-OUqnv' , 'CISCO-DOT11-ASSOCIATION-MIB' );
2010-07-18 18:28:32 +00:00
2015-07-13 20:10:26 +02:00
echo (( $wificlients1 + 0 ) . ' clients on dot11Radio0, ' . ( $wificlients2 + 0 ) . " clients on dot11Radio1 \n " );
}
2011-03-16 01:11:27 +00:00
2016-01-14 20:09:18 +01:00
if ( $device [ 'os' ] == 'hpmsm' ) {
echo 'Checking HP MSM Wireless clients... ' ;
$wificlients1 = snmp_get ( $device , '.1.3.6.1.4.1.8744.5.25.1.7.2.0' , '-OUqnv' );
echo $wificlients1 . " clients \n " ;
}
2015-07-13 20:10:26 +02:00
// MikroTik RouterOS
if ( $device [ 'os' ] == 'routeros' ) {
// Check inventory for wireless card in device. Valid types be here:
$wirelesscards = array (
'Wireless' ,
'Atheros' ,
);
foreach ( $wirelesscards as $wirelesscheck ) {
if ( dbFetchCell ( 'SELECT COUNT(*) FROM `entPhysical` WHERE `device_id` = ?AND `entPhysicalDescr` LIKE ?' , array ( $device [ 'device_id' ], '%' . $wirelesscheck . '%' )) >= '1' ) {
echo 'Checking RouterOS Wireless clients... ' ;
$wificlients1 = snmp_get ( $device , 'mtxrWlApClientCount' , '-OUqnv' , 'MIKROTIK-MIB' );
echo (( $wificlients1 + 0 ) . " clients \n " );
break ;
}
unset ( $wirelesscards );
}
}
2011-03-16 01:11:27 +00:00
2015-07-13 20:10:26 +02:00
if ( $device [ 'os' ] == 'symbol' and ( stristr ( $device [ 'hardware' ], 'AP' ))) {
echo 'Checking Symbol Wireless clients... ' ;
2010-07-18 18:28:32 +00:00
2015-07-13 20:10:26 +02:00
$wificlients1 = snmp_get ( $device , '.1.3.6.1.4.1.388.11.2.4.2.100.10.1.18.1' , '-Ovq' , '""' );
2011-04-05 14:15:35 +00:00
2015-07-13 20:10:26 +02:00
echo (( $wificlients1 + 0 ) . ' clients on wireless connector, ' );
2011-04-05 14:15:35 +00:00
}
2011-09-08 13:36:32 +00:00
2015-07-13 20:10:26 +02:00
if ( isset ( $wificlients1 ) && $wificlients1 != '' ) {
2016-01-10 19:31:39 +10:00
$tags = array (
'rrd_def' => 'DS:wificlients:GAUGE:600:-273:1000' ,
'rrd_name' => array ( 'wificlients' , 'radio1' ),
'radio' => 1 ,
2015-08-18 16:26:55 +00:00
);
2016-01-10 19:31:39 +10:00
data_update ( $device , 'wificlients' , $tags , $wificlients1 );
2015-07-13 20:10:26 +02:00
$graphs [ 'wifi_clients' ] = true ;
2010-07-18 18:28:32 +00:00
}
2015-07-13 20:10:26 +02:00
if ( isset ( $wificlients2 ) && $wificlients2 != '' ) {
2016-01-10 19:31:39 +10:00
$tags = array (
'rrd_def' => 'DS:wificlients:GAUGE:600:-273:1000' ,
'rrd_name' => array ( 'wificlients' , 'radio2' ),
'radio' => 2 ,
2015-08-18 16:26:55 +00:00
);
2016-01-10 19:31:39 +10:00
data_update ( $device , 'wificlients' , $tags , $wificlients2 );
2015-07-13 20:10:26 +02:00
$graphs [ 'wifi_clients' ] = true ;
2010-07-18 18:28:32 +00:00
}
2015-07-13 20:10:26 +02:00
unset ( $wificlients2 , $wificlients1 );
} //end if
2010-07-18 18:28:32 +00:00
2015-07-13 20:10:26 +02:00
echo " \n " ;