Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added packetlight support #10131

Merged
merged 7 commits into from Apr 29, 2019

Conversation

Projects
None yet
2 participants
@PipoCanaja
Copy link
Contributor

commented Apr 20, 2019

Packetlight support, using 2 simple user_func for the substraction of 30 and 128 resp, included into the Packetlight class. Standard YAML :)

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.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@PipoCanaja PipoCanaja self-assigned this Apr 20, 2019

@PipoCanaja PipoCanaja added this to the 1.51 milestone Apr 21, 2019

@murrant

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

How about putting the functions in an OS class \LibreNMS\OS\Packetlight? Then put them in yaml like \LibreNMS\OS\Packetlight::offsetDbm

This way we don't have random functions in the general php and know what OS they are for.

@PipoCanaja

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2019

Yep, I like that. I'll update the PR accordingly.

PipoCanaja added some commits Mar 28, 2019

logos
sensors
user_func
cleaning

@PipoCanaja PipoCanaja force-pushed the PipoCanaja:pl2 branch from 0dedb18 to 7ea8362 Apr 25, 2019

@@ -1107,7 +1107,7 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
}
//user_func must be applied after divisor/multiplier
if (isset($user_function) && function_exists($user_function)) {
if (isset($user_function) && is_callable($user_function)) {

This comment has been minimized.

Copy link
@PipoCanaja

PipoCanaja Apr 25, 2019

Author Contributor

@murrant I had to change this function_exists to is_callable to handle the 'class' that comes with the name. Looks safe from the documentation.

PipoCanaja and others added some commits Apr 25, 2019

@murrant

This comment has been minimized.

Copy link
Member

commented Apr 29, 2019

@PipoCanaja thanks for working through this. I'm pretty happy with how it came out.

@PipoCanaja

This comment has been minimized.

Copy link
Contributor Author

commented Apr 29, 2019

I learnt a couple of interesting things doing it :) Let see how Travis likes it.

@murrant murrant merged commit a3263b8 into librenms:master Apr 29, 2019

6 checks passed

Inspection Summary
Details
Node: analysis
Details
Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
codeclimate All good!
Details
license/cla Contributor License Agreement is signed.
Details

@PipoCanaja PipoCanaja deleted the PipoCanaja:pl2 branch Apr 29, 2019

funzoneq added a commit to funzoneq/librenms that referenced this pull request Apr 30, 2019

Added packetlight support (librenms#10131)
* MIBS

* logos
sensors
user_func
cleaning

* tests

* Switch to Packetlight class, and use is_callable instead of function_exists

* tests

* CodeClimate

* Rename functions

spencerbutler added a commit to spencerbutler/librenms that referenced this pull request May 21, 2019

Added packetlight support (librenms#10131)
* MIBS

* logos
sensors
user_func
cleaning

* tests

* Switch to Packetlight class, and use is_callable instead of function_exists

* tests

* CodeClimate

* Rename functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.