unraid-zabbix_agent/zabbix_agent.plg

82 lines
2.3 KiB
Plaintext
Raw Normal View History

2020-07-15 03:40:49 +00:00
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "zabbix_agent">
<!ENTITY author "fabianonline">
<!ENTITY plgauthor "fabianonline">
<!ENTITY baseURL "https://git.schle.nz/fabian/unraid-zabbix_agent/raw/branch/main">
<!ENTITY pluginURL "&baseURL;/zabbix_agent.plg">
2020-08-22 12:29:46 +00:00
<!ENTITY version "2020.08.22.1">
<!ENTITY packageName "zabbix_agent-&version;-x86_64-1.txz">
<!ENTITY packageURL "&baseURL;/&packageName;">
2020-08-22 12:29:46 +00:00
<!ENTITY packageMD5 "1aae2b12fb6827c934d1e70c9c7ab15a">
2020-07-15 03:40:49 +00:00
]>
2020-08-12 04:02:59 +00:00
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" packageMD5="&packageMD5;">
2020-07-15 03:40:49 +00:00
<CHANGES>
##&name;
2020-08-12 04:02:59 +00:00
### 2020.08.11
- Added system temperature metrics. Note: These will only work if you have the Dynamix System Temperature plugin installed.
- Fixed the virtual interface detection in unraid.qemu.
### 2020.07.16
- Package based installation process.
- Added a zabbix template file.
2020-08-12 04:02:59 +00:00
### 2020.07.15
- More metrics
2020-08-12 04:02:59 +00:00
### 2020.07.14
2020-07-15 03:40:49 +00:00
- Initial commit
</CHANGES>
<FILE Run="/bin/bash"><INLINE>
echo "Installation of zabbix_agent plugin started."
if [ -e /boot/config/plugins/zabbix_agent/&packageName; ]; then
echo "Package already exists."
2020-07-15 03:40:49 +00:00
else
echo "Current &packageName; not found; removing old packages (if existing)."
rm /boot/config/plugins/zabbix_agent/*.package.tgz
echo "Downloading current package..."
2020-07-15 03:40:49 +00:00
fi
2020-07-16 04:09:16 +00:00
</INLINE></FILE>
<FILE Name="/boot/config/plugins/zabbix_agent/&packageName;">
<URL>&packageURL;</URL>
<MD5>&packageMD5;</MD5>
</FILE>
2020-07-15 03:40:49 +00:00
<FILE Run="/bin/bash"><INLINE>
if [ -x /etc/rc.d/rc.zabbix_agentd ]; then
echo "Stopping old zabbix agent..."
/etc/rc.d/rc.zabbix_agentd stop
fi
2020-07-15 03:40:49 +00:00
echo "Extracting support files..."
upgradepkg --install-new /boot/config/plugins/zabbix_agent/&packageName;
2020-07-15 03:40:49 +00:00
echo "Starting zabbix_agent..."
2020-07-15 03:40:49 +00:00
/etc/rc.d/rc.zabbix_agentd start
</INLINE></FILE>
<!--- Uninstall -->
<FILE Run="/bin/bash" Method="remove"><INLINE>
echo "Removal of zabbix_agent plugin started."
echo "Stopping zabbix_agentd..."
/etc/rc.d/rc.zabbix_agentd stop
echo "Uninstalling package..."
removepkg zabbix_agent
echo "Removing remaining plugin files..."
rm -rf /boot/config/plugins/zabbix_agent
2020-07-15 03:40:49 +00:00
echo "Removal of zabbix_agent plugin completed."
</INLINE></FILE>
</PLUGIN>