Skip to content

Commit ce4937a

Browse files
authored
Merge pull request #54 from linode-obs/fix/update-logging
fix: only log when nagios.com is unreachable
2 parents dfbfc8c + ced006d commit ce4937a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nagios_exporter.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,10 @@ func (e *Exporter) QueryAPIsAndUpdateMetrics(ch chan<- prometheus.Metric, sslVer
472472
updateAvailable, prometheus.GaugeValue, updateMetric,
473473
// updateMetric 0 = no update, updateMetric 1 = update available
474474
)
475+
} else {
476+
log.Warn("Nagios version wasn't found, not updating `nagios_update_available_info` metric")
475477
}
476478

477-
log.Warn("Nagios version wasn't found, not updating `nagios_update_available_info` metric")
478-
479479
} else { // user did not want to compare nagios versions externally so just say there aren't any updates (0)
480480
ch <- prometheus.MustNewConstMetric(
481481
updateAvailable, prometheus.GaugeValue, 0,

0 commit comments

Comments
 (0)