#!/bin/bash


status=$(sudo pvesm status)

offline=""
for i in HDD NFS NVME SSD local; do
   
    if grep $i &>/dev/null <<< "$status"; then
        continue
    else
        offline="$i $offline"
    fi
done

if [[ -n "$offline" ]]; then
    echo "CRITICAL - Storage offline: $offline"
    exit 2
else
    echo "OK"
    exit 0
fi
