Check to ping google from host in check_mk using WATO

check-mkmonitoring

I'm new to check_mk and got it installed using OMD (last daily version). I'm trying to create a check so my hosts ping google to see if their network connection to the internet is working. I thought something so basic could be available using wato but I can't find it and as I have defined all using WATO now I'm not sure how to configure this manually.

I tried to add in the /omd/sites/mysite/etc/check_mk/main.mk the following

extra_nagios_conf += r"""

define command {
command_name check_tcp_http
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 80
}

legacy_checks = [
( ( "check_tcp_http!www.google.com", "HTTP Service", True), [ "httpd" ], ALL_HOSTS ),
]

but get an error when check_mk tries to read the main.mk

Any idea how to accomplish what I want?

Best Answer

You can use MRPE with nagios-plugins-icmp:

For example in centos agent:

# yum -y install epel-release
# yum -y install nagios-plugins-icmp

# cat /etc/check_mk/mrpe.cfg
  PingDNS8888 /usr/lib/nagios/plugins/check_icmp 8.8.8.8

Path in x86_64 maybe

/usr/lib64/nagios/plugins/check_icmp

That's all.

Related Topic