mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-31 16:37:31 -08:00
Merge pull request #161 from AlphaB/master
Do not use flag before flag.Parse() was called
This commit is contained in:
commit
e55e50bd57
|
@ -35,7 +35,6 @@ type ntpCollector struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
ntp.Version = byte(*ntpProtocolVersion)
|
|
||||||
Factories["ntp"] = NewNtpCollector
|
Factories["ntp"] = NewNtpCollector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +44,7 @@ func NewNtpCollector() (Collector, error) {
|
||||||
if *ntpServer == "" {
|
if *ntpServer == "" {
|
||||||
return nil, fmt.Errorf("no NTP server specifies, see --ntpServer")
|
return nil, fmt.Errorf("no NTP server specifies, see --ntpServer")
|
||||||
}
|
}
|
||||||
|
ntp.Version = byte(*ntpProtocolVersion)
|
||||||
|
|
||||||
return &ntpCollector{
|
return &ntpCollector{
|
||||||
drift: prometheus.NewGauge(prometheus.GaugeOpts{
|
drift: prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
|
|
Loading…
Reference in a new issue