1

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.

codeforester
  • 39,467
  • 16
  • 112
  • 140
anarchist
  • 383
  • 2
  • 5
  • 18
  • 1) According to the [docs](https://mathias-kettner.de/checkmk_legacy_checks.html), `legacy_checks` are deprecated and you should use `custom_checks` instead. 2) You're missing a quotation mark: `( "check_ftprw", FTP", True)` should be `( "check_ftprw", "FTP", True)`. 3) Are you sure leaving `all_hosts` empty will work? 4) Did you check the check_mk log for errors after restarting? – ThisSuitIsBlackNot Jan 29 '16 at 15:36
  • I have corrected the missing quote but it's the same. If I put localhost inside all_hosts the inventory plugin gives an error about duplicate hosts, in syslog I see nothing relevant related to check_mk – anarchist Jan 29 '16 at 15:57

1 Answers1

0

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

anarchist
  • 383
  • 2
  • 5
  • 18