1<?php
2
3/**
4 * Observium
5 *
6 *   This file is part of Observium.
7 *
8 * @package    observium
9 * @subpackage poller
10 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
11 *
12 */
13
14if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['type'] == 'wireless')
15{
16  print_cli_data_field("MIBs", 2);
17
18  foreach (dbFetchRows("SELECT * FROM `wifi_radios` WHERE `device_id` = ?", array($device['device_id'])) as $radio)
19  {
20    $GLOBALS['cache']['wifi_radios'][$radio['radio_ap']][$radio['radio_number']] = $radio;
21  }
22
23  foreach (dbFetchRows("SELECT * FROM `wifi_wlans` WHERE `device_id` = ?", array($device['device_id'])) as $wlan)
24  {
25    $GLOBALS['cache']['wifi_wlans'][$wlan['wlan_index']] = $wlan;
26  }
27
28  foreach (dbFetchRows("SELECT * FROM `wifi_aps` WHERE `device_id` = ?", array($device['device_id'])) as $aps)
29  {
30    $GLOBALS['cache']['wifi_aps'][$aps['ap_index']] = $aps;
31  }
32
33  $include_dir = "includes/polling/wifi";
34  include("includes/include-dir-mib.inc.php");
35
36  /// FIXME : everything below this point is horrible shit that needs to be moved elsewhere. These aren't wireless entities, they're just graphs. They go in graphs.
37
38  /// FIXME. Move this to MIB based includes
39  if ($device['os'] == 'trapeze')
40  {
41    echo("Checking Trapeze Wireless clients... ");
42    $wificlients1 = snmp_get($device, "trpzClSessTotalSessions.0", "-OUqnv", "TRAPEZE-NETWORKS-CLIENT-SESSION-MIB");
43    echo($wificlients1 . " clients\n");
44  }
45
46  # Senao/Engenius
47  if ($device['os'] == 'engenius')
48  {
49    echo("Checking Engenius Wireless clients... ");
50
51    $wificlients1 = count(explode("\n",snmp_walk($device, "entCLInfoIndex", "-OUqnv", "SENAO-ENTERPRISE-INDOOR-AP-CB-MIB")));
52
53    echo(($wificlients1 +0) . " clients\n");
54  }
55
56  if ($device['os'] == 'symbol' AND (stristr($device['hardware'],"AP")))
57  {
58    echo("Checking Symbol Wireless clients... ");
59
60    $wificlients1 = snmp_get($device, ".1.3.6.1.4.1.388.11.2.4.2.100.10.1.18.1", "-Ovq", "\"\"");
61
62    echo(($wificlients1 +0) . " clients on wireless connector, ");
63  }
64
65  // RRD Filling Code
66  if (isset($wificlients1) && is_numeric($wificlients1))
67  {
68    rrdtool_update_ng($device, 'wificlients', array('wificlients' => $wificlients1), 'radio1');
69
70    $graphs['wifi_clients'] = TRUE;
71  }
72
73  if (isset($wificlients2) && is_numeric($wificlients2))
74  {
75    rrdtool_update_ng($device, 'wificlients', array('wificlients' => $wificlients2), 'radio2');
76
77    $graphs['wifi_clients'] = TRUE;
78  }
79
80  if (isset($wifi_ap_count) && is_numeric($wifi_ap_count))
81  {
82    rrdtool_update_ng($device, 'wifi_ap_count', array('value' => $wifi_ap_count));
83
84    $graphs['wifi_ap_count'] = TRUE;
85  }
86
87  unset($wificlients2, $wificlients1, $wifi_ap_count);
88}
89
90// EOF
91