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

Fortigate sessions sensors #10183

Merged
merged 4 commits into from May 10, 2019

Conversation

Projects
None yet
4 participants
@marvink87
Copy link
Contributor

commented May 3, 2019

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.

Adding 3 health sensors for Fortigate. Withouth thresholds as it differs per environment. Using numerical OID's as the polling afterwards didn't work withouth. The sensors:

  • The total sessions
  • The sessions per second over 10 minutes
  • The sessions per second over 60 minutes
@label-actions

This comment has been minimized.

Copy link

commented May 3, 2019

Please add test data so we can ensure your change is not broken in the future.

Read the docs to find out how: https://docs.librenms.org/Developing/os/Test-Units

@marvink87

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2019

Test is failing because of previous test data. Should I overwrite this test data instead or should this be manually edited? Or am I missing something?

@PipoCanaja

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

Basically :

  • You need to add your own device, which you did
  • You need to rerun ./scripts/save-test-data.php on each existing test file that is impacted by your changes.

But for now, you have an issue with the indexes of your new session sensors that must be handled before upgrading the tests data anyway.

@PipoCanaja

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

Looks better now. You can now ./scripts/save-test-data.php on the existing fortigate test-data. That will make Travis happy.

@marvink87

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2019

@PipoCanaja Was doing that while you where posting. :)
Don't really understand the tests but thanks for the help!

@PipoCanaja

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

The idea is the following:

  • collect-snmp-data : makes sort of a small "picture" of the device, from SNMP point of view.
  • save-test-data : processed this "picture" and creates an "extract" of the database for this device.

Then, whenever anybody does a change in LibreNMS codebase, Travis does again the save-test-data and compares it to the existing extracts, for each "picture".

If they match, all good, the code did not break anything. If they don't, the PR cannot be merged until issue is addressed.

Of course, if you add a feature, you have to manually update the extracts (for existing pictures) or create picture and extracts for next time.

Hope it is now a little bit clearer.

@PipoCanaja

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

All right. Looks good to me. I cannot test it (no fortigate around right now). Let see if we can have other testers.
I'll merge the code during the WE.

@murrant murrant changed the title Adding sensor for sessions Fortigate sessions sensors May 10, 2019

@murrant murrant removed the Needs Testing label May 10, 2019

@murrant murrant merged commit 966ce85 into librenms:master May 10, 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

@marvink87 marvink87 deleted the marvink87:fgt_sessions branch May 10, 2019

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

Fortigate sessions sensors (librenms#10183)
* Adding sensor for sessions

* Adding test data

* Fix index mistake and update test data (librenms#12)

* Update test data for existing fortigate

@lock lock bot locked as resolved and limited conversation to collaborators Jul 9, 2019

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