Skip to content

Commit

Permalink
Merge branch 'main' into web-external-url
Browse files Browse the repository at this point in the history
  • Loading branch information
kwilt authored Jan 23, 2025
2 parents 928492a + a0509dc commit b0d8637
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ modules:
metricName:
ignore: true # Drops the metric from the output.
help: "string" # Override the generated HELP text provided by the MIB Description.
name: "string" # Override the OID name provided in the MIB Description.
regex_extracts:
Temp: # A new metric will be created appending this to the metricName to become metricNameTemp.
- regex: '(.*)' # Regex to extract a value from the returned SNMP walks's value.
Expand Down
1 change: 1 addition & 0 deletions generator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type MetricOverrides struct {
Scale float64 `yaml:"scale,omitempty"`
Type string `yaml:"type,omitempty"`
Help string `yaml:"help,omitempty"`
Name string `yaml:"name,omitempty"`
}

// UnmarshalYAML implements the yaml.Unmarshaler interface.
Expand Down
3 changes: 3 additions & 0 deletions generator/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,9 @@ func generateConfigModule(cfg *ModuleConfig, node *Node, nameToNode map[string]*
if params.Help != "" {
metric.Help = params.Help
}
if params.Name != "" {
metric.Name = params.Name
}
}
}
}
Expand Down

0 comments on commit b0d8637

Please sign in to comment.