* Infer character encoding for ifAlias and sysLocation
Tries to convert character encoding for non-UTF-8 encoded strings.
This will only work for snmp strings that are type-hinted, not ones forced to ASCII with -Oa or similar
Only works for your default charset or Windows-1251 or LATIN1.
You can set your character encoding in .env with CHARSET
Please save us all and just use UTF-8
* style fixes
* less Yoda
* ensure return type
* fall back to passed string
* don't convert strings with any unprintable characters (such as line return)
* Update LibreNMS/Util/StringHelpers.php
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
* Fix CP850
* fix space
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
* Validate APP_KEY
key:rotate command to rotate keys, only rotates validation data for now
* fixes, swapped encrypters, not saving new value to db, check that key exists first
* add confirmation
* Option to generate new key, re-encrypt data and then save it to .env
A lot more text to try to prevent disaster. Print out both keys 1-2 times.
Fix bug in EnvHelper (when key is commented but not empty)
* fix style
* oops, good phpstan
* API find a switchport with the mac from device
* fix style
* convert SQL to Eloquent
* convert SQL to Eloquent
* git mistake
* Global use App\Models\Port
* git mistake partII
* Refractor Eloquent - Not finish but easier to help for others
* Better Eloquent Query without filter option
* Validation
* fix style
* Add filter option and DOC
* convert to the better macToHex method
* add a maxToHex unit test
* fix style
* fix style
* fix syle - seems my dev:check is running again :-)
* Fix phpStan
* phpStan #2
* port related errors
* more fixes
* fix storage count
* add tests for php8
* style
* only need not empty
* aix fixes....
* storage WIP
* fix aix discovering hrstorage
fix db test adding .gitkeep
fix os modules when discovery only
* fix aos processors wrong oid
* fix mempool number casting
* fix aos7 cpu
* use + 0 cast instead of floatval()
* more verbose error on invalid json
* remove invalid data in json
* actually fix the json
* correct json error fix
* cast_number() function
fix aruba-instant and aos6 bugs exposed by new function, probably more...
* fix a-f
fix inadequate sort for component data
* fix global port poll time
* fix mempools precent 0, route count, ntp const
* fix schleifenbauer liberal current usage
* further number casting refinement
* vrp
* fix tests
* fix arbos
* warn cleanups adjust to :: change
* fix ciena-sds
* fix drac
* fix dell-rpdu anddlink
* fix and improve arubaos
better error when getting an array in Processor
* fix atenpdu, add missing arubaos files
* aruba-instant to yaml
apparently I didn't need to do this, the diff just looks really odd
It did add ranged sub-index replacements
* docker app, was completely wrong... fixed
* fix sentry4 divide by 0...
* fixed root issue, remove check
* nicer cidr in ipv6 code
* remove bogus enuxus battery bank skip_values
* Fix InfluxDB tests
* remove extra import
* fix other style issues.
* influx "style" fixes
* Shift HTTP kernel and middleware
* Shift service providers
* Shift console routes
* Shift to class based factories
* Namespace seeders
* Shift PSR-4 autoloading
* Default config files
In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them. This allows you to review the commit
diff for once for customizations when you are done Shifting.
Moving forward, consider using ENV variables or create a separate
config file to allow the core config files to remain as default
as possible.
* Shift Laravel dependencies
* Shift return type of base TestCase methods
From the [PHPUnit 8 release notes][1], the `TestCase` methods below now declare a `void` return type:
- `setUpBeforeClass()`
- `setUp()`
- `assertPreConditions()`
- `assertPostConditions()`
- `tearDown()`
- `tearDownAfterClass()`
- `onNotSuccessfulTest()`
[1]: https://phpunit.de/announcements/phpunit-8.html
* Shift cleanup
* console routes
* composer update
* factories
* phpunit
* bootstrap pagination
* model factory
* wip
* Apply fixes from StyleCI (#12236)
* wip
* Apply fixes from StyleCI (#12238)
* wip
* wip
* wip
* wip
* Apply fixes from StyleCI (#12240)
* wip
* Apply fixes from StyleCI (#12242)
* composer update
* Bump to PHP 7.3 minimum
Co-authored-by: Laravel Shift <shift@laravelshift.com>
* Refactor pre-commit to class
* docs build
* dusk check
* ci mode for checks
* full checks
* other mysql
* make other lint checks actually work
fix pylint finding
* ci is a long opt
* fix undefined index
* dusk fully working
* ask for forgiveness, not permission
* fix whitespace
* skip dusk sometimes
* Handle 3com and other os with digits
* flags instead of if else spaghetti
* convert to command
* cleanup
* missed check
* fixes
* case
* self-check :D
* argument now
* fix bugs from refactors
* another fix
* adjust file change parsing
* refactor execut a bit
* fallback to global quiet when unknown type.
* allow quiet override for specific commands
* output cleanup
* check flow
* start of tests
* file categorizer tests and fixes
* fixes and cleanup
* skipable not implemented...
* more tests, fix bugs
* more tests and cleanup
* wrong command
* fix canCheck and set env properly
* full env fix
* don't allow dusk on user's run as it will erase their db.
* fix os option
* fix whitespace
* don't need to start server
* ci doesn't like that
* WIP Sqlite
Down methods don't work either, avoid them with refresh for now.
WIP persistent support
WIP db_schema
WIP db_schema 2
Update new migrations...
revert dump_db_schema changes for now, too much difference.
fix migrations on mysql
fix up some more items, this should be our target schema
lots of index renames and a two misc changes
index rename WIP
index rename WIP
another round
fix up new schema changes
try case insensitive fix
Trying tests WIP
fix down methods
DBSetupTest working (uses mysql)
Test sqlite migrations work
* Properly validate sqlite output
* revert glue changes, should be separate PR
* remove dusk workaround
* remove unused variables
* import
* sqlite capitalization
* Revert some refresh tests
* testing_mysql back to testing
* Test WIP
* WIP
* port getComponents to Eloquent
* port more
* simpler creation
* change to explicit arrays
* add missed file
* restore commented code
* fix inserting null value for component prefs
* Fix some bugs in setCompenentPrefs
Can't create tests without fixing bugs first :D
* another test
* another test
* Modernize setComponentPrefs
* Test for event log entries
* Fix delete event
* fix invalid values for component toggles
* status log too
* Use Setters to work around bad data, $casts doesn't do what we want.
* Datastores to object oriented code, using the Laravel IoC container
Change instantiation
better DI
move OpenTSDB
Small re-orgs
remove unused stuff
Fix graphs and other scripts
Use DI for all except rrd
fix up connection error handling
Add tests, fix up a "few" things
Add Config::forget()
Style fixes
Don't reference legacy code
remove accidental code paste
Add datastores phpunit groups
some tests
* rebase fixes
* some test fixes
* shorter tests
* shorter tests
* Don't except when rrdtool can't be started.
* restore tests
* fix rrd tests
* fix iterable change upstream
* fix isValidDataset
* fix invalid data bug
* fix mysql incorrect ds
* fix issue with data that is too long
* use regular data_update()
* Use log facade
* OpenTSDB mis-ordered arguments fix
* Making a singleton with different options makes different singletons. Just use the global config settings to disable datastores.
* only filter tags for datastores that won't it don't modify the tags permanently
* Update copyrights to include original authors.
* Stats for all datastores
* Fix mysql sends different rrd / other ds names
* fix snmp last stats not initialized
remove unused function
* remove unused function and move single use function closer to its use
* InfluxDB does not need to update null or U values.
Skip write if all fields are empty
* Fix smart value checks
* fix style issues
* Make sure port data is stored the same way as before for Graphite and OpenTSDB
Add ifIndex tag to all to be compatible
* Missed rrdtool_tune() call
* Test update WIP
* OpenTSDB now includes tags
* fix style
* Datastores to object oriented code, using the Laravel IoC container
Change instantiation
better DI
move OpenTSDB
Small re-orgs
remove unused stuff
Fix graphs and other scripts
Use DI for all except rrd
fix up connection error handling
Add tests, fix up a "few" things
Add Config::forget()
Style fixes
Don't reference legacy code
remove accidental code paste
Add datastores phpunit groups
some tests
* rebase fixes
* some test fixes
* shorter tests
* shorter tests
* Don't except when rrdtool can't be started.
* restore tests
* fix rrd tests
* fix iterable change upstream
* fix isValidDataset
* fix invalid data bug
* fix mysql incorrect ds
* fix issue with data that is too long
* use regular data_update()
* Use log facade
* OpenTSDB mis-ordered arguments fix
* Making a singleton with different options makes different singletons. Just use the global config settings to disable datastores.
* only filter tags for datastores that won't it don't modify the tags permanently
* Update copyrights to include original authors.
* Stats for all datastores
* Fix mysql sends different rrd / other ds names
* fix snmp last stats not initialized
remove unused function
* remove unused function and move single use function closer to its use
* InfluxDB does not need to update null or U values.
Skip write if all fields are empty
* Fix smart value checks
* fix style issues
* Refactor tests
Boot Laravel for all tests.
Config use private static property for storage instead of global
* Backup/restore modules
* disable snmpsim log
* Fixing DBTestCase
* Fix macros loading to the wrong place
* trap and other tests should check if db is available
* don't include snmp.inc.php if mock.snmp.inc.php is already included...
* fix migration
* if we don't reset the db, run migrations at least.
* set vars for migrate too
* Fix style
* ignore issues with undefined indexes in legacy code
* Allow trusted proxy via APP_TRUSTED_PROXIES
Set to '*' by default to emulate legacy behavior.
Set up doc describing environment variables
* Create helper to parse environment variables into arrays properly.
* Update doc blocks
* 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.