mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add mikrotik wifi clients + generic fix by falz
git-svn-id: http://www.observium.org/svn/observer/trunk@2027 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
echo("Wireless: ");
|
echo("Wireless: ");
|
||||||
|
|
||||||
if ($device['type'] == 'network')
|
if ($device['type'] == 'network' || $device['type'] == 'firewall')
|
||||||
{
|
{
|
||||||
##### GENERIC FRAMEWORK, FILLING VARIABLES
|
##### GENERIC FRAMEWORK, FILLING VARIABLES
|
||||||
if ($device['os'] == 'airport')
|
if ($device['os'] == 'airport')
|
||||||
@@ -26,8 +26,29 @@ if ($device['type'] == 'network')
|
|||||||
echo(($wificlients1 +0) . " clients on dot11Radio0, " . ($wificlients2 +0) . " clients on dot11Radio1\n");
|
echo(($wificlients1 +0) . " clients on dot11Radio0, " . ($wificlients2 +0) . " clients on dot11Radio1\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
##### RRD Filling Code
|
#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)
|
||||||
|
{
|
||||||
|
$query = "SELECT COUNT(*) FROM `entPhysical` WHERE `device_id` = '" . $device['device_id'] . "' AND `entPhysicalDescr` LIKE '%" . $wirelesscheck . "%'";
|
||||||
|
if (mysql_result(mysql_query($query),0) >= "1")
|
||||||
|
{
|
||||||
|
echo("Checking RouterOS Wireless clients... ");
|
||||||
|
|
||||||
|
$wificlients1 = snmp_get($device, "mtxrWlApClientCount.10", "-OUqnv", "MIKROTIK-MIB");
|
||||||
|
|
||||||
|
echo(($wificlients1 +0) . " clients\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
unset($wirelesscards);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
##### RRD Filling Code
|
||||||
if (isset($wificlients1) && $wificlients1 != "")
|
if (isset($wificlients1) && $wificlients1 != "")
|
||||||
{
|
{
|
||||||
$wificlientsrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("wificlients-radio1.rrd");
|
$wificlientsrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("wificlients-radio1.rrd");
|
||||||
@@ -71,4 +92,4 @@ if ($device['type'] == 'network')
|
|||||||
|
|
||||||
echo("\n");
|
echo("\n");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -690,9 +690,9 @@ $device_types = array('server', 'network', 'firewall', 'workstation', 'printer',
|
|||||||
|
|
||||||
$config['graph_sections'] = array('system', 'firewall', 'netstats', 'wireless', 'storage');
|
$config['graph_sections'] = array('system', 'firewall', 'netstats', 'wireless', 'storage');
|
||||||
|
|
||||||
$config['graph_types']['device']['aironet_wifi_clients']['section'] = 'wireless';
|
$config['graph_types']['device']['wifi_clients']['section'] = 'wireless';
|
||||||
$config['graph_types']['device']['aironet_wifi_clients']['order'] = '0';
|
$config['graph_types']['device']['wifi_clients']['order'] = '0';
|
||||||
$config['graph_types']['device']['aironet_wifi_clients']['descr'] = 'Wireless Clients';
|
$config['graph_types']['device']['wifi_clients']['descr'] = 'Wireless Clients';
|
||||||
|
|
||||||
$config['graph_types']['device']['cipsec_flow_bits']['section'] = 'firewall';
|
$config['graph_types']['device']['cipsec_flow_bits']['section'] = 'firewall';
|
||||||
$config['graph_types']['device']['cipsec_flow_bits']['order'] = '0';
|
$config['graph_types']['device']['cipsec_flow_bits']['order'] = '0';
|
||||||
|
|||||||
Reference in New Issue
Block a user