199 Commits

Author SHA1 Message Date
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
846cf11331 Support specifying submodules in poller and discovery for debug (#8896)
Mostly useful for debugging

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-12 21:30:39 +01:00
33887417ee discovery.php: don't exit(5) without new devices discovered (#8893)
Don't exit with a non-zero value in case no new devices were discovered, as non-zero codes are considered failed jobs for most cron implementations and produce logs like the following (in Debian):

```
cron.info CRON[963890]: (CRON) error (grandchild #963892 failed with exit status 5)
``` 

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-10 21:41:24 +01:00
0ba76e6d62 New python service for poller, discovery + more (#8455)
Currently has a file handle leak (and will eventually run out of handles) related to the self update process.

Either need to fix that or rip out self-update and leave that up to cron or something.


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-06-30 12:19:49 +01:00
ecbbc0e3e5 feature: Clear OS defs cache on poller/discovery debug (#8061) 2018-01-09 10:51:26 -06:00
2e73b75297 fix: Use memcached to lock daily processes on Distributed Pollers (#7735)
* fix: use memcached to lock daily processes on Distributed Pollers

* All the locks!
2017-11-24 09:37:52 +00:00
9113f81272 fix: Allow discovery to check if devices are down before skipping (#7780)
* fix: allow discovery to check if devices are down before skipping
We could also exclude snmp_disable devices from SQL query, worthwhile?

* also skip ping only devices
2017-11-23 08:31:15 +00:00
54b476c769 fix: devices detected as ibmtl or generic (#7618)
* fix: devices detected as ibmtl
Guess at the sysObjectID, please report if you have devices that should be ibmtl and are no longer detected.
Add output of os in discovery.

* Always load all os for discovery.  Should be cached most of the time.
2017-11-03 16:10:24 -05:00
51ba934e11 feature: Added web validation (#7474)
* refactor: convert validations to modules to prep for gui integration

* accidentally dropped, schema update

* fix accidental output to webui

* mention discovery-wrapper.py and re-arrange.

* refine some fix statements

* rename the Config validation group to Configuration.

* fix some scrutinizer issues
remove as many local functions from validator.php as possible
move extensions from pre-check
remove duplicate timezone check
looks like there is some db schema differences between mariadb 10.1 and 10.2, investigating

* mariadb version diff take2

* Check schema version first for database.
Remove stop to go back to command line for install docs.
Add helpful link when there is no devices added to /addhost

* fix incorrect validation for empty string defaults

* Fix style

* Add additional file permissions checks

* catch exception and fail for invalid timezone
Change visuals a bit.

* add php version warning

* fix space
2017-10-26 07:56:09 +01:00
181b0fb7d5 refactor: Use the new locks for schema updates (#6931)
* Use the new locks for schema updates

* removed schema lock from discovery

* Add the ability to wait for a lock.
Add unit tests

* Add MysqlLock
Use that for the schema updates
Wait up to 30s for other schema updates to complete.

* Switch the schema lock back to a file lock for now.
Make FileLock support indefinite locking without polling.
Add a warning to MysqlLock for scenarios where it won't work.

* Delete MysqlLock.php

* Removed MySQL lock tests
2017-07-17 19:35:08 +01:00
701fbbc29b feature: Add a new locking framework that uses flock. (#6858)
Change locks to use flock, as pid checking is not
sufficient when PID Namespaces are involved.
2017-07-02 23:44:36 -05:00
b6e18db766 fix: page/graph load speed: part 1 (#6611)
* fix: page/graph load speed: part 1
Speed up load_all_os() by caching the full $config['os'] array
Function time goes from 1.13648s -> 0.00073s
The cache is updated during discovery, but only if it is >22hrs old.
Additionally, the cache is not used and a full yaml load is forced if the cache is >24hrs old.
The cache time is controlled by $config['os_def_cache_time'], I don't see any reason anyone would change that time.

* Delete Session.php

* Include the cache directory.
2017-05-10 08:57:10 +01:00
5f6279d28c refactor: Added lock support to ./discovery.php -h new to prevent overlap (#6568) 2017-05-03 20:23:45 -05:00
41e7689c77 refactor: DB Updates will now file level lock to stop duplicate updates (#6469)
* refactor: DB Updates will now file level lock to stop duplicate updates

* scrut fixes

* renamed function from clear_lock() to release_lock()
2017-05-03 14:48:23 +01:00
374a4041af fix: inconsistent device discovery (#6518)
There were two or more separate $device arrays during discovery. When one was updated, others were not.
Combine those all.
Make sure the new os is loaded if the os changed.
2017-04-28 22:50:00 +01:00
153f0de12f fix: Actually reload oxidized when we should not when we think we should (#6515) 2017-04-27 22:31:48 -05:00
d49e893a0a move version info into debug to save exec calls under normal use (#6407) 2017-04-22 08:10:15 -05:00
d5296319fb refactor: MySQL strict and query fixes (#5338)
* refactor: MySQL strict and query fixes

* moved sql file
2017-01-13 06:47:16 -06:00
db240cb4eb refactor: Collection and output of db and snmp stats (#5049) 2016-11-23 06:57:19 +00:00
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
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
7dec670494 refactor: Updated a lot of references to LibreNMS - copyright still left intact (#4339) 2016-09-08 08:12:23 -05:00
abc6a5b799 PSR-2 Final cleanup (#4247)
refactor: Final PSR2 cleanup
2016-08-28 23:32:55 +01:00
be9db5a19e Update discovery.php 2016-02-24 12:48:22 -08:00
laf
0558275414 Added verbose debugging, normal debugging will now try and mask certain information 2016-01-17 14:39:17 +00:00
72cc180184 Merge pull request #2719 from SaaldjorMike/del-utime-func
Replaced custom utime() function with microtime(true)
2016-01-10 22:43:31 +00:00
e2d1a8e7d9 Replaced custom utime() function with microtime(true) 2016-01-08 13:33:32 +01:00
laf
fdc0eca44d Centralised version info + used in output 2016-01-06 00:14:35 +00:00
c7a55f86c6 Merge pull request #2093 from SaaldjorMike/remove-old-versioncheck
Removed old unused version checking
2015-10-09 18:04:13 +00:00
462b41c4f8 - applied changes made by f0o 2015-10-09 19:41:19 +02:00
0d645d0349 Removed old unused version checking 2015-10-09 15:16:29 +02:00
457babd32d - poll devices with specified type with --type switch 2015-10-09 12:57:43 +02:00
ff89504a17 - poll devices with specified os with --os switch 2015-10-09 12:36:41 +02:00
c94340d060 - add option to (re)discovery only linux devices 2015-10-09 10:01:58 +02:00
f0o
da9e071d7d Revert all PHP-Based MySQL Locks introduced in #1584 2015-09-02 14:46:42 +01:00
f0o
26554221fb Add another safety-net to remove locks if the execution of poller/disco gets aborted or killed 2015-09-01 14:49:55 +01:00
f0o
e11f613bdd Pause polling and discovery if there's an update-lock 2015-09-01 14:14:50 +01:00
f0o
b0a302bf77 Release MySQL locks when they are not used anymore 2015-09-01 11:10:56 +01:00
9039dbb425 give discovery it's own lock 2015-08-25 11:35:23 -04:00
0588ff41c3 get a lock when doing discovery 2015-08-25 11:35:18 -04:00
laf
86059f67c1 updated to use function for last commit 2015-08-25 08:40:20 +00:00
laf
59de0d1478 Clean up some poller debug + added updated version and last git commit 2015-08-24 20:54:19 +00:00
4792879ce5 Remove all unneeded if($debug)-statements and replace them with d_echo in the rest of the directories... 2015-08-21 16:10:01 +02:00
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
9cf8bc0277 Fix poller group query in discovery.php. 2015-07-11 00:55:29 +02:00
7f3f942e83 Adding the ability to use multiple poller groups for a poller. 2015-06-22 12:37:00 +02:00
laf
e1e7f36c81 Added support for poller groups in discovery 2015-03-19 22:14:08 +00:00
0e3b24bebc Start on making date formats consistent 2014-08-07 03:45:30 +10:00
aa9dded019 Remove user-facing references to Observium
This eliminates nearly all of the user-facing references to Observium,
including in the names of temporary files and in the metadata of PDFs.  Many
of these may not be used any more, but I've adjusted them anyway.  These
changes should also make it easier to change the branding later if it is
needed.  There are a few references of which I still don't understand the
significance, so I've left them as-is for now.  The Unix agent in particular
is rather untidy.
2013-11-05 09:33:32 +10:00
63d428c0e1 Revert "update copyright notice" after discussion with Paul
This reverts commit 774233327e3b300011b7a6fdcbef3a375f34b8b8.
2013-10-28 12:01:36 -07:00