Disable ping check and only check by open port is host is up

  • Hello,


    is there a way to check if a host is up only by checking if a certian port e.g. 6557 is open? - The host should be marked at up even if it is not reachable via ICMP/ping.

  • Ah sorry, I was in the "answer all open questions after a conference week" rush.


    https://docs.icinga.com/icinga…#plugin-check-command-tcp


    which could look like this then in your question:


    Code
    1. object Host "tcp-host" {
    2. check_command = "tcp"
    3. vars.tcp_port = 6557
    4. }

    It might need more parameters, depending on your requirements.

  • I thought there is a direct way over the WATO. - Where do you place the configuration file? - The question is refering to Check MK.

  • Oh. Nevermind, I was reading the wrong forum section. I thought you were talking about Icinga 2.


    Unfortunately I don't know much about CheckMK, but I would guess that you can somehow manage to change the host's check command over there as well.

  • There is a way to configure that over WATO:

    WATO Rules -> Monitoring Configuration -> Host Check Command


    There you can define a TCP check on your desired port as the check command.

  • There is a way to configure that over WATO:

    WATO Rules -> Monitoring Configuration -> Host Check Command


    There you can define a TCP check on your desired port as the check command.

    Thanks TheLucKy,


    I already created a rule and assigned it to the host:


    Now Check_MK show the host at up but - the PIng is still monitored and throws CRIT messages.


    How can I disable the Ping here?


    Here you see the assigned rule:


  • The PING service is assigned automatically by cmk. You should be able to stop cmk from doing that by defining a custom check via


    Active checks -> check connecting to a TCP port


    So your host got at least one service.

  • I created an active check for the TCP port 6557. But the check is still pending. Although the port 6557 is reachable if i check it manually over telnet - the host is marked as down:


  • Search in your filesystem for the nagios plugin "check_tcp" and run the plugin as the user check_mk is running on. Seems like a problem with the access rights.

  • Code
    1. OMD[siteuser]:~/lib/nagios/plugins$ ./check_tcp -H teststh.dns.de -p 6557
    2. TCP OK - 0.021 second response time on teststh.dns.de port 6557|time=0.020955s;;;0.000000;10.000000

    That seems to work.

  • Yes, I am able to do that. - But the problem here is that I am using a dyndns for site. - And the IP address will change.

  • Yes, now I tried but with the same result. Though WATO is woring me "Invalid IP address syntax" when I enter a dyndns-Name for the option "IP address".

  • There is an option for DNS name in the rule of the active check. Did you enter the dns name there too?


    You might want to try to update the dns cache of cmk aswell:


    Code
    1. # cmk --update-dns-cache
  • okay, the Hostname is now also set in the active check. But not working yet.

    I am a lit bit confused because when i go to Hosts and select the host > services I see that the check is working:



    But the views the service on that host is still in the status PEND.

  • You mean by press this pressing "reschedule check" ?

    after done that the service is still pending


    Do need an extra rule for hosts that are reachable over a dyndns name?