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

Veeam backup SNMP Traps #13170

Merged
merged 18 commits into from Sep 19, 2021
Merged

Veeam backup SNMP Traps #13170

merged 18 commits into from Sep 19, 2021

Conversation

mpikzink
Copy link
Contributor

@mpikzink mpikzink commented Aug 24, 2021

Log Veeam backup status in eventlog

Please give a short description what your pull request is for

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.

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.

@murrant murrant added Needs Tests 🦄 https://docs.librenms.org/Developing/os/Test-Units/ SNMP Traps labels Aug 25, 2021
@label-actions
Copy link

label-actions bot commented Aug 25, 2021

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


$message = 'SNMP Trap: Backup success - SureBackup Job 1';
Log::shouldReceive('event')->once()->with($message, $device->device_id, 'backup', 2);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are getting an extra log entry the tests don't expect or your log message doesn't match.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmh, I do not find my issue for a view days. No idea how to debug this test cases :-( Can someone help me?

@murrant
Copy link
Member

murrant commented Sep 18, 2021

@mpikzink it helps to capture actual traps for the tests. The ones you added seem to be fabricated, because there was several incorrect things in the test trap strings.

@mpikzink
Copy link
Contributor Author

THX @murrant I will do in my next PRs. I have 2 more trap handlers in the pipeline. Is there a good way to capture? I grabbed it from the devices event log with debugging on and reformatted it. There I did the mistakes.

@murrant
Copy link
Member

murrant commented Sep 19, 2021

How I capture is in snmptrap.php, I write the $text to a file.

@murrant murrant merged commit 59859c2 into librenms:master Sep 19, 2021
murrant added a commit to murrant/librenms that referenced this pull request Sep 28, 2021
* SNMP Trap Veeam backupjob status

* Add  onVmBackupJobCompleted

* add mib

* fix style

* fix style

* Split backupjob and vm backup

* Add Traptest

* Fix style

* Fit style

* typehint on tests

* Fix handling empty string

* Fix wrong check

* Fix styl

* Fix style

* Update VeeamBackupJobCompleted.php

* Update VeeamVmBackupJobCompleted.php

* Update VeeamTrapTest.php

* Update VeeamTrapTest.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
@librenms-bot
Copy link

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/21-10-0-changelog/17124/1

eskyuu pushed a commit to eskyuu/librenms that referenced this pull request Oct 21, 2021
* SNMP Trap Veeam backupjob status

* Add  onVmBackupJobCompleted

* add mib

* fix style

* fix style

* Split backupjob and vm backup

* Add Traptest

* Fix style

* Fit style

* typehint on tests

* Fix handling empty string

* Fix wrong check

* Fix styl

* Fix style

* Update VeeamBackupJobCompleted.php

* Update VeeamVmBackupJobCompleted.php

* Update VeeamTrapTest.php

* Update VeeamTrapTest.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Tests 🦄 https://docs.librenms.org/Developing/os/Test-Units/ SNMP Traps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants