Jack Moore

Email: jack(at)jmoore53.com
Project Updates

Check MK for Firewalls!!

22 Dec 2021 » ansible, automation, configuration

check_mk on freebsd.

pkg install bash
ln /usr/local/bin/bash /bin/bash

mkdir -p /opt/bin
mkdir -p /opt/etc/xinetd.d

curl "http://10.0.0.X:8080/cmk/check_mk/agents/check_mk.linux" -o /opt/bin/check_mk_agent
chmod +x /opt/bin/check_mk_agent
/opt/bin/check_mk_agent

vi /opt/etc/xinetd.d/check_mk

check_mk Configuration File:

service check_mk
{
	type           = UNLISTED
	port           = 6556
	socket_type    = stream
	protocol       = tcp
	wait           = no
	user           = root
	server         = /opt/bin/check_mk_agent
	log_on_success =
	disable        = no
}
vi /opt/filter_check_mk_cron

filter_check_mk_cron File:

#!/bin/sh

grep includedir /etc/inc/filter.inc
if [ $? -eq 0 ]
then
        exit 0
else
        awk '/fclose\(\$xinetd_fd\)\;/{print "fwrite($xinetd_fd, \"includedir /opt/etc/xinetd.d\");"}1' /etc/inc/filter.inc > /etc/inc/filter.inc.temp
        mv /etc/inc/filter.inc.temp /etc/inc/filter.inc
        /etc/rc.filter_configure
fi
exit 0
chmod +x /opt/filter_check_mk_cron
/opt/filter_check_mk_cron

Update Cron:

*/15    *   *   *   *   root    /opt/filter_check_mk_cron

Check_MK on pfSense 2.4 w/ Update-persistence

© Jack Moore