On Friday, 26 November 2021 at 09:54:59 UTC [email protected] wrote: > What is the best way to have snmp_exporter scrape these manual OIDs for > some servers? The generator won't add them because they're not part of its > templates. >
By "templates" do you mean generator.yml? This is what you're supposed to edit to add your new device types. Hence the "right" way to do this is to get the Fortigate MIB, add the MIB sections you're interested in to generator.yml, and compile it using generator. However, the generator *does* accept numeric OIDs, and indeed you can see some cases in generator.yml where it already does this because of ambiguities. So if you want to specify just the numeric OID, that should work, at least for simple values. (Aside: it looks like your Fortigate is doing something stupid by returning a number as a STRING. I have a vague idea that there is a feature in snmp_exporter to deal with this. Ah yes: https://www.robustperception.io/numbers-from-displaystrings-with-the-snmp_exporter As for "for some servers" - do you mean for some and not others? Then you create different entries in generator.yml. Either for some devices you scrape module=A and others you scrape module=B; or for some devices you scrape module=A and for others you scrape module=A *and* module=B (in two separate scrapes, since snmp_exporter ignores repeated instances of the 'module' parameter) > I'm considering exposing the information via node_exporter's text file > exporter, but it requires tweaking to bypass SNMP. > > You wouldn't need to 'tweak' node_exporter itself, but you'd need to write a cronjob that does an SNMP poll and writes the data in metrics exposition format into a file in text file exporter directory. I think it's worth the extra effort to use snmp_exporter directly for this, as there are fewer moving parts to monitor. -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2a601a28-54b4-4229-829d-7aba2dfa58f0n%40googlegroups.com.

