librenms/LibreNMS/OS.php

328 lines
9.6 KiB
PHP
Raw Normal View History

feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
<?php
/**
* OS.php
*
* Base OS class
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
*
* @link https://www.librenms.org
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
* @copyright 2017 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
namespace LibreNMS;
use App\Models\Device;
use App\Models\DeviceGraph;
use DeviceCache;
use Illuminate\Support\Str;
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
use LibreNMS\Device\WirelessSensor;
use LibreNMS\Device\YamlDiscovery;
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
use LibreNMS\Interfaces\Discovery\MempoolsDiscovery;
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
use LibreNMS\Interfaces\Discovery\OSDiscovery;
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
use LibreNMS\OS\Generic;
use LibreNMS\OS\Traits\HostResources;
use LibreNMS\OS\Traits\UcdResources;
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
use LibreNMS\OS\Traits\YamlMempoolsDiscovery;
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
use LibreNMS\OS\Traits\YamlOSDiscovery;
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
class OS implements ProcessorDiscovery, OSDiscovery, MempoolsDiscovery
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
{
use HostResources {
HostResources::discoverProcessors as discoverHrProcessors;
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
HostResources::discoverMempools as discoverHrMempools;
}
use UcdResources {
UcdResources::discoverProcessors as discoverUcdProcessors;
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
UcdResources::discoverMempools as discoverUcdMempools;
}
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
use YamlOSDiscovery;
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
use YamlMempoolsDiscovery;
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
private $device; // annoying use of references to make sure this is in sync with global $device variable
private $graphs; // stores device graphs
private $cache; // data cache
private $pre_cache; // pre-fetch data cache
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
/**
* OS constructor. Not allowed to be created directly. Use OS::make()
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
*
* @param array $device
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
*/
private function __construct(&$device)
{
$this->device = &$device;
$this->graphs = [];
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}
/**
* Get the device array that owns this OS instance
*
* @return array
*/
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
public function &getDeviceArray()
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
{
return $this->device;
}
/**
* Get the device_id of the device that owns this OS instance
*
* @return int
*/
public function getDeviceId()
{
return (int) $this->device['device_id'];
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}
/**
* Get the Eloquent Device Model for the current device
*
* @return Device
*/
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
public function getDevice()
{
return DeviceCache::get($this->getDeviceId());
}
/**
* Enable a graph for this device
*
* @param string $name
*/
public function enableGraph($name)
{
$this->graphs[$name] = true;
}
public function persistGraphs()
{
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
$device = $this->getDevice();
$graphs = collect(array_keys($this->graphs));
// delete extra graphs
$device->graphs->keyBy('graph')->collect()->except($graphs)->each->delete();
// create missing graphs
$device->graphs()->saveMany($graphs->diff($device->graphs->pluck('graph'))->map(function ($graph) {
return new DeviceGraph(['graph' => $graph]);
}));
}
public function preCache()
{
if (is_null($this->pre_cache)) {
$this->pre_cache = YamlDiscovery::preCache($this);
}
return $this->pre_cache;
}
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
/**
* Snmpwalk the specified oid and return an array of the data indexed by the oid index.
* If the data is cached, return the cached data.
* DO NOT use numeric oids with this function! The snmp result must contain only one oid.
*
* @param string $oid textual oid
* @param string $mib mib for this oid
* @param string $snmpflags snmpflags for this oid
2021-03-31 15:18:43 +00:00
* @return array|null array indexed by the snmp index with the value as the data returned by snmp
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
*/
public function getCacheByIndex($oid, $mib = null, $snmpflags = '-OQUs')
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
{
if (Str::contains($oid, '.')) {
echo "Error: don't use this with numeric oids!\n";
return null;
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}
if (! isset($this->cache['cache_oid'][$oid])) {
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
$data = snmpwalk_cache_oid($this->getDeviceArray(), $oid, [], $mib, null, $snmpflags);
$this->cache['cache_oid'][$oid] = array_map('current', $data);
}
return $this->cache['cache_oid'][$oid];
}
/**
* Snmpwalk the specified oid table and return an array of the data indexed by the oid index.
* If the data is cached, return the cached data.
* DO NOT use numeric oids with this function! The snmp result must contain only one oid.
*
* @param string $oid textual oid
* @param string $mib mib for this oid (optional)
* @param int $depth depth for snmpwalk_group (optional)
2021-03-31 15:18:43 +00:00
* @return array|null array indexed by the snmp index with the value as the data returned by snmp
*/
public function getCacheTable($oid, $mib = null, $depth = 1)
{
if (Str::contains($oid, '.')) {
echo "Error: don't use this with numeric oids!\n";
return null;
}
if (! isset($this->cache['group'][$depth][$oid])) {
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
$this->cache['group'][$depth][$oid] = snmpwalk_group($this->getDeviceArray(), $oid, $mib, $depth);
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}
return $this->cache['group'][$depth][$oid];
}
/**
* Check if an OID has been cached
*
* @param string $oid
* @return bool
*/
public function isCached($oid)
{
return isset($this->cache['cache_oid'][$oid]);
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}
/**
* OS Factory, returns an instance of the OS for this device
* If no specific OS is found, Try the OS group.
* Otherwise, returns Generic
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
*
* @param array $device device array, must have os set
* @return OS
*/
public static function make(&$device)
{
$class = str_to_class($device['os'], 'LibreNMS\\OS\\');
d_echo('Attempting to initialize OS: ' . $device['os'] . PHP_EOL);
if (class_exists($class)) {
d_echo("OS initialized: $class\n");
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
return new $class($device);
}
// If not a specific OS, check for a group one.
if (isset($device['os_group'])) {
$class = str_to_class($device['os_group'], 'LibreNMS\\OS\\Shared\\');
d_echo('Attempting to initialize OS: ' . $device['os_group'] . PHP_EOL);
if (class_exists($class)) {
d_echo("OS initialized: $class\n");
return new $class($device);
}
}
d_echo("OS initialized as Generic\n");
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
return new Generic($device);
}
public function getName()
{
if (isset($this->device['os'])) {
return $this->device['os'];
}
$rf = new \ReflectionClass($this);
$name = $rf->getShortName();
2020-09-21 13:59:34 +00:00
preg_match_all('/[A-Z][a-z]*/', $name, $segments);
return implode('-', array_map('strtolower', $segments[0]));
}
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
/**
* Poll a channel based OID, but return data in MHz
*
* @param array $sensors
* @param callable $callback Function to modify the value before converting it to a frequency
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
* @return array
*/
protected function pollWirelessChannelAsFrequency($sensors, $callback = null)
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
{
if (empty($sensors)) {
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
return [];
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
$oids = [];
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
foreach ($sensors as $sensor) {
$oids[$sensor['sensor_id']] = current($sensor['sensor_oids']);
}
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
$snmp_data = snmp_get_multi_oid($this->getDeviceArray(), $oids);
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
$data = [];
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
foreach ($oids as $id => $oid) {
if (isset($callback)) {
$channel = call_user_func($callback, $snmp_data[$oid]);
} else {
$channel = $snmp_data[$oid];
}
$data[$id] = WirelessSensor::channelToFrequency($channel);
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}
return $data;
}
/**
* Discover processors.
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
*
* @return array Processors
*/
public function discoverProcessors()
{
$processors = $this->discoverHrProcessors();
if (empty($processors)) {
$processors = $this->discoverUcdProcessors();
}
return $processors;
}
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
public function discoverMempools()
{
if ($this->hasYamlDiscovery('mempools')) {
return $this->discoverYamlMempools();
}
$mempools = $this->discoverHrMempools();
if ($mempools->isNotEmpty()) {
return $mempools;
}
return $this->discoverUcdMempools();
}
public function getDiscovery($module = null)
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
{
if (! array_key_exists('dynamic_discovery', $this->device)) {
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
$file = base_path('/includes/definitions/discovery/' . $this->getName() . '.yaml');
if (file_exists($file)) {
$this->device['dynamic_discovery'] = \Symfony\Component\Yaml\Yaml::parse(file_get_contents($file));
}
}
Modernize mempools (#12282) * mempools to modern module quick hacky hrstorage port * port ucd-snmp-mib to Mempools * Populate DB for ucd Prep for yaml * initial yaml attempt * more complex conversions fixes to YamlDiscovery, make leading $ optional and allow mib::oid format * walk full tables and skip values normalize percentages above 100 * handle precent only ones (specify total as 100) * Move default polling out of YamlMempoolsDiscovery * fixes * Update test data hrstorage should be correct. * perc_warn for hrstorage * Host Resources, record buffer, cached, and shared * Host Resources is always better, don't do both HR and UCD * fix unix, include warning levels * variable size * consolidate skip_values * define mempools schema * number instead of integer * more schema refactor * one more skip_values reference * throw error for invalid oid translation aos6 * a* and Cisco * updated test data * update almost all hrstorage data files * b* * c* with test data use standard cache for hrStorage * use cache for storage module too * hand bsnmp properly * bdcom * exclude total oid from yaml so it is not polled May add a way to ignore this behavior and poll it, but I don't know if that is needed. * automatically handle percent only values * ciscowlc * only poll used or free if we have used, free, and total. * fix skipping * the dlinkoning fix find value when value "name" is numeric * support numeric oids * dnos/ftos attempt * I guess we can't filter on total > 0 * edgecos * e* * f WIP * f* * gwd (aka g*) * h* + procurve * i* * j* * m* * support 0% used memory (however unlikely) * n* * CISCO-PROCESS-MIB memory, share cache with processors module * ignore mempools with invalid total * p* * quanta * r* fix raisecom mibs terribly broken * s-z * style fixes * Move VRP back to PHP and make it actually work * fix zynos * update schema * Update Cisco processor data for description bug fixes * fix comware processors * comware mempools with memory size default precision to 1 * sophos-xg updated data * hrstorage use ram size for buffers, cache, and shared * Show memory available instead of free in device overview * UCD, use same rrd format, store available instead of free in the db. * Calculate availability for HOST-RESOURCES-MIB * Convert UCD to standard polling * rename old rrd files * initial graph work * graph WIP * Graph looking decent * Graph looking decent for hr * remove old ucd_graph code * handle availability mempool more graph cleanup * color adjustments * remove accidental free calculation * Update test data and fix corner cases * fis pfsense * update schema * add default value for mempool_class * fix whitespace * update schema * update schema correctly * one more time * fortigate_1500d-sensors missing oids * Update docs. * fix indent * add implements MempoolsDiscovery explicitly to OS * remove ucd_memory graph references remove unused device_memory graph * remove unused functions * set devices with mempools to rediscover to prevent/minimize gaps * use a subquery * add overview graph * port health mempools table * Update device mempool * only show overview if multiple * Don't override user set warn percentages in discovery * fix missed usage * fix style * Safety check to not rename rrd files incorrectly if migration has not been run. * Fix overview percent bar and represent available and used on the bar * missed an item to convert to mempool_class * percent on the wrong side
2020-11-23 21:35:35 +00:00
if ($module) {
return $this->device['dynamic_discovery']['modules'][$module] ?? [];
}
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
return $this->device['dynamic_discovery'] ?? [];
}
public function hasYamlDiscovery(string $module = null)
{
return $module ? isset($this->getDiscovery()['modules'][$module]) : ! empty($this->getDiscovery());
Convert OS discovery to new style (#12099) * terra * airos * port cisco os polling old wwan polling was broken and deprecated anyway * enterasys * Brother, a few changes * AW Plus * Fabos * set expected test data * 3com * Adva FSP150 * advantech * airos-af * aix * akcp * allied * allworx and missed mibs * anyos * fixup some zyxel shared stuffs zywall graph polling * aos * apc * apex * apsoluteos * fix copyrights * arris * arris * aruba-instant * ArubaOS * Ascom * asuswrt-merlin, ats * audiocodes * avocent * avtech * barracuda * binox * boss * canonprinter * cdata * ceraos * ciena-waveserver * fix 3com * fix airos * fix brother yaml? * fix aos more * fix and improve apc * fix arista test data * yaml discovery (basic) * cimc * mib not used * remove old discovery file * ciscosat * ciscosb fixes + improvements * comware * ctm * cumulus * cxr-ts * cyberoam-utm * cyberpower * dahua-nvr * dasan-nos * datadomain * dcn-software and fallback oids * dd-wrt * dell-laser * d* * e* and location * forti, post processing, oid coalescing * Freebsd array of sysDescr regex * finish f* * g* * h* * i* WIP * i* * Junos * j* * k* * unix refactor previous to yaml more inject $device * fixes * fixes * l* * m* * n* ability to set other fields in regex tnmsne polling to eloquent * o* * p* * q* + bonus calix * r* * s* WIP * s* * t* * u* * v* rework vrp to yaml (hybrid) * w* * x* * z* * a* easy no-data * fixes * style fixes * missed ApexPlus * fix signature * Add missing location data * rename getDevice functions * add new cisco ftd data * update docs * revert sill snmp format * fix snmp options * update for new smartax test data * rebase dsm * fix voss
2020-09-18 13:12:07 +00:00
}
feature: Wireless Sensors Overhaul (#6471) * feature: Wireless Sensors Includes client counts for ios and unifi Graphing could use some improvement. Alerting and threshold ui not implemented WIP: starting OO based wireless sensors. Class based functionality working remove old functional files add schema file discovery needs to be enabled, not polling fix up schema fix Unifi discovery not returning an array Add some debug when discovering a sensor. Fix style. Add missing semicolin Add a null object (Generic) for OS. Fill out some phpdocs Re-organized code Each sensor type now has it's own discovery and polling interface Custom polling tested with Unifi CCQ Left to do: Implement UI (Graphs and Custom thresholds) Alerting Testing Fix event message text Remove runDiscovery and runPolling from OS, they are unused and don't belong there. Cleanups/docs Missed this file. Remove the requirement to fetch the current value to check validity. Do that automatically if current is not specified A few cleanups here and there First pass at graphing. device_ and wireless_ graphs added. Add RouterOS support Singleton OS instance isn't required right now. Remove that to allow some memory to be freed. Add wireless to the device list metrics. Make all metrics clickable Tweak graphs a bit Implement limit configuration page. Use sensors page as common code instead of duplicating. Clean up some javascript interactions: Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value. Add some wireless alert rules to the library. Add documentation. Add unifi client counts by ssid in addition to radio. Optimize Sensor polling a bit. Add HP MSM clients support (for full controller) Fix function accessibility Formalize the discovery and poller interfaces. Add Xirrus clients and noise floor move module interfaces to a more appropriate place. push caching code up to os, unsure about this do to the limitations No point in selectively enabling wireless discovery. We only discover if the device supports something. Add RSSI, Power, and Rate. Add these sensors for Ubnt Airos. Clean up some copyrights. Reduce the amount of files need to add new types. Leave graph files for consistency and to allow customization. Remove the old wifi clients graph completely. ciscowlc should have improved counts (total and per-ssid) Schema didn't get added. Impelement the rest of the AirOS sensors Reformat and re-organize the Airos.php class. Add several UBNT AirFiber sensors A few fixes add links to the section headers Add HP MSM mibs. * Schema file got dropped in rebase. * Add wireless menu to view sensors across all devices. Icons in the menu need help :/ * Add HeliOS, Mimosa, and Siklu support Sensors added SNR + Noise * Add power and utilization to Unifi * Update polling to prefetch all sensor data in a few snmp requests as possible * Add Extendair: tx+rx power, aggregate rate, frequency * Add a check for duplicate sensors in discovery. Just print an error for now. * Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed) Fix an incorrect link in the wireless sensors table * Add error rate and change all bps and Hz to use si units * Fixes to limits and frequency display * Fix overview graph frequency display A few decimal place tweaks * Don't allow switching sensor and wireless-sensor graphs, it doesn't work. Change individual distance graphs to use si units * Go through the OS and make sure I got all the sensors I can (probably missed some still) Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS. Message to help developers adding supports that don't return an array from discover functions. * Fix some issues * Remove noise and signal for now at least A couple more fixes Add a notification * Oopsie * Bonus AirFiber sensors
2017-05-02 04:49:11 +00:00
}