Skip to content
Advertisement

Check_MK – configuring legacy check

I am running OMD 1.20 -latest according to official website, Check_MK 1.2.4p5 community edition on an Ubuntu 14.04.3 LTS machine.

I need to configure a FTP check that will check also the credentials and reading/writing a file. The standard plugins do not offer such a feature from what I know so I am trying to use a custom plugin, specifically: https://exchange.nagios.org/directory/Plugins/Network-Protocols/FTP/check_ftp_rw/details

So the monitoring server is supposed to test an external FTP server that does not have the agent installed. I have the plugin in /usr/lib/nagios/plugins and have ran it manually and it works ok.

Now I am trying to configure it as a check in check_mk so I did the following in /opt/omd/sites/monitoring/etc/check_mk/main.mk

# Put your host names here
# all_hosts = [ 'localhost' ]
all_hosts = [ ]

extra_nagios_conf += r"""

define command {

    command_name    check_ftprw
    command_line    /usr/lib/nagios/plugins/check_ftp_rw --host ftp.test.com --user test --password 'test123' --dir pub

}

"""
legacy_checks = [

  ( ( "check_ftprw", FTP", True), [ "localhost"] ),

]

I restart the omd site and check the inventory but it nevers picks up this check.

Advertisement

Answer

I have solved this problem, the config is ok, then we need to reload check_mk: cmk -O

Then we need to check that the command is registered in check_mk_objects.cfg:

# extra_nagios_conf



define command {

    command_name    check_ftprw
    command_line    /usr/lib/nagios/plugins/check_ftp_rw --host ftp.xxx --user test --password 'test' --dir pub --file test.txt --write

}

We can check the agent output using: check_mk_agent

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement