-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add snmp input plugin #546
Conversation
# snmptranslate -m all -Tz -On | sed -e 's/"//g' > /tmp/oids.txt | ||
# Or if you have an other MIB folder with custom MIBs | ||
# snmptranslate -M /mycustommibfolder -Tz -On -m all | sed -e 's/"//g' > oids.txt | ||
snmptranslatefile = "/tmp/oids.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to snmptranslate_file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem !
@titilambert I still don't agree with the snmptranslate file implementation. It seems that users can specify a file, but then they still need to define each OID in the config anyways? Why not just use all OIDs from the file AND OIDs defined in the config? Why do they need to be defined both places? |
// SNMP getbulk max repetition | ||
MaxRepetition uint8 `toml:"max_repetition"` | ||
// We want to resolve oid to names oids text file | ||
Snmptranslate bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option seems unnecessary, why define the OID in two places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question ! In fact this option define if you want to use the name from Name
option in the section or if you want to use the name from snmptranslate_file
.
So, maybe we can delete this option and do:
- Get name from
snmptranslate_file
if it exists - Get name from
Name
option in the section
In that case we can not use OID as name (.1.3.6.....) which is good I think
Are you agree with that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that sounds good 👍
Hello !
@sparrc I'm partially agree with you :)
So, I will add this option to use names and oids if you agree with that. Thanks ! |
@titilambert I think I understand, sounds good to me 👍 |
@sparrc Perfect I will also update the sample-config to get more examples... |
9d997b3
to
eee5feb
Compare
@sparrc Hello ! I think this one is good ! :) |
@sparrc and rebased again :D :D |
Thanks @titilambert, now that I've been playing around with it I'm starting to understand better. This is a very powerful and configurable plugin, but I do find it rather complicated to use. I was wondering what you thought of making the configuration look more like this:
This is a lot more simple, but obviously this also loses some of the config granularity. If this over-simplifies the necessary features of SNMP you can just let me know, I'm certainly not an snmp expert. |
} | ||
} | ||
// Deconnection | ||
defer snmpClient.Conn.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This defer should be moved up to line 264, directly after the client is made (but after the error is checked)
also -- could you make the testdata/oids.txt file smaller? |
Done ! |
@sparrc Unfortunately, bulk request need at least this granularity... :/ In fact, I thought to add more options (in a future version) to get a better support of SNMP tables (#540). BTW, do we have something for user documentation ? (like sphinx/readthedocs in python) |
@titilambert I had a feeling it would be the case :-) One final request, I think that there could be an "easy" config for someone looking to get started quickly with some SNMP metrics. I was thinking that you could add an option to the snmp "host" where users can just specify a simple list of "get" OIDs. I realize this wouldn't work for bulk or table requests, but I think it could still be useful. At least from my perspective I would like to be able to just monitor a few local SNMP metrics on my workstation.
|
@sparrc changes done ! |
#495 rebased with master