Install linux check_mk_agent on QNAP 495 NAS

The QNAP 495 NAS is running a custom linux operating system provided by QNAP.

First we need make the xinetd available on the qnap device. It is possible to install an xinetd package using optware. This is a quick walk through the installation steps:

If you do not have installed optware yet you need to install it first. Go to the webinterface of the device and go to the page “Application servers -> qpkg plugins”. There install the correct package of optware. You need to download it first from the qnap website.

After installing optware you can use the ipkg command to install third party packages. If you need to use a proxy to connect to the web you need to configure your proxy e.g. in /etc/wgetrc or /root/.wgetrc using these statements:

http_proxy = http://proxy.domain.com:3128
use_proxy = on

Now you can execute the command:

ipkg install xinetd
configure xinetd

Now you can copy the linux check_mk_agent from e.g. from the Check_MK git repository (http://git.mathias-kettner.de/git/?p=check_mk.git;a=tree;f=agents;hb=HEAD) to your qnap device. A good path to store it is /opt/bin/check_mk_agent. You also need to make it executable.

Now you have to configure the xinted. You can use the sample xinetd.conf from the git repository linked above. But don’t forget to change the paths to the check_mk_agent script.

There are two modifications needed in the /opt/bin/check_mk_agent script to make the agent work:

  • Change the shebang from #!/bin/bash to #!/bin/sh
  • Change the df command to
    df -k | sed 1d | awk '{print $1" ext4 "$2" "$3" "$4" "$5" "$6}'

If you start the xinetd now you should be able to connect to the agent from your Nagios host.

Filed under: Nagios
Comments (0) Trackbacks (0)

No comments yet.

No trackbacks yet.