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

Netwatch status missing for hosts that do not have disabled field set #148

Open
knyar opened this issue Aug 5, 2022 · 0 comments · May be fixed by #150
Open

Netwatch status missing for hosts that do not have disabled field set #148

knyar opened this issue Aug 5, 2022 · 0 comments · May be fixed by #150

Comments

@knyar
Copy link

knyar commented Aug 5, 2022

I am using mikrotik-exporter to collect metrics from a RB4011iGS+5HacQ2HnD router running RouterOS 7.4.

When I add a new netwatch host, its status does not get exported:

$ ssh 10.11.12.1 '/tool/netwatch add host=1.1.1.1'
$ curl -s localhost:11223/metrics | grep 1.1.1.1
$ 

Explicitly setting disabled=no fixes this:

$ ssh 10.11.12.1 '/tool/netwatch set disabled=no [find host=1.1.1.1]'
$ curl -s localhost:11223/metrics | grep 1.1.1.1
mikrotik_netwatch_status{address="10.11.12.1",comment="",host="1.1.1.1",name="router"} 1
$

It seems that ?disabled=false condition does not hold true if disabled field is not set at all. Is this expected?

Silently omitting data from exported metrics does not seem like a great default. Would it make sense to remove the ?disabled=false condition while querying data via the API and either exclude disabled hosts in the exporter, or maybe just expose disabled as a separate metric label?

I will be happy to prepare a PR for this.

@knyar knyar linked a pull request Aug 23, 2022 that will close this issue
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 a pull request may close this issue.

1 participant