Periodic Service Discovery Rule

Dear Community,

i have some problems with my periodic service discovery rule.

without my rule, i have to make a “full scan” on every host itself. With my rule, he is searching for services but don’t set them to monitor.

Found Services:
image

The Rule:

toggeling the command
cmk -vv --discover-marked-hosts

cause the following output
Doing discovery for all marked hosts:
Nothing to do. No hosts marked by discovery check.

If you do this is, is there a host marked for discovery?
Your rule says run every 10 minutes and after 5 minutes activate all changes.
This is very quick. You really sure that it does nothing or is it only quicker then you think?

Under normal conditions i run this check only every 4 or 6 hours not every 10 minutes. And then i group the activation to 30 minutes or 1 hour.

For further troubleshooting it would be good if you have a discovery service with new found items and also items that are not activated at the moment.

All the answers you are looking for are allready in my question above.

Sorry… have you read my question?

The command shows no single host.
I let the service run this often, because i want to see changes quickly.

As you can see on the screenshot above, there are services that doesn’t get monitored. They are only found as new services.

It seems like the rule does simply nothing, however it is configured.

The screenshots don’t answer anything.
The important things are the output of your command cmk --debug -vv --discover-marked-hosts and how does the status of your Check_MK Discovery looks like.

Is it something like the following?

WARN - 2 unmonitored services (df:2), no vanished services found, no new host labels, rediscovery scheduled

The discover marked Hosts should be without the line “Nothing to do.”.
If this is inside the output it means no one of your Discovery Checks has found anything to add or remove.

Maybe this is important for you?

https://checkmk.de/check_mk-werks.php?werk_id=10244

Could be :slight_smile: , this is also the reason why we ask most times for the version of the problematic system.

Even with the option “–debug” i am getting the same answer.

image

I am running the Version 1.6.0p9

And what’s with your discovery service?

1.6.0p9 should be save for the problem mentioned before.

Have i missed a solution here…?

It does still do nothing.

That was my question.

image

Where do i find the status of the Check_MK Discovery?
Isn’t it the command in my screentshot?

No the discovery service is one of the services on your hosts. If you created the “Periodic service discovery” rule then you should also have a “Check_MK Discovery” check.
Like this


If you don’t have it then it is clear that there is no automatic discovery working.
And it is also clear that you get the “Nothing to do”.

Thank you, this helps a lot.

There is no service created.

Hallo Andreas, ich habe aber dasselbe Problem:

oder habe ich einen Denkfehler drin?

OMD[pfs]:~$ cmk -vv --check-discovery hostname

  • FETCHING DATA
    [agent] Not using cache (Don’t try it)
    [agent] Execute data source
    […


    OK - no unmonitored services found, 1 vanished services (systemd_units.services:1), no new host labels
    vanished: systemd_units.services: Systemd Service ntpd
    ignored: …
    OMD[pfs]:~$
    OMD[pfs]:~$
    OMD[pfs]:~$ cmk --debug -vv --discover-marked-hosts
    Doing discovery for all marked hosts:
    Nothing to do. No hosts marked by discovery check.
    OMD[pfs]:~$

Der “Denkfehler” ist hier höchstwahrscheinlich in der Discovery Regel - du willst doch bestimmt die verschwundenen Services nicht automatisch wieder bereinigen oder?
Das muss in der Regel auch explizit ausgewählt werden.

Ach verstanden. Das heißt, der Befehl ‘–discover-marked-hosts’ ist der Befehl der Discovery Regel?

Vielen lieben Dank

Kann es sein, das die Regel nur dann funktioniert, wenn ein Agent auf dem Host installiert ist?

Ne nicht direkt - diese Befehle (–discover-marked-hosts und --check-discovery) sind eigentlich nicht geeignet für die Command line.
Dort würde ich nur -I oder -II verwenden für Discovery. Das ist viel eindeutiger -I = alles was neu ist / -II = Tabula Rasa.

–check-discovery = “Check_MK Discovery” in der WebGUI triggern
–discover-marked-hosts = Automation Action wenn es eine Discovery Rule gibt welche automatisch Services aktualisiert, unabhängig davon ob in der Regel nur neues dazu kommt oder auch altes bereinigt werden soll - es ist damit hier nicht erkenntlich was eigentlich passieren soll - halte ich für problematisch

1 Like

Hallo Andreas, danke für die ausführliche Antwort und für deine Zeit

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.