Compare commits
	
		
			9 Commits
		
	
	
		
			master
			...
			cfbcdb0869
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| cfbcdb0869 | |||
| c1bce8a41c | |||
| 77975aadbc | |||
| e820f6174d | |||
| 1b97010de8 | |||
| a13fe545a1 | |||
| 6519037034 | |||
| 7be58113d8 | |||
| 90166ba51f | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					temp
 | 
				
			||||||
							
								
								
									
										36
									
								
								build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								build.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					VERSION=`xpath -q -e 'string(//PLUGIN/@version)' zabbix_agent.plg`
 | 
				
			||||||
 | 
					FILE="zabbix_agent-$VERSION-x86_64-1.txz"
 | 
				
			||||||
 | 
					echo "Version in plugin file: $VERSION"
 | 
				
			||||||
 | 
					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."
 | 
				
			||||||
 | 
					read
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Creating $FILE..."
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					tar -cv --owner=root --group=root --lzma -C files -f "$FILE" .
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					read md5 _ < <(md5sum "$FILE")
 | 
				
			||||||
 | 
					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."
 | 
				
			||||||
							
								
								
									
										30
									
								
								files/boot/config/plugins/zabbix_agent/zabbix_agentd.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								files/boot/config/plugins/zabbix_agent/zabbix_agentd.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
				
			|||||||
 | 
					Server=0.0.0.0/0
 | 
				
			||||||
 | 
					LogType=system
 | 
				
			||||||
 | 
					AllowRoot=1
 | 
				
			||||||
 | 
					StartAgents=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DenyKey=system.run[*]
 | 
				
			||||||
 | 
					AllowKey=agent.*
 | 
				
			||||||
 | 
					AllowKey=net.if.*
 | 
				
			||||||
 | 
					AllowKey=net.if.*[*]
 | 
				
			||||||
 | 
					AllowKey=proc.*
 | 
				
			||||||
 | 
					AllowKey=proc.*[*]
 | 
				
			||||||
 | 
					AllowKey=sensor[*]
 | 
				
			||||||
 | 
					AllowKey=system.*
 | 
				
			||||||
 | 
					AllowKey=system.*[*]
 | 
				
			||||||
 | 
					AllowKey=vfs.dev.*
 | 
				
			||||||
 | 
					AllowKey=vfs.dev.*[*]
 | 
				
			||||||
 | 
					AllowKey=vfs.fs.*
 | 
				
			||||||
 | 
					AllowKey=vfs.fs.*[*]
 | 
				
			||||||
 | 
					AllowKey=vm.memory.size[*]
 | 
				
			||||||
 | 
					AllowKey=unraid.*
 | 
				
			||||||
 | 
					AllowKey=unraid.*[*]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DenyKey=*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					UserParameter=unraid.disks.discovery,/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.discovery.sh
 | 
				
			||||||
 | 
					UserParameter=unraid.disk[*],/usr/local/emhttp/plugins/zabbix_agent/scripts/disk.sh "$1"
 | 
				
			||||||
 | 
					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[*],/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh "$1"
 | 
				
			||||||
 | 
					UserParameter=unraid.temperatures,/usr/local/emhttp/plugins/zabbix_agent/scripts/temperatures.sh
 | 
				
			||||||
							
								
								
									
										48
									
								
								files/etc/rc.d/rc.zabbix_agentd
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										48
									
								
								files/etc/rc.d/rc.zabbix_agentd
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,48 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# rc.zabbix_agentd      This shell script takes care of starting and stopping
 | 
				
			||||||
 | 
					#               the Zabbix agent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					OPTIONS="-c /boot/config/plugins/zabbix_agent/zabbix_agentd.conf"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					start() {
 | 
				
			||||||
 | 
					        if [ -x /usr/sbin/zabbix_agentd ]; then
 | 
				
			||||||
 | 
					                echo -n "Starting zabbix_agentd: "
 | 
				
			||||||
 | 
					                /usr/sbin/zabbix_agentd $OPTIONS
 | 
				
			||||||
 | 
					                echo " /usr/sbin/zabbix_agentd $OPTIONS"
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					stop() {
 | 
				
			||||||
 | 
					        # Stop daemons.
 | 
				
			||||||
 | 
					        COUNT=0
 | 
				
			||||||
 | 
					        echo -n "Shutting down zabbix_agentd: "
 | 
				
			||||||
 | 
					        while `killall zabbix_agentd 2>/dev/null`; do
 | 
				
			||||||
 | 
					                echo -n "."
 | 
				
			||||||
 | 
					                sleep 1
 | 
				
			||||||
 | 
					                COUNT=$((COUNT+1))
 | 
				
			||||||
 | 
					                if [ $COUNT -ge 30 ]; then
 | 
				
			||||||
 | 
					                        killall -9 zabbix_agentd
 | 
				
			||||||
 | 
					                        sleep 1
 | 
				
			||||||
 | 
					                        break
 | 
				
			||||||
 | 
					                fi
 | 
				
			||||||
 | 
					        done
 | 
				
			||||||
 | 
					        echo " DONE"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# See how we were called.
 | 
				
			||||||
 | 
					case "$1" in
 | 
				
			||||||
 | 
					  start)
 | 
				
			||||||
 | 
					        start
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					  stop)
 | 
				
			||||||
 | 
					        stop
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					  restart|reload)
 | 
				
			||||||
 | 
					        stop
 | 
				
			||||||
 | 
					        start
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					  *)
 | 
				
			||||||
 | 
					        echo $"Usage: $0 {start|stop|restart}"
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					esac
 | 
				
			||||||
							
								
								
									
										5
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					**zabbix_agent**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This plugin installs and configures zabbix_agentd which can be used to monitor this Unraid server using a central Zabbix server.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					You can download a matching zabbix template at https://git.schle.nz/fabian/unraid-zabbix_agent/raw/branch/main/zabbix_template.xml
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 441 B  | 
							
								
								
									
										54
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/disk.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										54
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/disk.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,54 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					id="$1"
 | 
				
			||||||
 | 
					found=0
 | 
				
			||||||
 | 
					device=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					while read line; do
 | 
				
			||||||
 | 
						if [[ $line == "["* ]]; then
 | 
				
			||||||
 | 
							if [ $found = 1 ]; then
 | 
				
			||||||
 | 
								[ $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 '"num_writes":'$num_writes', "num_errors":'$num_errors', "type":"'$type'", "fs_size":'$fsSize', "fs_free":'$fsFree', "fs_used":'$fsUsed', '
 | 
				
			||||||
 | 
								break
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								device=''
 | 
				
			||||||
 | 
								name=''
 | 
				
			||||||
 | 
								status=''
 | 
				
			||||||
 | 
								temp=-1
 | 
				
			||||||
 | 
								size=-1
 | 
				
			||||||
 | 
								num_reads=-1
 | 
				
			||||||
 | 
								num_writes=-1
 | 
				
			||||||
 | 
								num_errors=-1
 | 
				
			||||||
 | 
								type=""
 | 
				
			||||||
 | 
								fsSize=-1
 | 
				
			||||||
 | 
								fsFree=-1
 | 
				
			||||||
 | 
								fsUsed=-1
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							while IFS="=" read key value; do
 | 
				
			||||||
 | 
								value="${value%\"}"
 | 
				
			||||||
 | 
								value="${value#\"}"
 | 
				
			||||||
 | 
								[ $key = "id" ] && [ "$value" = "$id" ] && found=1
 | 
				
			||||||
 | 
								[ $key = "device" ] && device="$value"
 | 
				
			||||||
 | 
								[ $key = "name" ] && name="$value"
 | 
				
			||||||
 | 
								[ $key = "status" ] && status="$value"
 | 
				
			||||||
 | 
								[ $key = "temp" ] && [ "$value" != "*" ] && temp="$value"
 | 
				
			||||||
 | 
								[ $key = "size" ] && size=$(( $value * 1024 ))
 | 
				
			||||||
 | 
								[ $key = "numReads" ] && num_reads="$value"
 | 
				
			||||||
 | 
								[ $key = "numWrites" ] && num_writes="$value"
 | 
				
			||||||
 | 
								[ $key = "numErrors" ] && num_errors="$value"
 | 
				
			||||||
 | 
								[ $key = "type" ] && type="$value"
 | 
				
			||||||
 | 
								[ $key = "fsSize" ] && fsSize=$(( $value * 1024 ))
 | 
				
			||||||
 | 
								[ $key = "fsFree" ] && fsFree=$(( $value * 1024 ))
 | 
				
			||||||
 | 
							done <<< "$line"
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					done < <(cat /var/local/emhttp/disks.ini ; echo "[empty]")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ $found = 0 ]; then
 | 
				
			||||||
 | 
						echo "UNSUPPORTED"
 | 
				
			||||||
 | 
						exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					read bytes_read bytes_written _ < <(grep $device"=" /var/local/emhttp/diskload.ini | cut -d"=" -f2)
 | 
				
			||||||
 | 
					echo '"bytes_reading":'$bytes_read', "bytes_writing":'$bytes_written'}'
 | 
				
			||||||
							
								
								
									
										16
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.discovery.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.discovery.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					id='""'
 | 
				
			||||||
 | 
					device='""'
 | 
				
			||||||
 | 
					first=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -n '['
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					while IFS="=" read key value; do
 | 
				
			||||||
 | 
						if [ "$key" = "id" ] && [ -n "$value" ] && [ "$value" != '""' ]; then
 | 
				
			||||||
 | 
							[ $first = 0 ] && echo -n ","
 | 
				
			||||||
 | 
							first=0
 | 
				
			||||||
 | 
							echo -n '{"{#ID}":'$value'}'
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					done < /var/local/emhttp/disks.ini
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo ']'
 | 
				
			||||||
							
								
								
									
										38
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.totals.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										38
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/disks.totals.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					id="$1"
 | 
				
			||||||
 | 
					found=0
 | 
				
			||||||
 | 
					device=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					data_size=0
 | 
				
			||||||
 | 
					data_free=0
 | 
				
			||||||
 | 
					data_used=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cache_size=0
 | 
				
			||||||
 | 
					cache_free=0
 | 
				
			||||||
 | 
					cache_used=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					while read line; do
 | 
				
			||||||
 | 
						if [[ $line == "["* ]]; then
 | 
				
			||||||
 | 
							if [ "$type" = "Cache" ]; then
 | 
				
			||||||
 | 
								cache_size=$(( $cache_size + $size ))
 | 
				
			||||||
 | 
								cache_free=$(( $cache_free + $free ))
 | 
				
			||||||
 | 
							elif [ "$type" = "Data" ]; then
 | 
				
			||||||
 | 
								data_size=$(( $data_size + $size ))
 | 
				
			||||||
 | 
								data_free=$(( $data_free + $free ))
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
							type=""
 | 
				
			||||||
 | 
							size=0
 | 
				
			||||||
 | 
							free=0
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							IFS="=" read key value <<< "$line"
 | 
				
			||||||
 | 
								value="${value%\"}"
 | 
				
			||||||
 | 
								value="${value#\"}"
 | 
				
			||||||
 | 
								[ $key = "type" ] && type="$value"
 | 
				
			||||||
 | 
								[ $key = "fsSize" ] && size=$(( $value * 1024 ))
 | 
				
			||||||
 | 
								[ $key = "fsFree" ] && free=$(( $value * 1024 ))
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					done < <(cat /var/local/emhttp/disks.ini ; echo "[empty]")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -n '{"data": {"size":'$data_size ', "free":'$data_free ', "used":'$(( $data_size  - $data_free  ))'},'
 | 
				
			||||||
 | 
					echo    ' "cache":{"size":'$cache_size', "free":'$cache_free', "used":'$(( $cache_size - $cache_free ))'}}'
 | 
				
			||||||
							
								
								
									
										11
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.discovery.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.discovery.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					first=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -n "["
 | 
				
			||||||
 | 
					while read name; do
 | 
				
			||||||
 | 
						[ "$name" = "" ] && continue
 | 
				
			||||||
 | 
						[ $first = 0 ] && echo -n ","
 | 
				
			||||||
 | 
						first=0
 | 
				
			||||||
 | 
						echo -n '{"{#VM}":"'$name'"}'
 | 
				
			||||||
 | 
					done < <(virsh list --name --all)
 | 
				
			||||||
 | 
					echo "]"
 | 
				
			||||||
							
								
								
									
										25
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										25
									
								
								files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					VM="$1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo -n '{'
 | 
				
			||||||
 | 
					state=`virsh domstate "$VM"`
 | 
				
			||||||
 | 
					echo -n '"state":"'$state'"'
 | 
				
			||||||
 | 
					if [ "$state" != "running" ]; then
 | 
				
			||||||
 | 
						echo -n '}'
 | 
				
			||||||
 | 
						exit
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					while IFS=":" read key value; do
 | 
				
			||||||
 | 
						[ "$key" = "CPU(s)" ] && echo -n ', "cpus":'$value
 | 
				
			||||||
 | 
						[ "$key" = "CPU time" ] && echo -n ', "cpu_time":'${value%s}
 | 
				
			||||||
 | 
						[ "$key" = "Max memory" ] && echo -n ', "memory_max":'$((${value%KiB} * 1024))
 | 
				
			||||||
 | 
						[ "$key" = "Used memory" ] && echo -n ', "memory_used":'$((${value%KiB} * 1024))
 | 
				
			||||||
 | 
					done < <(virsh dominfo "$VM")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					read interface _ < <(virsh domiflist "$VM" | head -n3 | tail -n1)
 | 
				
			||||||
 | 
					while read if key value; do
 | 
				
			||||||
 | 
						[ "$key" = "rx_bytes" ] && echo -n ', "network_bytes_in":'$value
 | 
				
			||||||
 | 
						[ "$key" = "tx_bytes" ] && echo -n ', "network_bytes_out":'$value
 | 
				
			||||||
 | 
					done < <(virsh domifstat "$VM" "$interface")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "}"
 | 
				
			||||||
