File manager - Edit - /usr/lib64/nagios/plugins/check_vm_status.sh
Back
#!/bin/bash OK=0 WARNING=1 CRITICAL=2 UNKNOWN=3 VMS=$(pvesh get nodes/$(hostname -s)/qemu --output-format json |jq -r '.[]|select(.uptime != 0)|select(.template != 1)|select(.tags | contains("suspended") or contains("cancelled") or contains("delete") or contains("fraud")) | .name' | paste -sd ',' 2>/dev/null) if [ $? -ne 0 ]; then echo "Failed to execute pvesh command" exit $UNKNOWN fi if [ -n "$VMS" ]; then echo "Found running VMs with suspended/cancelled/delete/fraud tags: $VMS" #exit $CRITICAL exit $WARNING else echo "No running VMs found with suspended/cancelled/delete/fraud tags" exit $OK fi
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings