Yes, this is a proposal. Others have told me that I need to monitor some OIDs and have provided a private MIB file, but when the generator works, it only tells me the first OID not found.
In this case, I need to delete the added OID and run again, repeating several times to find all the invalid OIDs. 在2021年7月31日星期六 UTC+8 下午4:52:25<Brian Candler> 写道: > I'm sorry, it's not clear: is this a question? A statement? Or a proposal > for something to change? > > My best guess is it's the latter. If so, can you provide a use case when > this would be helpful? > > I note that this is a change to the generator, not the exporter. It means > that if you run the generator, but have forgotten to install the necessary > MIBs, then it will carry on and ignore the missing MIBs, and therefore > generate an incorrect/incomplete snmp.yml output. > > Maybe you don't have those MIBs, but surely in this case it would be > better to update generator.yml to remove the MIBs you are not interested > in? This makes it explicit that you don't want these MIBs to be included > in snmp.yml. > > On Saturday, 31 July 2021 at 07:02:47 UTC+1 [email protected] wrote: > >> The generate subcommand adds an option "fail-on-oid-notfound" default is >> "true". When "false", we print the "warn" or" error" log instead of exiting >> the program so that we can see all the missing oids. >> >> example possible: >> >> >> // Find all top-level nodes. >> >> metricNodes := map[*Node]struct{}{} >> >> for _, oid := range toWalk { >> >> metricNode, oidType := getMetricNode(oid, node, nameToNode) >> >> switch oidType { >> >> case oidNotFound: >> >> >> if *failOnOidNotFound { >> return nil, fmt.Errorf("cannot find oid '%s' to walk", oid) >> } >> level.Warn(logger).Log("msg", " cannot find oid", "oid", oid) >> continue >> >> case oidSubtree: >> >> needToWalk[oid] = struct{}{} >> >> case oidInstance: >> >> // Add a trailing period to the OID to indicate a "Get" instead of a >> "Walk". >> >> needToWalk[oid+"."] = struct{}{} >> >> // Save instance index for lookup. >> >> index := strings.Replace(oid, metricNode.Oid, "", 1) >> >> >> tableInstances[metricNode.Oid] = append(tableInstances[metricNode.Oid], >> index) >> >> case oidScalar: >> >> // Scalar OIDs must be accessed using index 0. >> >> needToWalk[oid+".0."] = struct{}{} >> >> } >> >> metricNodes[metricNode] = struct{}{} >> >> } >> >> -- 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/a1fdb49d-966e-4d5a-8b07-c55f4a8c066cn%40googlegroups.com.