@@ -0,0 +1,37 @@
 | 
				
			|||||||
 | 
					#!/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 "}"
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								zabbix_agent-2020.08.11.1-x86_64-1.txz
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								zabbix_agent-2020.08.11.1-x86_64-1.txz
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										81
									
								
								zabbix_agent.plg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								zabbix_agent.plg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,81 @@
 | 
				
			|||||||
 | 
					<?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">
 | 
				
			||||||
 | 
					<!ENTITY version             "2020.08.11.1">
 | 
				
			||||||
 | 
					<!ENTITY packageName         "zabbix_agent-&version;-x86_64-1.txz">
 | 
				
			||||||
 | 
					<!ENTITY packageURL          "&baseURL;/&packageName;">
 | 
				
			||||||
 | 
					<!ENTITY packageMD5          "5eedea739129f638ac5098945039d43b">
 | 
				
			||||||
 | 
					]>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" packageMD5="&packageMD5;">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<CHANGES>
 | 
				
			||||||
 | 
					##&name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 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.07.15
 | 
				
			||||||
 | 
					- More metrics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 2020.07.14
 | 
				
			||||||
 | 
					- 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."
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						echo "Current &packageName; not found; removing old packages (if existing)."
 | 
				
			||||||
 | 
						rm /boot/config/plugins/zabbix_agent/*.package.tgz
 | 
				
			||||||
 | 
						echo "Downloading current package..."
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					</INLINE></FILE>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<FILE Name="/boot/config/plugins/zabbix_agent/&packageName;">
 | 
				
			||||||
 | 
					<URL>&packageURL;</URL>
 | 
				
			||||||
 | 
					<MD5>&packageMD5;</MD5>
 | 
				
			||||||
 | 
					</FILE>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Extracting support files..."
 | 
				
			||||||
 | 
					upgradepkg --install-new /boot/config/plugins/zabbix_agent/&packageName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Starting zabbix_agent..."
 | 
				
			||||||
 | 
					/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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Removal of zabbix_agent plugin completed."
 | 
				
			||||||
 | 
					</INLINE></FILE>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</PLUGIN>
 | 
				
			||||||
							
								
								
									
										846
									
								
								zabbix_template.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										846
									
								
								zabbix_template.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,846 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<zabbix_export>
 | 
				
			||||||
 | 
					    <version>5.0</version>
 | 
				
			||||||
 | 
					    <date>2020-07-17T03:56:57Z</date>
 | 
				
			||||||
 | 
					    <groups>
 | 
				
			||||||
 | 
					        <group>
 | 
				
			||||||
 | 
					            <name>Servers</name>
 | 
				
			||||||
 | 
					        </group>
 | 
				
			||||||
 | 
					    </groups>
 | 
				
			||||||
 | 
					    <templates>
 | 
				
			||||||
 | 
					        <template>
 | 
				
			||||||
 | 
					            <template>Unraid server</template>
 | 
				
			||||||
 | 
					            <name>Unraid server</name>
 | 
				
			||||||
 | 
					            <groups>
 | 
				
			||||||
 | 
					                <group>
 | 
				
			||||||
 | 
					                    <name>Servers</name>
 | 
				
			||||||
 | 
					                </group>
 | 
				
			||||||
 | 
					            </groups>
 | 
				
			||||||
 | 
					            <applications>
 | 
				
			||||||
 | 
					                <application>
 | 
				
			||||||
 | 
					                    <name>CPUs</name>
 | 
				
			||||||
 | 
					                </application>
 | 
				
			||||||
 | 
					                <application>
 | 
				
			||||||
 | 
					                    <name>Disks</name>
 | 
				
			||||||
 | 
					                </application>
 | 
				
			||||||
 | 
					                <application>
 | 
				
			||||||
 | 
					                    <name>Memory</name>
 | 
				
			||||||
 | 
					                </application>
 | 
				
			||||||
 | 
					                <application>
 | 
				
			||||||
 | 
					                    <name>VMs</name>
 | 
				
			||||||
 | 
					                </application>
 | 
				
			||||||
 | 
					            </applications>
 | 
				
			||||||
 | 
					            <items>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Zabbix agent ping</name>
 | 
				
			||||||
 | 
					                    <key>agent.ping</key>
 | 
				
			||||||
 | 
					                    <triggers>
 | 
				
			||||||
 | 
					                        <trigger>
 | 
				
			||||||
 | 
					                            <expression>{nodata(10m)}=1</expression>
 | 
				
			||||||
 | 
					                            <name>Zabbix agent is offline</name>
 | 
				
			||||||
 | 
					                            <priority>HIGH</priority>
 | 
				
			||||||
 | 
					                        </trigger>
 | 
				
			||||||
 | 
					                    </triggers>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>CPU total utilisation guest</name>
 | 
				
			||||||
 | 
					                    <key>system.cpu.util[all,guest,avg1]</key>
 | 
				
			||||||
 | 
					                    <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>CPUs</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>CPU total utilisation idle</name>
 | 
				
			||||||
 | 
					                    <key>system.cpu.util[all,idle,avg1]</key>
 | 
				
			||||||
 | 
					                    <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>CPUs</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>CPU total utilisation iowait</name>
 | 
				
			||||||
 | 
					                    <key>system.cpu.util[all,iowait,avg1]</key>
 | 
				
			||||||
 | 
					                    <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>CPUs</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>CPU total utilisation system</name>
 | 
				
			||||||
 | 
					                    <key>system.cpu.util[all,system,avg1]</key>
 | 
				
			||||||
 | 
					                    <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>CPUs</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>CPU total utilisation user</name>
 | 
				
			||||||
 | 
					                    <key>system.cpu.util[all,user,avg1]</key>
 | 
				
			||||||
 | 
					                    <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>CPUs</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Disk totals</name>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.totals</key>
 | 
				
			||||||
 | 
					                    <history>0</history>
 | 
				
			||||||
 | 
					                    <trends>0</trends>
 | 
				
			||||||
 | 
					                    <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Disks</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Total cache free</name>
 | 
				
			||||||
 | 
					                    <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.totals[cache,free]</key>
 | 
				
			||||||
 | 
					                    <delay>0</delay>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Disks</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                    <preprocessing>
 | 
				
			||||||
 | 
					                        <step>
 | 
				
			||||||
 | 
					                            <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                            <params>$.cache.free</params>
 | 
				
			||||||
 | 
					                        </step>
 | 
				
			||||||
 | 
					                    </preprocessing>
 | 
				
			||||||
 | 
					                    <master_item>
 | 
				
			||||||
 | 
					                        <key>unraid.disks.totals</key>
 | 
				
			||||||
 | 
					                    </master_item>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Total cache size</name>
 | 
				
			||||||
 | 
					                    <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.totals[cache,size]</key>
 | 
				
			||||||
 | 
					                    <delay>0</delay>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Disks</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                    <preprocessing>
 | 
				
			||||||
 | 
					                        <step>
 | 
				
			||||||
 | 
					                            <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                            <params>$.cache.size</params>
 | 
				
			||||||
 | 
					                        </step>
 | 
				
			||||||
 | 
					                    </preprocessing>
 | 
				
			||||||
 | 
					                    <master_item>
 | 
				
			||||||
 | 
					                        <key>unraid.disks.totals</key>
 | 
				
			||||||
 | 
					                    </master_item>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Total cache used</name>
 | 
				
			||||||
 | 
					                    <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.totals[cache,used]</key>
 | 
				
			||||||
 | 
					                    <delay>0</delay>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Disks</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                    <preprocessing>
 | 
				
			||||||
 | 
					                        <step>
 | 
				
			||||||
 | 
					                            <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                            <params>$.cache.used</params>
 | 
				
			||||||
 | 
					                        </step>
 | 
				
			||||||
 | 
					                    </preprocessing>
 | 
				
			||||||
 | 
					                    <master_item>
 | 
				
			||||||
 | 
					                        <key>unraid.disks.totals</key>
 | 
				
			||||||
 | 
					                    </master_item>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Total data free</name>
 | 
				
			||||||
 | 
					                    <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.totals[data,free]</key>
 | 
				
			||||||
 | 
					                    <delay>0</delay>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Disks</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                    <preprocessing>
 | 
				
			||||||
 | 
					                        <step>
 | 
				
			||||||
 | 
					                            <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                            <params>$.data.free</params>
 | 
				
			||||||
 | 
					                        </step>
 | 
				
			||||||
 | 
					                    </preprocessing>
 | 
				
			||||||
 | 
					                    <master_item>
 | 
				
			||||||
 | 
					                        <key>unraid.disks.totals</key>
 | 
				
			||||||
 | 
					                    </master_item>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Total data size</name>
 | 
				
			||||||
 | 
					                    <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.totals[data,size]</key>
 | 
				
			||||||
 | 
					                    <delay>0</delay>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Disks</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                    <preprocessing>
 | 
				
			||||||
 | 
					                        <step>
 | 
				
			||||||
 | 
					                            <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                            <params>$.data.size</params>
 | 
				
			||||||
 | 
					                        </step>
 | 
				
			||||||
 | 
					                    </preprocessing>
 | 
				
			||||||
 | 
					                    <master_item>
 | 
				
			||||||
 | 
					                        <key>unraid.disks.totals</key>
 | 
				
			||||||
 | 
					                    </master_item>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Total data used</name>
 | 
				
			||||||
 | 
					                    <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.totals[data,used]</key>
 | 
				
			||||||
 | 
					                    <delay>0</delay>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Disks</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                    <preprocessing>
 | 
				
			||||||
 | 
					                        <step>
 | 
				
			||||||
 | 
					                            <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                            <params>$.data.used</params>
 | 
				
			||||||
 | 
					                        </step>
 | 
				
			||||||
 | 
					                    </preprocessing>
 | 
				
			||||||
 | 
					                    <master_item>
 | 
				
			||||||
 | 
					                        <key>unraid.disks.totals</key>
 | 
				
			||||||
 | 
					                    </master_item>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Memory available</name>
 | 
				
			||||||
 | 
					                    <key>vm.memory.size[available]</key>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Memory</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					                <item>
 | 
				
			||||||
 | 
					                    <name>Memory used</name>
 | 
				
			||||||
 | 
					                    <key>vm.memory.size[used]</key>
 | 
				
			||||||
 | 
					                    <units>B</units>
 | 
				
			||||||
 | 
					                    <applications>
 | 
				
			||||||
 | 
					                        <application>
 | 
				
			||||||
 | 
					                            <name>Memory</name>
 | 
				
			||||||
 | 
					                        </application>
 | 
				
			||||||
 | 
					                    </applications>
 | 
				
			||||||
 | 
					                </item>
 | 
				
			||||||
 | 
					            </items>
 | 
				
			||||||
 | 
					            <discovery_rules>
 | 
				
			||||||
 | 
					                <discovery_rule>
 | 
				
			||||||
 | 
					                    <name>CPUs</name>
 | 
				
			||||||
 | 
					                    <key>system.cpu.discovery</key>
 | 
				
			||||||
 | 
					                    <delay>1h</delay>
 | 
				
			||||||
 | 
					                    <item_prototypes>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>CPU #{#CPU.NUMBER} utilisation guest</name>
 | 
				
			||||||
 | 
					                            <key>system.cpu.util[{#CPU.NUMBER},guest,avg1]</key>
 | 
				
			||||||
 | 
					                            <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>CPUs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>CPU #{#CPU.NUMBER} utilisation idle</name>
 | 
				
			||||||
 | 
					                            <key>system.cpu.util[{#CPU.NUMBER},idle,avg1]</key>
 | 
				
			||||||
 | 
					                            <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>CPUs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>CPU #{#CPU.NUMBER} utilisation iowait</name>
 | 
				
			||||||
 | 
					                            <key>system.cpu.util[{#CPU.NUMBER},iowait,avg1]</key>
 | 
				
			||||||
 | 
					                            <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>CPUs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>CPU #{#CPU.NUMBER} utilisation system</name>
 | 
				
			||||||
 | 
					                            <key>system.cpu.util[{#CPU.NUMBER},system,avg1]</key>
 | 
				
			||||||
 | 
					                            <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>CPUs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>CPU #{#CPU.NUMBER} utilisation user</name>
 | 
				
			||||||
 | 
					                            <key>system.cpu.util[{#CPU.NUMBER},user,avg1]</key>
 | 
				
			||||||
 | 
					                            <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>CPUs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                    </item_prototypes>
 | 
				
			||||||
 | 
					                </discovery_rule>
 | 
				
			||||||
 | 
					                <discovery_rule>
 | 
				
			||||||
 | 
					                    <name>Disks</name>
 | 
				
			||||||
 | 
					                    <key>unraid.disks.discovery</key>
 | 
				
			||||||
 | 
					                    <delay>10m</delay>
 | 
				
			||||||
 | 
					                    <item_prototypes>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} current reading</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},bytes_reading]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B/s</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.bytes_reading</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} current writing</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},bytes_writing]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B/s</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.bytes_writing</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} device</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},device]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <trends>0</trends>
 | 
				
			||||||
 | 
					                            <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.device</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} FS free</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},fs_free]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.fs_free</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} FS size</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},fs_size]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.fs_size</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} FS used</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},fs_used]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.fs_used</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} name</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},name]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <trends>0</trends>
 | 
				
			||||||
 | 
					                            <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.name</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} errors</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},num_errors]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.num_errors</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                            <trigger_prototypes>
 | 
				
			||||||
 | 
					                                <trigger_prototype>
 | 
				
			||||||
 | 
					                                    <expression>{change()}>0</expression>
 | 
				
			||||||
 | 
					                                    <recovery_mode>NONE</recovery_mode>
 | 
				
			||||||
 | 
					                                    <name>Disk {#ID} errored</name>
 | 
				
			||||||
 | 
					                                    <priority>HIGH</priority>
 | 
				
			||||||
 | 
					                                    <manual_close>YES</manual_close>
 | 
				
			||||||
 | 
					                                </trigger_prototype>
 | 
				
			||||||
 | 
					                            </trigger_prototypes>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} reads</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},num_reads]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.num_reads</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} writes</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},num_writes]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.num_writes</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} size</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},size]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.size</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} status</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},status]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <trends>0</trends>
 | 
				
			||||||
 | 
					                            <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.status</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                            <trigger_prototypes>
 | 
				
			||||||
 | 
					                                <trigger_prototype>
 | 
				
			||||||
 | 
					                                    <expression>{str(DISK_OK)}=0</expression>
 | 
				
			||||||
 | 
					                                    <name>Disk {#ID} state is $1</name>
 | 
				
			||||||
 | 
					                                    <priority>HIGH</priority>
 | 
				
			||||||
 | 
					                                </trigger_prototype>
 | 
				
			||||||
 | 
					                            </trigger_prototypes>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} temp</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},temp]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>°C</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.temp</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} type</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID},type]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <trends>0</trends>
 | 
				
			||||||
 | 
					                            <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.type</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>Disk {#ID} data</name>
 | 
				
			||||||
 | 
					                            <key>unraid.disk[{#ID}]</key>
 | 
				
			||||||
 | 
					                            <history>0</history>
 | 
				
			||||||
 | 
					                            <trends>0</trends>
 | 
				
			||||||
 | 
					                            <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>Disks</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                    </item_prototypes>
 | 
				
			||||||
 | 
					                </discovery_rule>
 | 
				
			||||||
 | 
					                <discovery_rule>
 | 
				
			||||||
 | 
					                    <name>VMs</name>
 | 
				
			||||||
 | 
					                    <key>unraid.qemu.discovery</key>
 | 
				
			||||||
 | 
					                    <delay>10m</delay>
 | 
				
			||||||
 | 
					                    <item_prototypes>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} CPUs</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},cpus]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.cpus</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} CPU percentage</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},cpu_percentage]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JAVASCRIPT</type>
 | 
				
			||||||
 | 
					                                    <params>j=JSON.parse(value);
 | 
				
			||||||
 | 
					return j.cpu_time / j.cpus * 100;</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>CHANGE_PER_SECOND</type>
 | 
				
			||||||
 | 
					                                    <params/>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} CPU time</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},cpu_time]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <value_type>FLOAT</value_type>
 | 
				
			||||||
 | 
					                            <units>s</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.cpu_time</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} Memory max</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},memory_max]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.memory_max</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} Memory used</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},memory_used]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.memory_used</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} Network In</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},network_in]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B/s</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.network_bytes_in</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>CHANGE_PER_SECOND</type>
 | 
				
			||||||
 | 
					                                    <params/>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} Network Out</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},network_out]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <units>B/s</units>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.network_bytes_out</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>CHANGE_PER_SECOND</type>
 | 
				
			||||||
 | 
					                                    <params/>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} state</name>
 | 
				
			||||||
 | 
					                            <type>DEPENDENT</type>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM},state]</key>
 | 
				
			||||||
 | 
					                            <delay>0</delay>
 | 
				
			||||||
 | 
					                            <trends>0</trends>
 | 
				
			||||||
 | 
					                            <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                            <preprocessing>
 | 
				
			||||||
 | 
					                                <step>
 | 
				
			||||||
 | 
					                                    <type>JSONPATH</type>
 | 
				
			||||||
 | 
					                                    <params>$.state</params>
 | 
				
			||||||
 | 
					                                </step>
 | 
				
			||||||
 | 
					                            </preprocessing>
 | 
				
			||||||
 | 
					                            <master_item>
 | 
				
			||||||
 | 
					                                <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            </master_item>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                        <item_prototype>
 | 
				
			||||||
 | 
					                            <name>VM {#VM} data</name>
 | 
				
			||||||
 | 
					                            <key>unraid.qemu[{#VM}]</key>
 | 
				
			||||||
 | 
					                            <history>0</history>
 | 
				
			||||||
 | 
					                            <trends>0</trends>
 | 
				
			||||||
 | 
					                            <value_type>TEXT</value_type>
 | 
				
			||||||
 | 
					                            <applications>
 | 
				
			||||||
 | 
					                                <application>
 | 
				
			||||||
 | 
					                                    <name>VMs</name>
 | 
				
			||||||
 | 
					                                </application>
 | 
				
			||||||
 | 
					                            </applications>
 | 
				
			||||||
 | 
					                        </item_prototype>
 | 
				
			||||||
 | 
					                    </item_prototypes>
 | 
				
			||||||
 | 
					                </discovery_rule>
 | 
				
			||||||
 | 
					            </discovery_rules>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					    </templates>
 | 
				
			||||||
 | 
					</zabbix_export>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user