Commit Graph

24 Commits

Author SHA1 Message Date
Tony Murray 61c89794e4
Remove debug globals (#12811)
* Remove $debug global
and $vdebug global
makes these variables more accessible and protects from collisions.

* the on boot set sends application as the first parameter, just handle that

* Relocate other debug related functions

* Log debug to stdout

* Wrong output

* remove stupid constants

* Fix lint and style issues
2021-04-29 22:42:18 -05:00
Jellyfrog 0d56bbd946
Apply fixes from StyleCI (#12123) 2020-09-21 15:51:53 +02:00
Jellyfrog 77c531527c
Apply fixes from StyleCI (#12117)
* Apply fixes from StyleCI

* Disable style check
2020-09-21 14:54:51 +02:00
Tony Murray c7c7b57de4
Always boot Laravel (#9842)
* Always boot Laravel
That way we can depend on it being available.
Saves us crashes if some code accidentally uses something that isn't booted and a lot of silly if/elses.

* ignore init php errors
2019-03-14 08:06:27 -05:00
Tony Murray 4c6f917d9e Updates to snmptrap handling (#9010)
* Updates to snmptrap handling
fix a bug in findDeviceByIP.  Add more tests for that.
Move handle outside of the Trap class, it doesn't fit.
Add developer docs.

* fix tests copy paste issue.

* Fix findByIp when port may not exist.

* Logging: Output context (and extra) if they exist

* Generic trap event logging and new config setting.
2018-08-14 07:56:16 +01:00
TheGreatDoc 9940c884f5 Fixed snmptraps. (#8898)
* Fixed snmptraps.

* Fixed space

* Added bgp down/up and authentication failure

* Fixed typo

* Fixed some typos, arrays, astext and format_hostname

* Updated documentation

* Moved code to a function

* Some refactor

* Minor fixes

* Minor fixes 2

* More minor fixes

* Changes requested by Tony

* Minor fixes

* Moved include to snmptrap.php

* Refactor traps to use object oriented code.

Should trigger events too/instead, but we'll leave that.
Testing todo

* Add tests and fix things so they actually work
Not checking events yet.

* Fixed typo and severity level

* Update composer deps, I think the lock file wasn't right.
add json and mbstring extension deps while I'm at it.

* Fix several issues with phpunit fixtures
2018-08-11 16:37:44 -05:00
Tony Murray eeb3d58f5b Improved Logging and Debugging (#8870)
Use Log facility when Laravel is booted.
Update init.php so we can easily boot Laravel for CLI scripts. (and just Eloquent, but that may go away)
Move all debug setup into set_debug() function and use that across all scripts.
Log Laravel database queries.
Send debug output to librenms log file when enabling debug in the webui.
Allow for colorized Log CLI output. (currently will leave % tags in log file output)

** Needs testing and perhaps tweaking still.

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-07-13 23:08:00 +01:00
Tony Murray 9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
Tony Murray d2193f76ca feature: allow scripts to be run from any working directory (#4437)
* feature: allow validate.php to be run from any working directory

* remove redundant realpath() call

* re-add realpath() to remove symbolic links

* realpath() isn't needed...

* chdir() in all php scripts in ./ and ./scripts/

* update-sql.php clearly is not used, as it was broken.

* Change some scripts to executable
Remove extra chdir() call in snmp-scan.php

* Missed console-ui.php
Kind of fixed console-ui.php help output

* Re-add newline
2016-09-14 16:53:04 +01:00
Neil Lathwood 7dec670494 refactor: Updated a lot of references to LibreNMS - copyright still left intact (#4339) 2016-09-08 08:12:23 -05:00
Tony Murray abc6a5b799 PSR-2 Final cleanup (#4247)
refactor: Final PSR2 cleanup
2016-08-28 23:32:55 +01:00
Job Snijders ebd0f6fc35 Apply "Squiz" code style on old (pre-2014) files 2015-07-11 16:12:35 +02:00
Tyler Christiansen 63d428c0e1 Revert "update copyright notice" after discussion with Paul
This reverts commit 774233327e.
2013-10-28 12:01:36 -07:00
Tyler Christiansen 774233327e update copyright notice 2013-10-28 01:46:59 -07:00
Adam Amstrong 4db1454e92 move from port_id to interface_id. make ports discovery only discover. add some cleaner functions. add a tiny bit of alerting infrastructure.
git-svn-id: http://www.observium.org/svn/observer/trunk@3195 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-16 13:25:50 +00:00
Adam Amstrong dbf212f652 phpDocumentator headers. retire static-config. IF YOU ARE READING THIS, REMOVE IT FROM THE BOTTOM YOUR CONFIG.PHP. YES. YOU.
git-svn-id: http://www.observium.org/svn/observer/trunk@3150 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-09 10:01:42 +00:00
Adam Amstrong 45c6d95501 add infrastructure to collect status of cisco catalyst 6k crossbar and new state table for entity-mib
git-svn-id: http://www.observium.org/svn/observer/trunk@2723 61d68cd4-352d-0410-923a-c4978735b2b8
2011-11-14 18:28:00 +00:00
Adam Amstrong c086264fc2 more db*
git-svn-id: http://www.observium.org/svn/observer/trunk@2302 61d68cd4-352d-0410-923a-c4978735b2b8
2011-05-13 12:39:56 +00:00
Tom Laermans f55a30f744 some formatting cleanups, introduce some more FIXMEs to look at, plus replace mysql_fetch_array by mysql_fetch_assoc, for great justice
git-svn-id: http://www.observium.org/svn/observer/trunk@2029 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-06 13:54:50 +00:00
Tom Laermans 39dc6e9053 update changelog, clean up files
git-svn-id: http://www.observium.org/svn/observer/trunk@1893 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-16 22:04:29 +00:00
Adam Amstrong cd76567edb ginger patch
git-svn-id: http://www.observium.org/svn/observer/trunk@1699 61d68cd4-352d-0410-923a-c4978735b2b8
2010-09-03 18:26:59 +00:00
Tom Laermans fca6fafb60 include defaults.php before config.php, not FROM config.php
git-svn-id: http://www.observium.org/svn/observer/trunk@966 61d68cd4-352d-0410-923a-c4978735b2b8
2010-02-27 14:44:38 +00:00
Adam Amstrong 0bee34b6ad change interfaces table to ports (to match GUI conventions)
git-svn-id: http://www.observium.org/svn/observer/trunk@889 61d68cd4-352d-0410-923a-c4978735b2b8
2010-02-20 17:22:22 +00:00
Adam Amstrong 09e22b2f63 adding SNMP trap handling capability (yes it is horrible horrible right now!)
git-svn-id: http://www.observium.org/svn/observer/trunk@880 61d68cd4-352d-0410-923a-c4978735b2b8
2010-02-17 11:02:18 +00:00