Compare commits
4 Commits
d5329a3919
...
04fc38f69a
Author | SHA1 | Date | |
---|---|---|---|
04fc38f69a | |||
046fc6daa6 | |||
a1f6fa71a8 | |||
bc40534bce |
@ -9,7 +9,7 @@ while read line; do
|
|||||||
if [ $found = 1 ]; then
|
if [ $found = 1 ]; then
|
||||||
[ $fsFree -ge 0 ] && [ $fsSize -ge 0 ] && fsUsed=$(( $fsSize - $fsFree ))
|
[ $fsFree -ge 0 ] && [ $fsSize -ge 0 ] && fsUsed=$(( $fsSize - $fsFree ))
|
||||||
echo -n '{"device":"'$device'", "name":"'$name'", "status":"'$status'", "temp":'$temp', "size":'$size', "num_reads":'$num_reads', '
|
echo -n '{"device":"'$device'", "name":"'$name'", "status":"'$status'", "temp":'$temp', "size":'$size', "num_reads":'$num_reads', '
|
||||||
echo -n '"num_writes":'$num_writes', "num_errors":'$num_errors', "type":"'$type'", "fs_size":'$fsSize', "fs_free":'$fsFree', "fs_used":'$fsUsed', '
|
echo -n '"num_writes":'$num_writes', "num_errors":'$num_errors', "type":"'$type'", "fs_size":'$fsSize', "fs_free":'$fsFree', "fs_used":'$fsUsed', "running":'$running', '
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
device=''
|
device=''
|
||||||
@ -24,6 +24,7 @@ while read line; do
|
|||||||
fsSize=-1
|
fsSize=-1
|
||||||
fsFree=-1
|
fsFree=-1
|
||||||
fsUsed=-1
|
fsUsed=-1
|
||||||
|
running=-1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
while IFS="=" read key value; do
|
while IFS="=" read key value; do
|
||||||
@ -41,6 +42,12 @@ while read line; do
|
|||||||
[ $key = "type" ] && type="$value"
|
[ $key = "type" ] && type="$value"
|
||||||
[ $key = "fsSize" ] && fsSize=$(( $value * 1024 ))
|
[ $key = "fsSize" ] && fsSize=$(( $value * 1024 ))
|
||||||
[ $key = "fsFree" ] && fsFree=$(( $value * 1024 ))
|
[ $key = "fsFree" ] && fsFree=$(( $value * 1024 ))
|
||||||
|
if [ $key = "color" ]; then
|
||||||
|
case "$value" in
|
||||||
|
green-on) running=1;;
|
||||||
|
green-blink) running=0;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
done <<< "$line"
|
done <<< "$line"
|
||||||
fi
|
fi
|
||||||
done < <(cat /var/local/emhttp/disks.ini ; echo "[empty]")
|
done < <(cat /var/local/emhttp/disks.ini ; echo "[empty]")
|
||||||
|
Binary file not shown.
@ -6,10 +6,10 @@
|
|||||||
<!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.22.1">
|
<!ENTITY version "2020.09.05.1">
|
||||||
<!ENTITY packageName "zabbix_agent-&version;-x86_64-1.txz">
|
<!ENTITY packageName "zabbix_agent-&version;-x86_64-1.txz">
|
||||||
<!ENTITY packageURL "&baseURL;/&packageName;">
|
<!ENTITY packageURL "&baseURL;/&packageName;">
|
||||||
<!ENTITY packageMD5 "1aae2b12fb6827c934d1e70c9c7ab15a">
|
<!ENTITY packageMD5 "14e3dd2d08af436deafc8f924b61e958">
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" packageMD5="&packageMD5;">
|
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" packageMD5="&packageMD5;">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<zabbix_export>
|
<zabbix_export>
|
||||||
<version>5.0</version>
|
<version>5.0</version>
|
||||||
<date>2020-08-28T19:01:50Z</date>
|
<date>2020-09-05T12:40:25Z</date>
|
||||||
<groups>
|
<groups>
|
||||||
<group>
|
<group>
|
||||||
<name>Templates</name>
|
<name>Templates</name>
|
||||||
@ -592,6 +592,29 @@
|
|||||||
<key>unraid.disk[{#ID}]</key>
|
<key>unraid.disk[{#ID}]</key>
|
||||||
</master_item>
|
</master_item>
|
||||||
</item_prototype>
|
</item_prototype>
|
||||||
|
<item_prototype>
|
||||||
|
<name>Disk {#ID} running</name>
|
||||||
|
<type>DEPENDENT</type>
|
||||||
|
<key>unraid.disk[{#ID},running]</key>
|
||||||
|
<delay>0</delay>
|
||||||
|
<applications>
|
||||||
|
<application>
|
||||||
|
<name>Disks</name>
|
||||||
|
</application>
|
||||||
|
</applications>
|
||||||
|
<valuemap>
|
||||||
|
<name>Yes/No</name>
|
||||||
|
</valuemap>
|
||||||
|
<preprocessing>
|
||||||
|
<step>
|
||||||
|
<type>JSONPATH</type>
|
||||||
|
<params>$.running</params>
|
||||||
|
</step>
|
||||||
|
</preprocessing>
|
||||||
|
<master_item>
|
||||||
|
<key>unraid.disk[{#ID}]</key>
|
||||||
|
</master_item>
|
||||||
|
</item_prototype>
|
||||||
<item_prototype>
|
<item_prototype>
|
||||||
<name>Disk {#ID} size</name>
|
<name>Disk {#ID} size</name>
|
||||||
<type>DEPENDENT</type>
|
<type>DEPENDENT</type>
|
||||||
@ -903,4 +926,19 @@ return j.cpu_time / j.cpus * 100;</params>
|
|||||||
</discovery_rules>
|
</discovery_rules>
|
||||||
</template>
|
</template>
|
||||||
</templates>
|
</templates>
|
||||||
|
<value_maps>
|
||||||
|
<value_map>
|
||||||
|
<name>Yes/No</name>
|
||||||
|
<mappings>
|
||||||
|
<mapping>
|
||||||
|
<value>0</value>
|
||||||
|
<newvalue>No</newvalue>
|
||||||
|
</mapping>
|
||||||
|
<mapping>
|
||||||
|
<value>1</value>
|
||||||
|
<newvalue>Yes</newvalue>
|
||||||
|
</mapping>
|
||||||
|
</mappings>
|
||||||
|
</value_map>
|
||||||
|
</value_maps>
|
||||||
</zabbix_export>
|
</zabbix_export>
|
||||||
|
Loading…
Reference in New Issue
Block a user