Additional scripts for Zabbix agent on Linux to discover and monitor several services
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
338 B

#!/bin/sh
echo -e "{\n\t\"data\":[\n\n"
for DISK in $(smartctl --scan-open | cut -d' ' -f1); do
smartctl -A $DISK >/dev/null 2>&1
if [ $? -eq 0 ]; then
DISK=$(echo $DISK | sed -e 's|/|\\/|g')
echo -e "\t{\n"
echo -e "\t\t\"{#SMARTDRIVE}\":\"$DISK\""
echo -e "\t}"
fi
done
echo -e "\n\t]\n}\n"