Skip to content

Instantly share code, notes, and snippets.

@mathse
Created February 12, 2015 18:39
Show Gist options
  • Save mathse/09d56d5aa473917d8852 to your computer and use it in GitHub Desktop.
Save mathse/09d56d5aa473917d8852 to your computer and use it in GitHub Desktop.
check_mk on freenas
## you need to enable tftp under services->tftp
login via ssh
su
cd /usr/local/bin/
mount -uw /
wget -O check_mk_agent "http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/check_mk_agent.freebsd;hb=HEAD"
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"
chmod +x /usr/lib/check_mk_agent/plugins/smart
mount -ur /
@cdbessig
Copy link

cdbessig commented Nov 2, 2021

Thanks! You saved me a ton of agony and time!

@Pitastic
Copy link

Thanks for this snippet. On TrueNAS-12.0-U8.1 re-mounting root / writeable is not necessary.

I just want to mention, that you have to set /usr/local/bin/check_mk as a POST-INIT service in the GUI.

However, the smart plugin does not seem to be executed as the agent is not really aware of the paths when you install it this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment