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

feat(inputs.mikrotik): Add plugin #16081

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

s-r-engineer
Copy link

@s-r-engineer s-r-engineer commented Oct 27, 2024

Summary

The idea is to be able to connect and gather metrics from the Mikrotik's RouterOS

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16080

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@s-r-engineer s-r-engineer changed the title Mikrotik plugin added feat: Mikrotik plugin Oct 27, 2024
@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Oct 27, 2024
@s-r-engineer s-r-engineer marked this pull request as draft October 27, 2024 14:42
@s-r-engineer
Copy link
Author

This three issues I am having:

  1. https://github.com/influxdata/telegraf/actions/runs/11541885708/job/32124423506?pr=16081 I am highly confused. I ran super-linter locally and only issues I got are MD013 which are according to .markdownlint.yml shall be ignored.
  2. https://app.circleci.com/pipelines/github/influxdata/telegraf/23202/workflows/acca2f7b-af70-4cc2-a827-736c98f95542/jobs/362160 This one looks like something not working properly. The script make_docs.sh when running locally formatting telegraf/plugins/outputs/wavefront/README.md so I believe it is the reason for the failure
  3. https://app.circleci.com/pipelines/github/influxdata/telegraf/23202/workflows/acca2f7b-af70-4cc2-a827-736c98f95542/jobs/362162 not seems to be related at all

@DStrand1
Copy link
Member

This three issues I am having:

  1. https://github.com/influxdata/telegraf/actions/runs/11541885708/job/32124423506?pr=16081 I am highly confused. I ran super-linter locally and only issues I got are MD013 which are according to .markdownlint.yml shall be ignored.
  2. https://app.circleci.com/pipelines/github/influxdata/telegraf/23202/workflows/acca2f7b-af70-4cc2-a827-736c98f95542/jobs/362160 This one looks like something not working properly. The script make_docs.sh when running locally formatting telegraf/plugins/outputs/wavefront/README.md so I believe it is the reason for the failure
  3. https://app.circleci.com/pipelines/github/influxdata/telegraf/23202/workflows/acca2f7b-af70-4cc2-a827-736c98f95542/jobs/362162 not seems to be related at all

#16087 I believe should fix the first two, and the 3rd is an unrelated flaky test, so nothing needed here (other than a rebase/merge after the linked PR merges)

@s-r-engineer s-r-engineer marked this pull request as ready for review October 29, 2024 10:04
@s-r-engineer s-r-engineer reopened this Oct 29, 2024
@srebhan srebhan changed the title feat: Mikrotik plugin feat(inputs.mikrotik): Add plugin Oct 29, 2024
@telegraf-tiger telegraf-tiger bot added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label Oct 29, 2024
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @s-r-engineer for your contribution! I want to encourage you to simplify your code! Why not defining known tag and field names of responses and decode the JSON responses to map[string]string? Then you can iterate over the map and decode the value accordingly? This would get rid of the reflection code and in general would simplify the code...

plugins/inputs/mikrotik/README.md Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/README.md Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/README.md Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/sample.conf Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/sample.conf Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/parsers.go Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/parsers.go Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/parsers.go Outdated Show resolved Hide resolved
plugins/inputs/mikrotik/tools.go Show resolved Hide resolved
plugins/inputs/mikrotik/tools.go Outdated Show resolved Hide resolved
@s-r-engineer s-r-engineer marked this pull request as draft October 29, 2024 12:50
@srebhan srebhan self-assigned this Oct 30, 2024
@srebhan
Copy link
Member

srebhan commented Oct 30, 2024

@s-r-engineer my review comments are that, comments about the code. They are not meant to criticize or insult you as a programmer or anyone else. If you understood it this way, please accept my apologies.

@s-r-engineer
Copy link
Author

s-r-engineer commented Oct 30, 2024

@s-r-engineer my review comments are that, comments about the code. They are not meant to criticize or insult you as a programmer or anyone else. If you understood it this way, please accept my apologies.

@srebhan I never was insulted whatsoever. I am sorry if I made you feel like that.

@s-r-engineer s-r-engineer marked this pull request as ready for review October 31, 2024 18:11
@s-r-engineer
Copy link
Author

@srebhan what to do with this? I am not sure why this is an issue. https://app.circleci.com/jobs/github/influxdata/telegraf/363717

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Nov 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mikrotik input plugin
3 participants