mirror of
https://github.com/nshttpd/mikrotik-exporter.git
synced 2024-11-16 10:25:12 +01:00
Merge pull request #95 from lnicolas83/add_cpu-temperature
Add cpu-temperature to health collector
This commit is contained in:
commit
ac29090723
@ -21,10 +21,10 @@ func newhealthCollector() routerOSCollector {
|
||||
}
|
||||
|
||||
func (c *healthCollector) init() {
|
||||
c.props = []string{"voltage", "temperature"}
|
||||
c.props = []string{"voltage", "temperature", "cpu-temperature"}
|
||||
|
||||
labelNames := []string{"name", "address"}
|
||||
helpText := []string{"Input voltage to the RouterOS board, in volts", "Temperature of RouterOS board, in degrees Celsius"}
|
||||
helpText := []string{"Input voltage to the RouterOS board, in volts", "Temperature of RouterOS board, in degrees Celsius", "Temperature of RouterOS CPU, in degrees Celsius"}
|
||||
c.descriptions = make(map[string]*prometheus.Desc)
|
||||
for i, p := range c.props {
|
||||
c.descriptions[p] = descriptionForPropertyNameHelpText("health", p, labelNames, helpText[i])
|
||||
@ -64,7 +64,7 @@ func (c *healthCollector) fetch(ctx *collectorContext) ([]*proto.Sentence, error
|
||||
}
|
||||
|
||||
func (c *healthCollector) collectForStat(re *proto.Sentence, ctx *collectorContext) {
|
||||
for _, p := range c.props[:2] {
|
||||
for _, p := range c.props[:3] {
|
||||
c.collectMetricForProperty(p, re, ctx)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user