Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM probes metrics from Junos EVO #255

Open
mirceaulinic opened this issue Aug 21, 2024 · 0 comments
Open

RPM probes metrics from Junos EVO #255

mirceaulinic opened this issue Aug 21, 2024 · 0 comments

Comments

@mirceaulinic
Copy link
Contributor

One Junos EVO and / or some platforms, the RPM probes have been nested under sevices > monitoring > rpm (whereas before they were under services > rpm).

I'd be tempted to open a PR with the following patch:

diff --git a/pkg/features/rpm/collector.go b/pkg/features/rpm/collector.go
index 9920084..dbd8dab 100644
--- a/pkg/features/rpm/collector.go
+++ b/pkg/features/rpm/collector.go
@@ -72,9 +72,12 @@ func (c *rpmCollector) Collect(client collector.Client, ch chan<- prometheus.Met
 func (c *rpmCollector) collect(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error {
        var x = result{}
 
-       err := client.RunCommandAndParse("show services rpm probe-results", &x)
+       err := client.RunCommandAndParse("show services monitoring rpm probe-results", &x)
        if err != nil {
-               return err
+               err := client.RunCommandAndParse("show services rpm probe-results", &x)
+               if err != nil {
+                       return err
+               }
        }

This would execute the new command, and fallback to the old style command in case of error. But that's a bit suboptimal.

However Junos preserved the RPC request get-rpm-probe-results across versions / platforms / etc., and it'd be more beneficial to use that instead of the CLI show command, but it doesn't seem like the current junos_exporter implementation would allow that?

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

No branches or pull requests

1 participant