qm guest cmd ${VMID} ping
will tell you if the
Guest Agent is responding inside VM ${VMID}. Now you just have to run this command with the VMID for each of your VM's. You can get the VMID's using
qm list
and loop over it using some bash shell scripting. Maybe there is an easier way using
pvesh?