unraid-zabbix_agent/scripts/qemu.discovery.sh

12 lines
197 B
Bash
Raw Normal View History

2020-07-15 03:40:49 +00:00
#!/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 "]"