Compare commits

..

No commits in common. "77975aadbc963b7400743e54370cb1efc4f1505c" and "65190370347d7dda005917290b7e4319119456c7" have entirely different histories.

6 changed files with 7 additions and 72 deletions

View File

@ -3,27 +3,6 @@ VERSION=`xpath -q -e 'string(//PLUGIN/@version)' zabbix_agent.plg`
FILE="zabbix_agent-$VERSION.package.tgz" FILE="zabbix_agent-$VERSION.package.tgz"
echo "Version in plugin file: $VERSION" echo "Version in plugin file: $VERSION"
echo "Generated file will be: $FILE" echo "Generated file will be: $FILE"
if [ -e "$FILE" ]; then
echo "File already exists."
givenMD5=`xpath -q -e 'string(//PLUGIN/@packageMD5)' zabbix_agent.plg`
read currentMD5 _ < <(md5sum "$FILE")
if [ "$givenMD5" = "$currentMD5" ]; then
echo "MD5 value matches."
else
echo "MD5 value does not match!"
echo "unraid_zabbix.plg: $givenMD5"
echo "$FILE: $currentMD5"
fi
if [ "$1" != "--force" ]; then
echo "Stopping now. Call '$0 --force' to force recreating the file."
exit 1
fi
fi
echo "Is this correct? If yes, press Enter. If not, press Ctrl-C." echo "Is this correct? If yes, press Enter. If not, press Ctrl-C."
read read
@ -33,4 +12,3 @@ tar -czvf "$FILE" files
echo echo
read md5 _ < <(md5sum "$FILE") read md5 _ < <(md5sum "$FILE")
echo "MD5 of the resulting file for the plugin file: $md5" echo "MD5 of the resulting file for the plugin file: $md5"
echo "Run this tool again to validate the MD5 value from the plugin file."

View File

@ -27,4 +27,3 @@ UserParameter=unraid.disk[*],/usr/local/emhttp/plugins/zabbix_agent/scripts/disk
UserParameter=unraid.disks.totals,/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.totals.sh UserParameter=unraid.disks.totals,/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.totals.sh
UserParameter=unraid.qemu.discovery,/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.discovery.sh UserParameter=unraid.qemu.discovery,/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.discovery.sh
UserParameter=unraid.qemu[*],/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh "$1" UserParameter=unraid.qemu[*],/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh "$1"
UserParameter=unraid.temperatures,/usr/local/emhttp/plugins/zabbix_agent/scripts/temperatures.sh

View File

@ -16,10 +16,9 @@ while IFS=":" read key value; do
[ "$key" = "Used memory" ] && echo -n ', "memory_used":'$((${value%KiB} * 1024)) [ "$key" = "Used memory" ] && echo -n ', "memory_used":'$((${value%KiB} * 1024))
done < <(virsh dominfo "$VM") done < <(virsh dominfo "$VM")
read interface _ < <(virsh domiflist "$VM" | head -n3 | tail -n1)
while read if key value; do while read if key value; do
[ "$key" = "rx_bytes" ] && echo -n ', "network_bytes_in":'$value [ "$key" = "rx_bytes" ] && echo -n ', "network_bytes_in":'$value
[ "$key" = "tx_bytes" ] && echo -n ', "network_bytes_out":'$value [ "$key" = "tx_bytes" ] && echo -n ', "network_bytes_out":'$value
done < <(virsh domifstat "$VM" "$interface") done < <(virsh domifstat "$VM" vnet0)
echo "}" echo "}"

View File

@ -1,37 +0,0 @@
#!/bin/bash
result=$( sensors )
error="$?"
if [ "$error" -gt 0 ]; then
echo '{"error": "sensors is not installed"}'
exit 1
fi
echo -n "{"
# CPU temp
line=$( grep 'CPU Temp:' <<< "$result" )
error="$?"
echo -n '"cpu": '
if [ "$error" -eq 0 ]; then
read _ _ temp _ <<< "$line"
temp="${temp#+}"
temp="${temp%°C}"
echo -n "$temp"
else
echo -n "null"
fi
# MB
line=$(grep 'MB Temp:' <<< "$result" )
error="$?"
echo -n ', "mainboard": '
if [ "$error" -eq 0 ]; then
read _ _ temp _ <<< "$line"
temp="${temp#+}"
temp="${temp%°C}"
echo -n "$temp"
else
echo -n "null"
fi
echo "}"

View File

@ -6,29 +6,25 @@
<!ENTITY plgauthor "fabianonline"> <!ENTITY plgauthor "fabianonline">
<!ENTITY baseURL "https://git.schle.nz/fabian/unraid-zabbix_agent/raw/branch/main"> <!ENTITY baseURL "https://git.schle.nz/fabian/unraid-zabbix_agent/raw/branch/main">
<!ENTITY pluginURL "&baseURL;/zabbix_agent.plg"> <!ENTITY pluginURL "&baseURL;/zabbix_agent.plg">
<!ENTITY version "2020.08.11"> <!ENTITY version "2020.07.16">
<!ENTITY packageName "zabbix_agent-&version;.package.tgz"> <!ENTITY packageName "zabbix_agent-&version;.package.tgz">
<!ENTITY packageURL "&baseURL;/&packageName;"> <!ENTITY packageURL "&baseURL;/&packageName;">
<!ENTITY packageMD5 "dcf2e2bef5f4f88876ac52ed5ca1046c"> <!ENTITY packageMD5 "2740e36b05204d8f9be5be853cc105cd">
]> ]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" packageMD5="&packageMD5;"> <PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;">
<CHANGES> <CHANGES>
##&name; ##&name;
### 2020.08.11 ### 2020-07-16
- 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. - Package based installation process.
- Added a zabbix template file. - Added a zabbix template file.
### 2020.07.15 ### 2020-07-15
- More metrics - More metrics
### 2020.07.14 ### 2020-07-14
- Initial commit - Initial commit
</CHANGES> </CHANGES>