Hello team:
I am a beginner in the use of Telegraf so I ask your forgiveness with the following question if it so basic for this forum :o)
I am about to install telegraf via a docker-compose.yml specification.
I want to create a directory and add in it some MIB files that might be needed by Telegraf.
The question I have is: ¿ How does telegraf “know” from which mapped volume to pull these MIB files when needed?
I would have expected this “mibs” directory to be either a well known path that I have to specify or otherwise referenced within the telegraf.conf file, but I was not able to find a document that explains the procedure to carry out.
Your help will be greatly appreciated
Best regards.
After some reading, it seems to be that Telegraf´s SNMP plugin uses the snmptranslate() command to perform lookups from the MIB.
It also seems that unless the MIBDIRS environment variable is modified, snmptranslate() will search in the /usr/local/share/snmp/mibs directory for MIB files. So adding such a path in the volumes section of the docker-compose.yml file would solve the request.
I talked to a friend of mine last week. He handed me over a bunch of lines to add to my docker-compose.yml file. Look below to the line related to my doubt: he is using “/usr/share/mibs/site” on the docker side instead of “/usr/local/share/snmp/mibs”.
So I loaded my mibs files on the ${PWD}/telegraf/mibs directory and everything worked fine! I am little bit confused, since I would have expected this suggestion from him not to be right.
Next week I will stop my service, replace that line with “/usr/local/share/snmp/mibs”, and see whether Telegraf is still able to locate the mib files.
Thanks!
But I fear that in a future upgrade I could find that it stops working. So if a more known source directory works as well, then I would stick to the mainstream.
Thanks a lot for your kind answer.
Best regards