Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yennor/ccc508537c9b0f8daf637f8fc1d262dc to your computer and use it in GitHub Desktop.
Save yennor/ccc508537c9b0f8daf637f8fc1d262dc to your computer and use it in GitHub Desktop.
check_mk on freenas 11
## you need to enable tftp under services->tftp, it's a hack to get inetd service started.
login via ssh
su
cd /usr/local/bin/
wget -O check_mk_agent "https://github.com/tribe29/checkMK/raw/master/agents/check_mk_agent.freebsd"
chmod a+x check_mk_agent
# restrict access
echo "check_mk 6556/tcp #check_mk agent" >> /etc/services
echo "check_mk stream tcp nowait root /usr/local/bin/check_mk_agent check_mk_agent" >> /etc/inetd.conf
echo "check_mk_agent : <your nagios host> : allow" >> /etc/hosts.allow
echo "check_mk_agent : 127.0.0.1 : allow" >> /etc/hosts.allow
echo "check_mk_agent : ALL : deny" >> /etc/hosts.allow
echo "check_mk 6556/tcp #check_mk agent" >> /conf/base/etc/services
echo "check_mk stream tcp nowait root /usr/local/bin/check_mk_agent check_mk_agent" >> /conf/base/etc/inetd.conf
echo "check_mk_agent : <your nagios host> : allow" >> /conf/base/etc/hosts.allow
echo "check_mk_agent : 127.0.0.1 : allow" >> /conf/base/etc/hosts.allow
echo "check_mk_agent : ALL : deny" >> /conf/base/etc/hosts.allow
# create plugin directory
mkdir -p /usr/lib/check_mk_agent/plugins
cd /usr/lib/check_mk_agent/plugins
# enable smart plugin
wget -O smart "http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/plugins/smart;hb=HEAD"
#actually the one from check_mk doesn't seem to work, so i've used
# https://github.com/zmielna/smart_diskinfo/blob/master/check_mk_smart_freebsd.sh
chmod +x /usr/lib/check_mk_agent/plugins/smart
/etc/rc.d/inetd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment