118 lines
3.6 KiB
XML
118 lines
3.6 KiB
XML
<?xml version='1.0' standalone='yes'?>
|
|
<!DOCTYPE PLUGIN [
|
|
<!ENTITY name "check_mk_agent">
|
|
<!ENTITY author "ich777">
|
|
<!ENTITY version "2021.06.11a">
|
|
<!ENTITY gitURL "https://raw.githubusercontent.com/&author;/unraid-check-mk-agent/master">
|
|
<!ENTITY pluginURL "&gitURL;/&name;.plg">
|
|
<!ENTITY md5 "8172444f3c5b6b86a09ec3b05825714a">
|
|
<!ENTITY plugin "/boot/config/plugins/&name;">
|
|
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
|
|
<!ENTITY xinetd "xinetd-2.3.15.4-x86_64-1_slonly">
|
|
<!ENTITY xinetdmd5 "1da784d01bd5c8a8edb05feeef1ac07e">
|
|
]>
|
|
|
|
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="6.8.3" support="https://forums.unraid.net/topic/83786-support-ich777-application-dockers/">
|
|
|
|
<CHANGES>
|
|
|
|
###2021.06.10a
|
|
- Bumped checkmk_agent to v2.0.0p5
|
|
|
|
###2021.06.10
|
|
- Initial release based on checkmk_agent v1.5.0p25
|
|
|
|
</CHANGES>
|
|
|
|
<FILE Run="/bin/bash">
|
|
<INLINE>
|
|
rm -f $(ls &plugin;/packages/&name;*.tgz 2>/dev/null|grep -v '&version;')
|
|
rm -f $(ls &plugin;/packages/*.txz 2>/dev/null|grep -v '&xinetd;')
|
|
</INLINE>
|
|
</FILE>
|
|
|
|
<FILE Name="&plugin;/packages/&name;-&version;.tgz" Run="upgradepkg --install-new">
|
|
<URL>&gitURL;/packages/&name;-&version;.tgz</URL>
|
|
<MD5>&md5;</MD5>
|
|
</FILE>
|
|
|
|
<FILE Name="&plugin;/packages/&xinetd;.txz" Run="upgradepkg --install-new">
|
|
<URL>&gitURL;/packages/&xinetd;.txz</URL>
|
|
<MD5>&xinetdmd5;</MD5>
|
|
</FILE>
|
|
|
|
<FILE Name="&emhttp;/README.md">
|
|
<INLINE>
|
|
**Checkmk-Agent**
|
|
|
|
Monitors local services and reports any issues to the Checkmk server.
|
|
The agents are passive and connect to TCP Port 6556. Only on receiving a Checkmk server query will they be activated and respond with the required data.
|
|
To install plugins place them in '/boot/config/plugins/check_mk_agent/plugins'
|
|
To use encryption edit the file '/boot/config/plugins/check_mk_agent/encryption.cfg'
|
|
</INLINE>
|
|
</FILE>
|
|
|
|
<FILE Run="/bin/bash">
|
|
<INLINE>
|
|
|
|
#Download icon
|
|
if [ ! -f "&plugin;/checkmk.png" ]; then
|
|
wget -q -nc --show-progress --progress=bar:force:noscroll -O "&plugin;/&name;.png" "https://raw.githubusercontent.com/ich777/docker-templates/master/ich777/images/checkmk.png"
|
|
fi
|
|
|
|
#Create plugins directory and link directories
|
|
if [ ! -d "&plugin;/plugins" ]; then
|
|
mkdir -p &plugin;/plugins
|
|
ln -s /boot/config/plugins/check_mk_agent/plugins /usr/lib/check_mk_agent/plugins
|
|
else
|
|
ln -s /boot/config/plugins/check_mk_agent/plugins /usr/lib/check_mk_agent/plugins
|
|
fi
|
|
|
|
#Create encryption file and link file
|
|
if [ ! -f "&plugin;/encryption.cfg" ]; then
|
|
echo "ENCRYPTED=no
|
|
PASSPHRASE='YOURPASSPHRASE'" > &plugin;/encryption.cfg
|
|
chmod 600 &plugin;/encryption.cfg
|
|
ln -s &plugin;/encryption.cfg /etc/check_mk/encryption.cfg
|
|
else
|
|
chmod 600 &plugin;/encryption.cfg
|
|
ln -s &plugin;/encryption.cfg /etc/check_mk/encryption.cfg
|
|
fi
|
|
|
|
#Install icon
|
|
if [ ! -f "&emhttp;/images/&name;.png" ]; then
|
|
if [ ! -d "&emhttp;/images" ]; then
|
|
mkdir -p &emhttp;/images
|
|
fi
|
|
cp &plugin;/&name;.png &emhttp;/images/
|
|
fi
|
|
|
|
#Start xinetd
|
|
if [ -z "$(pidof xinetd)" ]; then
|
|
xinetd
|
|
fi
|
|
|
|
</INLINE>
|
|
</FILE>
|
|
|
|
<FILE Run="/bin/bash" Method="remove">
|
|
<INLINE>
|
|
|
|
echo "----------------------------------------"
|
|
echo "-------Uninstalling Checkmk-Agent-------"
|
|
echo "----------------------------------------"
|
|
# Kill xinetd and remove plugin related files
|
|
kill $(pidof xinetd) > /dev/null 2>&1
|
|
removepkg &name;-&version;.tgz
|
|
removepkg &xinetd;.tgz
|
|
rm -rf &plugin;
|
|
rm -rf &emhttp;
|
|
echo
|
|
echo "----------------------------------------------------------"
|
|
echo "---------------Checkmk-Agent uninstalled!-----------------"
|
|
echo "----------------------------------------------------------"
|
|
echo
|
|
|
|
</INLINE>
|
|
</FILE>
|
|
</PLUGIN> |