Commit Graph

369 Commits

Author SHA1 Message Date
kruczek8989
6039293a7c Update syslog-notify-oxidized.php (#14005)
* Update syslog-notify-oxidized.php

For oxidized to be able to catch from syslog a configuration change on a CISCO switch via SNMP.

* Update syslog-notify-oxidized.php

Small mistake with ","

* Update syslog-notify-oxidized.php

Modify with @murrant helps.
2022-06-04 13:17:37 -05:00
Zane C. Bowers-Hadley
f8d76b0571 scripts/json-app-tool.php JSON generation fix and add -S for SNMP extend name (#13948)
* add -S for setting a SNMP extend name and make sure the app is in a array

* minor formatting cleanup
2022-04-25 20:23:28 -05:00
Cliff Albert
4910761c25 Add MRV OptiDriver support in gen_rancid (#13900) 2022-04-08 13:37:20 +02:00
Stefano Sasso
e7205b4527 Add support for VyOS on Rancid conf (#13874) 2022-03-24 23:14:48 +01:00
manonfgoo
8ad389f161 Script that describes how to migrate traffic bills from observium. (#13757)
* Add  Traffic_bills.md

This script describes how to migrate traffic bills from observium to librenms.

* pretty print mysql and some cosmetics 

uppercase SQL Keywords
remove double spaces
2022-03-19 09:30:29 -05:00
Tony Murray
b6a8b602b8 Oxidized update and Device remove (#13730)
* Oxidized + Device remove
Was just working on oxidized, but then to properly update nodes after delete, updated delete_device()

* revert dumb style changes

* baseline update and no DI there...

* Fix OS first load and device deletion missing tables
2022-01-29 21:09:05 -06:00
Jellyfrog
36d8d9102e Use PHP_BINARY directly instead of trying to build path to PHP binary (#13690) 2022-01-20 08:50:43 -06:00
Stefano Sasso
898aafcdd3 Gen RANCID host also for FS.com devices (#13682)
On the RANCID perspective, a FS.com switch behaves exactly as a Cisco switch,
and the RANCID modules for Cisco work well.
2022-01-18 21:27:35 +01:00
Tony Murray
b32524294c collect-snmp-data.php can now capture snmp context test data (#13596)
* collect-snmp-data.php can now capture snmp context test data
This is helpful for devices that use context for multiple data sets such as VLANs and VRFs.  Allows us to test things that use those now, but does make more snmprec files :/

* update typehints on affected methods and baseline
2021-12-03 13:27:06 -06:00
Orsiris de Jong
e57ec782f4 Install new python dependencies during daily maintenance (#13186)
* Improve check_requirements script to dynamically read requirements.txt

* Don't dynamically load requirements for python2

* Make sure we check python3 dependencies with python3 binary

* Quote variable to fix SC2086

* Add dynamic_check_requirements.py

* Use dynamic_check_requirements.py for python3

* Revert "Don't dynamically load requirements for python2"

This reverts commit 4485c8fcf9e0075fcf212e4f8bbc59ed75e144b5.

* Revert "Improve check_requirements script to dynamically read requirements.txt"

This reverts commit a9c83350d9de6b1b3b0a313dca23af749a08300a.

* Add LIBRENMS_DIR variable to exec, check for permission errors

* Make sure we check for permission errors on pip install

* Fix shellcheck SC2046 missing quotations

* Make sure we install pip packages as librenms user for Python3

* revert daily.sh, update dependencies in composer

* And in the validation

* should be executable

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-11-10 10:38:50 -06:00
nq5
5854244f5a Syslog hook examples and documentation for Procurve devices (#13397)
* Add support for Procurve devices

Syslog hook support added for automatic Oxidized backups of devices running Procurve

* Add documentation for HPE/Aruba Procurve devices

Update documentation to support configuration of example Syslog hooks for HPE and Aruba devices running Procurve
2021-10-21 09:45:16 +02:00
Tony Murray
f94f7f23b8 Fully convert core to a modern module (#13347)
* Core module WIP

* update OS::make()

* core WIP

* try to finish up

* switch all core do os Model

* Mock WIP

* Working tests

* cleanup

* phpstan fixes

* style fixes

* fix agent

* trim space too
and a couple of cleanups

* corrected ios test data

* missed space

* update test data

* put escapes back

* another net-snmp difference

* Fix class description

* revert snmp.inc.php change, that can be a different PR

* revert snmp.inc.php change, that can be a different PR
2021-10-19 15:43:43 -05:00
Jellyfrog
258505ed44 Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Sean
1a97559816 Fix scripts to allow pathname with space (#13027) 2021-07-14 22:00:21 -05:00
Cliff Albert
cac5910040 Support for fortiswitch in gen_rancid (#12894) 2021-05-22 00:08:35 +02:00
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
a70d55bfd8 Add feature to capture a full snmprec (#12706) 2021-04-06 17:26:31 -05:00
Tony Murray
1c379dcd05 Remove legacy function calls (#12651)
* massive inlines

* fix style and wtf

* remove rrdtool.inc.php include

* fix CommonFunctions namespace issues

* looking for missing class space, fix undefined class issues

* style fixes
2021-03-29 00:25:30 +02:00
Jellyfrog
9946fe8b15 Format python code with Black (#12663) 2021-03-28 11:02:33 -05:00
Jellyfrog
f9b25ccdbc Lint with shellcheck (#12666) 2021-03-28 10:47:21 -05:00
Jellyfrog
b851e140dc "variant" is now required for test data (#12531)
* Stop snmpsim after we done

* "variant" is now required for test data
2021-02-14 20:39:08 -06:00
Jellyfrog
20b4215204 Swich links to https (#12511)
* Switch librenms links to https

* Convert librenms links in comments

* Switch gnu.org url to https

* switch php urls to https
2021-02-09 00:29:04 +01:00
CrazyMax
4126dddf73 GitHub Actions dev:check ci (#12392)
* Refactor test for GitHub Actions

* Checkout pull request HEAD commit instead of merge commit

* Fetch changed files from API instead of git

* HEAD commit

* Origin

* Fix env

* force full unit checks on gh actions change

* Fix DB conn

* Update test.yml

* Also set port in PDO connection

* Exit with correct exit code

* Update CiHelper.php

* Update test.yml

* Update CiHelper.php

* Update Proc.php

* Cleanups

Remove extra unit test run on php 7.4
Add names that will hopefully show in github.
Remove redundant DB env variables.

* Fix

Shorter names
and DB_TEST env is required

* Change command for information purposes

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
Co-authored-by: Tony Murray <murraytony@gmail.com>
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-01-03 00:54:01 -06:00
RobJE
e1497ecf0b shellcheck (#12258)
* remove unneeded semi-colons at end of line

* fix SC2206: Quote to prevent word splitting/globbing

* fix SC2164: Use 'cd ... || exit' in case cd fails

* fix SC2004: $/${} is unnecessary on arithmetic variables.

* fix SC2155: Declare and assign separately to avoid masking return values.

* fix SC2124: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

* fix SC2059: Don't use variables in the printf format string. Use printf "..%s.." "$foo".

* fix SC2076: Don't quote rhs of =~, it'll match literally rather than as a regex.

* fix SC1090: Can't follow non-constant source. Use a directive to specify location.

* fix SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

* SC2223: This default assignment may cause DoS due to globbing. Quote it.

* fix SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

* fix SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n"

* better handling of branch comapre

* add missing local ver_73 from merge

* remove duplicate definition
2020-11-11 23:21:15 +01:00
Jellyfrog
b7676e4cc8 Update to Composer 2 (#12263)
* Update to Composer 2

No need to roll our own checks anymore since this is now built in.
Also limit the update check to once a week.

* update

* Make Composer wrapper report correct exit code

* Update composer_wrapper.php

* re-enable extension check

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-11-09 00:28:07 -06:00
Tony Murray
25722bbbd5 Faster initial database creation (#12297)
* Faster initial database creation
Add db dumps to improve initial db migration
On my test system 13s -> 7s, a 46% reduction.
Should help out a lot on systems like RPi

* lnms schema:dump command

--snapshots saves db snapshots, otherwise it saves the yaml

* fix style

* fix timezones...

* not working with in-memory db yet
remove build.sql
2020-11-06 01:19:15 +01:00
Jellyfrog
b866bcf2ab Revert "Check PHP dependencies in daily.sh (#12260)" (#12271)
This reverts commit d82d2f1f19.
2020-10-29 15:11:32 +01:00
Jellyfrog
d82d2f1f19 Check PHP dependencies in daily.sh (#12260) 2020-10-29 01:34:42 +01:00
Jellyfrog
bd81f76caa Use variable for PHP min version in docs (#12256)
* Use variable for PHP min version in docs

* Bump mkdocs deps
2020-10-24 11:19:45 +02:00
Jellyfrog
4068b04cc9 Add missing mkdocs extension (#12193)
Regression from 551e95a2e0
2020-10-06 01:52:16 +02:00
Tony Murray
88b40c3d6c All os detection now uses Yaml (#12186)
* All os detection now uses Yaml
Move OS detection code into the Core module.
Defer all OS with snmp queries.
Add snmpwalk option.
Port ubnt and mobileiron to yaml.

* Silly ide refactor
2020-10-05 14:26:37 +02:00
Birkir Freyr
cb7e191f31 Add panos (paloalto) to rancid_map (#12161)
Add panos (paloalto) to rancid_map
2020-09-28 17:57:54 +02:00
Tony Murray
caf1979529 fix gen_rancid.php permissions (#12153)
broken by #12144
2020-09-24 06:48:14 -05:00
Tony Murray
e944456943 Use lnms dev:check instead of pre-commit.php (#12149)
* Remove pre-commit.php references WIP

* remove pre-commit.php references
2020-09-24 12:32:03 +02:00
Cliff Albert
a85b1e8bbd scripts/gen_rancid.php: Add support for H3C/Comware (#12144)
* allied, radlan, ciscowlc rancid router.db configuration support
allied and radlan represent allied telesis

* tab/spaces

* allied, radlan, ciscowlc rancid router.db configuration support
allied and radlan represent allied telesis

* * Added rancid support for H3C/Comware

* extraneous newline
2020-09-23 13:35:14 +02:00
Jellyfrog
29f45ca352 Apply fixes from StyleCI (#12124) 2020-09-21 15:59:34 +02: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
Adam Bishop
bbdb1a2a5d Rewrite smokeping script to be an lnms command (#11585)
* Rewrite smokeping script to be an lnms command

* Add a default number of probes for smokeping

* Formatting fixes

* Refactor to simplify a couple of methods

* Fix a name collision when using more than 60 threads

* Simplify

* First pass at documentation

A few climate fixes too.

I'm a little dubious about the + LibreNMS fix - it could be included
in /etc/smokeping/config if it is really needed, but it sounds like
(looking at git blame) it's needed for if the script generates a broken
configuration file.

I'm thinking we should just not generate broken config.

* Improve testability and add some tests

* Load laravel to make translations available

* Second pass at documentation

* Fix brace

* Extend the device factory to include the type

Also adds a device group fake I created before I realised I didn't need it

* Mimic gen_smokeping.php a little more closely

* Update tests to properly verify old and new behaviour against each other

* Replace gen_smokeping with a wrapper

* Don't double whitespace

Render does this automatically.
Explicitly order by hostname too.

* Make faker less likely to generate duplicates

I tried adding a unique constraint here, but it didn't have the
intended effect.

Extending the hostname like this seems to work fine - I tried
generating 10 million hosts and got no duplicates, compared to
duplicates appearing with as few as 100 hosts without this
 change.

A true fix would be to add an 'fqdn' fake upstream.

* Make the tests more robust

* Assorted bug fixes

* Style corrections

* Handle 'generic' devices

* Fix an issue that came up during rebase

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-09-18 00:04:54 -05:00
dupondje
ba699be009 Since Rancid 3, the separator is ; (#11688) 2020-09-09 16:10:36 +02:00
Tony Murray
04e7afe9ed python requirements use sys.exit (#11981)
script was using the wrong exit
2020-07-30 19:05:49 +02:00
Tony Murray
334d50467c Simpler Python requirements check (#11939)
Don't require the full requirements.txt
If we do that we are likely to send users back to the python2 support branch when new dependencies arise.
2020-07-18 00:12:18 +02:00
Tony Murray
db5524dc09 Merge pull request #11762 from murrant/consolidate-install-doc
Update and Consolidate Install docs Ubuntu 20.04 and CentOS 8
2020-06-29 01:10:28 -05:00
Tony Murray
258d693477 PHP_BINDIR to allow composer.phar to work in more situations 2020-06-27 07:47:08 -05:00
Tony Murray
139317725a one more dep 2020-06-02 22:55:52 -05:00
Tony Murray
a550519c27 full mkdocs deps locked 2020-06-02 22:51:54 -05:00
Tony Murray
ee7fa1e1cb Change github-remove shebang to python3 (#11753) 2020-06-01 11:24:49 -05:00
Tony Murray
841203c8c5 Consolidated doc (Ubuntu 20.04 Nginx tested) 2020-05-31 21:45:39 -05:00
Tony Murray
2a6342f2ca Deploy docs direct in Travis CI (#11727)
* deploy_docs direct in travis

* forgot chmod
2020-05-28 21:52:54 -05:00
Tony Murray
46fa4eac03 Add missing bash lint script (#11700) 2020-05-26 08:28:00 -05:00