Skip to content

Conversation

gerhweber
Copy link

No description provided.

@gerhweber gerhweber requested a review from czerwonk as a code owner June 25, 2025 12:11
@gerhweber
Copy link
Author

I enhanced junos-exporter by handling JUNOS-command "show ntp status".
It is working well with EX4100.
I extract these values from the output string:

  • clock_jitter
  • leap
  • offset
  • poll_interval
  • precision
  • root_delay
  • stratum
  • system_jitter

Copy link
Owner

@czerwonk czerwonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. I would love to see some tests for the parsing code and disable the feature by default. Then i would gladly merge it.

c.LSEnabled = false
f := &c.Features
f.Alarm = true
f.NTP = true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new features should not be enabled by default

ntpLeapDesc = prometheus.NewDesc(prefix+"leap", "Leap indicator (00=ok, 01: last minute with 61 seconds, 10: last minute with 59 seconds, 11: not syncronized)", l, nil)
ntpPrecisionDesc = prometheus.NewDesc(prefix+"precision", "Clock precision (should be -20 to -22)", l, nil)
ntpPollDesc = prometheus.NewDesc(prefix+"poll_interval", "Poll interval in seconds", l, nil)
// ntpServerDesc = prometheus.NewDesc(prefix+"server_info", "NTP server info", append(l, "refid"), nil)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be removed if not needed

ch <- ntpLeapDesc
ch <- ntpPrecisionDesc
ch <- ntpPollDesc
// ch <- ntpServerDesc
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove, if not needed

exportMetric(ch, ntpPrecisionDesc, result.Precision, labels)
exportMetric(ch, ntpPollDesc, result.PollInterval, labels)

// ch <- prometheus.MustNewConstMetric(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove if not needed

Set default value for NTP to false
Delete comment lines
@gerhweber
Copy link
Author

gerhweber commented Sep 24, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants