Commit Graph

194 Commits

Author SHA1 Message Date
Tony Murray
4a03e7838e feature: Save application metrics to db for alerting (#7828)
* feature: save application metrics to db for alerting
However, alerting will not work because ResolveGlues() is broken.
Can add workaround after state_translations alerting is merged

Does not update all applications yet, not sure if that should be done here or in another PR.

Introduces two handy functions dbDeleteOrphans() and array_by_column().  Will replace those in other locations after this is merged or separate them out if this is not merged.

* remove accidental inclusions

* Add db schema
2017-12-01 07:53:26 +00:00
Neil Lathwood
ba51dc263e refactor: Only update sensor/bgp tables when values are changed (#7707)
* refactor: Only update sensor table when sensor values are changed

* included bgp peers in as well

* updated with comments from github
2017-11-20 12:37:02 -06:00
Zmegolaz
f8d7ccfe0d feature: Support for up/down detection of ping only devices.
* Added support for ping only devices.

* Renamed sql-schema/206 to 207.

* Discovery tried to detect the OS when it shouldn't.

* Updated db_schema.yaml

* Added ping icon.

* Don't show unused graphs and tabs when SNMP is disabled.

* Allow the user to specify OS of ping only devices.

* Removing custom OS now changes it to 'ping'.

* Removed unnecessary use of mres().

* UI select box for SNMP enable/disable.

* Hide device_ping_perf if ping is disable on device.

* Fixed SNMP settings update status messages.

* Added functionality to add ping only devices via the web ui.

* Added ping only option to addhost.php

* Added ping only support to snmp-scan.py

* Moved sql 208 to 211

* Fixed scrutinizer issues.

* Fixed broken ossearch.

* Added ping only support to the API.

* Updated API doc.

* Added (optional) to OS and hardware description. Hid Port Settings, Applications, Modules, Storage, Processors, Memory and Components from the edit menu

* Style fix.

* Updated ping icon.

* clean() instead of mres(). More escaping. Better help in snmp-scan.py and addhost.php

* Fixed scrutinizer issue.

* Always try SNMP in snmp-scan.py, new option for it in addhost.php. Slice instead of chunk in ajax_ossuggest.php. Other minor style changes.

* Updated sql modifications to insert the new column in the same place as in db_schema.yaml.
2017-10-27 22:59:25 -05:00
Neil Lathwood
592e8aca4c newdevice: Added sensor detection for APC In Row RD devices (#7385)
* newdevice: Added sensor detection for APC In Row RD devices

* Update apc.yaml

* Update apc.yaml

* Update cooling.inc.php

* Update pressure.inc.php
2017-09-29 21:13:27 +01:00
Tony Murray
b4d804f2ac fix: rfc1628 runtime - allow os quirks (#7340)
* fix: rfc1628 runtime - allow os quirks
Also, properly divide values at discovery
Remove accidental debug output
2017-09-14 21:55:07 +01:00
Neil Lathwood
f7e14df90e newdevice: Updated Arista entity-physical support to use high/low values from device (#7156)
* fix: Fixed the high/low thresholds for Arista devices

* final updates

* push threshold changes

* more updates

* another update

* updated entity-sensor for current value calc

* hoping final update
2017-09-07 08:49:32 -05:00
Tony Murray
c8436d2a4f fix: issues with Geist Watchdog
miss-named variable in sensor pre-caching
internal humidity and temperature was discovered twice
humidity was mis-spelled in yaml discovery
temperature and current had incorrect divisor in yaml

remove redundant fahrenheit to celsius function

fixes #7236
2017-08-28 13:00:29 -05:00
Tony Murray
123a90feab feature: Log event if device polling takes too long (#7065)
Move $device_time closer to end of poll_device(), and simplify
remove some unused variables
simplify $device_time in discover_device() too
2017-07-21 23:01:59 +01:00
Tony Murray
81617e8422 Include the sensor state description in the eventlog (#6977) 2017-07-07 18:15:53 +01:00
Tony Murray
aeedf515c5 fix: Include state descriptions in eventlog (#6968)
* fix: include state descriptions in eventlog
Pull in array_column compat library for php < 5.5

* Add state descriptions to eventlog messages
2017-07-06 08:27:02 +01:00
Neil Lathwood
d48be5f507 newdevice: Added detection for Cisco EPC devices (#6690)
* newdevice: Added detection for Cisco EPC devices

* updated test file

* added dbm support

* added snr support
2017-05-23 10:28:44 -05:00
Neil Lathwood
895801d855 newdevice: Added more health information for APC units (#6619)
* fix: Fixed apc state support emsOutput

* newdevice: Added more health information for APC devices

* update schema file

* schema file renamed
2017-05-17 22:41:53 +01:00
Neil Lathwood
1ce58cd33d feature: Added functionality to support recording status info (#6628)
* feature: Added functionality to support recording status info

* updated phpdoc block
2017-05-13 06:55:38 -05:00
Tony Murray
4c0412b14d 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-01 23:49:11 -05:00
Neil Lathwood
98e8e7e407 fix: Compare existing device ip to host lookup like for like (#6316) 2017-04-01 22:17:32 +01:00
crcro
716441eeda fix: cisco 4948 device information 2017-03-21 09:11:42 -05:00
barryodonovan
d53f666221 ensure mib-name passed as parameter (#6135)
* ensure mib-name passed as parameter

* use str_contains instead of stristr
2017-03-11 08:42:57 -06:00
Neil Lathwood
66d1006d91 feature: Added app_state support for applications #5068 (#6061)
* feature: Added app_state support for applications #5068

* moved schema file 173 -> 174

* Re-arrange code

* added device_id to dbUpdate call

* updated function + missing apps

* Rename 174.sql to 176.sql

* Remove $device, it is unneeded when updating.  Rename update_applications() -> update_application()

* Some apps can return simply 0
2017-03-11 08:39:32 -06:00
barryodonovan
11e52b5e69 refactor: Mib poll def to seperate MIB name from RRD name (#6028)
* extended poll_mib_def() to take rrd_name as optional parameter

* removed tabs

* refactored to use
2017-03-01 19:35:48 +00:00
barryodonovan
853dd1e138 extended poll_mib_def() to take rrd_name as optional parameter (#5993)
* extended poll_mib_def() to take rrd_name as optional parameter

* removed tabs
2017-02-24 18:42:17 +00:00
Neil Lathwood
6a8318b7ec refactor: Updated storing of sensors data to be used in unix-agent #5904 (#5923)
* refactor: Updated storing of sensors data to be used in unix-agent #5904

* updated from scrut output

* another scrut update

* added missing dbUpdate

* small change

* small change
2017-02-23 19:25:05 -06:00
Neil Lathwood
fad5aca1b7 feature: Allow customisation of rrd step/heartbeat when creating new rrd files (#5947)
* feature: Allow customisation of rrd step/heartbeat when creating new rrd files

* revert defaults

* added docs + webui config option

* Move RrdDefinition to an Object to make them easier to create and remove the possibility of typos.

* Fix style/lint issues and missing use statements

* 3 more missing use statements

* updated doc + moved schema file
2017-02-23 22:45:50 +00:00
Robert Verspuy
8b2bc22272 Fixed a few small bugs, introduced by the Poller tidy up of laf (#5930)
* Fix for #5734 - incorrect hostname in the mouse-over of the services in the availability-map

* Fixed a few small bugs, introduced by the Poller tidy up of laf
2017-02-17 08:51:48 +00:00
Neil Lathwood
38168832a6 refactor: Centralise device up/down check and use in disco #5862 (#5897)
* refactor: Centralise device up/down check and use in disco #5862

* Remove extra indentation
2017-02-15 15:22:09 +00:00
Richard Mayhew
e4f48e661e Add additional eventlog severity levels (#5879) 2017-02-13 22:32:02 +00:00
Richard Mayhew
5bfd23e7eb webui: New eventlog severity classification (#5830)
* New event log severity model

* Revert "New event log severity model"

This reverts commit 0783527af8.

* New event log severity model

* Fixed spaces vs tabs

* Learning the format requirements

* Learning the format requirements

* Moved the colours in to the stylesheet

* change SQL file to stop conflicting

* refactor log_event so severity isn't last, but reference is.

* keep having to move the file due to new PR conflicts

* Revert "keep having to move the file due to new PR conflicts"

This reverts commit f3030e7218.

* extended support to dashboard and eventlog page

* formatting
2017-02-12 22:41:05 +00:00
Neil Lathwood
55843eba74 fix sensors db update call (#5842) 2017-02-09 09:23:03 +00:00
Neil Lathwood
21898a3c29 Disco / Poller tidy up + Added display of module mem usage (#5778)
* tidyup + added mem usage for poller modules

* tidied up discovery modules

* fix sensors
2017-02-07 22:54:30 -06:00
Neil Lathwood
a19b2614dc fix: added some timeout safeguards for curl calls (#5743) 2017-02-03 08:12:42 -06:00
Richard Mayhew
76c91f8486 fixed sanitizing of google map information (#5738) 2017-02-03 09:26:04 +00:00
Richard Mayhew
08edfc60e0 Sanitize Location string (#5589) 2017-01-26 08:11:11 +00:00
Tony Murray
56bb0d2b97 fix: support hosts added by ipv6 without DNS #5567 2017-01-24 21:48:03 +00:00
Neil Lathwood
32da1bceea fix: Changing device type now is persistant (#5529) 2017-01-22 09:49:13 +00:00
Neil Lathwood
8557f2df41 newdevice: APC Environmental monitoring units #5140 2017-01-18 08:48:33 +00:00
Tony Murray
b3f6218359 fix: os type and group not being set (#5357) 2017-01-09 08:16:09 +00:00
Neil Lathwood
cc8e31d1a1 newdevice: Added support for Dasan NOS #5179 + disco change (#5255)
* newdevice: Added support for Dasan NOS #5179

* sysName -> sysDescr - doh

* updated functions

* Updated discovery of OS functions

* added missing test units

* mibs added

* Allow multiple regex statements per sysDescr_regex

* Fix style/code issues

* added docs
2017-01-03 14:04:18 -06:00
Neil Lathwood
f5a16be0e3 refactor: Move OS definitions into yaml files (#5189) 2016-12-23 17:53:19 +00:00
David Bell
e67572cfb7 fix: Add check for differently named Cisco Power sensor (#5119) 2016-12-07 00:30:56 +00:00
Tony Murray
db240cb4eb refactor: Collection and output of db and snmp stats (#5049) 2016-11-23 06:57:19 +00:00
Tony Murray
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
Tony Murray
a83e126b40 refactor: Remove inappropriate usages of truncate() (#5028)
Where truncate() is used as substr(), replace with substr()
2016-11-20 11:12:25 +00:00
Vitali Kari
8841eece94 feature: Adds support for enabling / disabling modules per OS (#4963)
* fixes #4946
first try, should be checked first
only discovery first

* add OS modules status indication

* add debug output
add os poller module support

* fix some whitespaces

* fix missing semicolon

* fix some whitespaces

* Modify the modules page

It now shows unset for unset device settings.
Also, `$os_module_status = $config['os'][$device['os']]['poller_modules'][$module];` doesn't work like you would expect. Fix that behavior.

* Fix mangled tabs

* optimize debug output
add docs

* text highlighting

* Streamline docs #1
* Update docs
* Spell out Global, OS, Device.
2016-11-13 13:46:05 -06:00
Neil Lathwood
499b05f0f5 fix: Do not create rrd folder when -r is specified for poller (#4812) 2016-10-16 21:45:39 -05:00
Neil Lathwood
009281773f Updated poll_device and os module to prettify output (#4740)
* Updated poll_device and os module to prettify output

* Move line return
2016-10-13 20:41:53 -05:00
crcro
b867d3dd05 fix: apc load, runtime and current sensors (#4780)
fix: APC load, runtime and current sensors
2016-10-13 19:03:46 +03:00
Neil Lathwood
6c324cd03e refactor: Improve sensors polling for performance increase (#4725)
refactor: Improve sensors polling for performance increase
2016-10-11 19:34:09 +03:00
Tony Murray
edbb6ae0e3 refactor: Centralize MIB include directory specification (#4603)
* refactor: Centralize MIB include directory specification
The default is now:
```
$config['mib_dir'].'/mibdirname:'.$config['mib_dir']
```
This means we exclude OS mibs and only use ours  (we could prepend `+` if we want to include os mibs.
All snmp calls should only include the name of the subdirectory under the mibs directory.

* Remove d_echo from Proc
Fix snmpsim tests.
2016-09-28 14:19:28 +01:00
boudreau
8dbc9b4809 Update functions.inc.php 2016-09-19 11:09:29 -04:00
Neil Lathwood
16a47ac5e9 fix: Use isset for checking poller option (#4291) 2016-08-31 09:23:35 -05:00
Tony Murray
9284bc60ff Update code in includes to be PSR-2 compliant (#4220)
refactor: Update code in /includes to be psr2 compliant #4220
2016-08-28 18:32:58 +01:00