Search This Blog

Friday, October 28, 2016

check_mk agent start by systemd Debian Jessie

I use check_mk everywhere.

For the old school, on Debian system you need install xinetd to start it.
But since we have systemd in Debian 8 Jessie, it will be much cleaner to do systemd way.

Here is how I do it:

  1. Fist if you previous using xinetd, stop and remove it.

  2. # service xinetd stop
    # apt-get purge xinetd
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      libfile-copy-recursive-perl libx265-79 update-inetd
    
    Use 'apt-get autoremove' to remove them.
    The following packages will be REMOVED:
      xinetd*
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    After this operation, 255 kB disk space will be freed.
    Do you want to continue? [Y/n] y
    (Reading database ... 34520 files and directories currently installed.)
    Removing xinetd (1:2.3.15-3) ...
    Purging configuration files for xinetd (1:2.3.15-3) ...
    Processing triggers for man-db (2.7.0.2-5) ...

    And run autoremove to cleanup
    # apt-get autoremove
    
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED:
      libfile-copy-recursive-perl libx265-79 update-inetd
    0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
    After this operation, 3,244 kB disk space will be freed.
    Do you want to continue? [Y/n] y
    (Reading database ... 34490 files and directories currently installed.)
    Removing update-inetd (4.43) ...
    Removing libfile-copy-recursive-perl (0.38-1) ...
    Removing libx265-79:i386 (1.9-3~bpo8+1) ...
    Processing triggers for man-db (2.7.0.2-5) ...
    Processing triggers for libc-bin (2.19-18+deb8u6) ...

  3. Then check your check_mk agent version:
  4. # dpkg -l|grep check-mk
    ii  check-mk-agent                      1.2.8p12-1                        all          Check_MK Agent for Linux

  5. Next enable the check_mk in systemd autostart.

  6. # systemctl enable check_mk.socket
    Created symlink from /etc/systemd/system/sockets.target.wants/check_mk.socket to /etc/systemd/system/check_mk.socket.

  7. Finally start the service.

  8. # systemctl start check_mk.socket

    A special notice, because the systemd not allow the IP rules like xinetd does.
    You will have to update your firewall to restrict other accessing.

    Hope this helps, please let me know if you have any questions.

2 comments:

  1. I'm unable to follow your instructions: it seems like the debian package miss the systemd unit

    # systemctl enable check_mk.socket
    Failed to enable unit: File check_mk.socket: No such file or directory

    ReplyDelete
  2. Hi Alex,

    You need make sure that your check_mk_agent version is greater than 1.2.8.
    The older package doesn't have the systemd hook.

    Please let me know more your version information if you like.

    Best Regards,

    ReplyDelete