Nov 032015

I’ve got one AD integrated NAS4FREE server running on Supermicro hardware.  It is rock solid but still, it would be nice to pull some monitoring info from it, innit?

Related to previous post about local checks with check_mk – based on Monitoring FreeBSD but slightly adapted for use with NAS4FREE, here are quick steps to make it happen. Tested on 9 and 10.


pkg install xinetd
vi /usr/local/etc/xinetd.conf
# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info

service check_mk
 type = UNLISTED
 port = 6556
 socket_type = stream
 protocol = tcp
 wait = no
 user = root
 server = /mnt/tank/service/local/bin/check_mk_agent
 only_from =
 disable = no

vi /etc/services

 check_mk 6556/tcp #check_mk agent

vi /etc/hosts.allow

check_mk_agent : : allow
check_mk_agent : ALL : deny

vi /etc/rc.conf


and then

/usr/local/etc/rc.d/xinetd start


Check_MK comes with a dedicated agent for FreeBSD: check_mk_agent.freebsd – make sure to copy it from OMD server /omd/sites/mysite/share/check_mk/agents/ to /mnt/tank/service/local/bin/check_mk_agent on NAS4FREE server.


Oh, and check out my sophisticated check_mk script that pulls SMART status from disks!

That’s a real piece of art, init?


  9 Responses to “Monitoring NAS4FREE with check_mk”

  1. Hi,
    Thanks for the article,
    Where did you got the xinetd package (for Nas4Free )

    • For nas4free 10-series simple “pkg install xinetd” should do the trick. For nas4free 9, well you have to find this package on FreeBSD 9 mirror, download and install it with “pkg_add -r xinted.tgz” if I’m not mistaken. But better upgrade to ver 10 🙂 Hope this helps.

  2. Thanx for your work, but …
    there is some mistakes in there!

    your “/usr/local/etc/xinetd.conf” does NOT work on my NAS4Free ( Prester). It turned out that not only the syntax lacks a closing bracket, but also that it might be better to split it up into two parts like on the check_mk – server itself, having a xinet.d – directory and a separate config file.

    the “/etc/rc.conf” file only need ONE additional line. The second one is the start command for xinetd – service (just mentioning)

    • Hiya, thanks for poiting this out. Yeah, I messed up syntax when “pretty formatting” code. Now fixed.

      It’s amazing to see that someone is actually reading this stuff 🙂


  3. Hello, thanks for your hint. Even when I start xintetd, I get:
    bnas02: run# /usr/local/etc/rc.d/xinetd start
    Starting xinetd.

    And then:
    bnas02: run# /usr/local/etc/rc.d/xinetd restart
    xinetd not running? (check /var/run/
    Starting xinetd.

    It ssems, that xintetd is not working properly. At the monitoring-box, I try to connect via telnet and get:

    telnet: Unable to connect to remote host: Connection refused

    Do have a hint, what there is going wrong?

    • Assuming you are on ver 10? By a quick look at the init script, it runs /usr/local/sbin/xinetd binary.

      Check with file and ldd

      # file /usr/local/sbin/xinetd
      /usr/local/sbin/xinetd: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/, for FreeBSD 10.1, stripped

      # ldd /usr/local/sbin/xinetd
      /usr/local/sbin/xinetd: => /usr/lib/ (0x800843000) => /lib/ (0x800a4c000) => /lib/ (0x800c75000) => /lib/ (0x800e95000)

      Maybe try removing xinetd package and then putting it back? Try running binary without init script, to see if it produces any output at all.

      Essentially you need to have it running before you can pull any info from it.

      # /usr/local/etc/rc.d/xinetd status
      xinetd is running as pid 5132.


  4. I’m in Version 11…

    I’m in Version 11…

    hostname: ~# file /usr/local/sbin/xinetd
    /usr/local/sbin/xinetd: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/, for FreeBSD 11.0 (1100122), FreeBSD-style, stripped
    hostname: ~# ldd /usr/local/sbin/xinetd
    /usr/local/sbin/xinetd: => /usr/lib/ (0x800846000) => /lib/ (0x800a4f000) => /lib/ (0x800c7a000) => /lib/ (0x800e99000)
    hostname: ~# /usr/local/etc/rc.d/xinetd status
    xinetd is not running.
    hostname: ~# /usr/local/etc/rc.d/xinetd start
    Starting xinetd.
    hostname: ~# /usr/local/etc/rc.d/xinetd status
    xinetd is not running.
    hostname: ~#

    • And what’s happening when you start binary directly, bypassing init script, so


      do you get ANY output?

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>