#!/bin/bash
|
|
HDDs=`cat /proc/diskstats | awk '/[sh][d][a-z] / {print$3}'`
|
|
FIRST="1"
|
|
JSON="{ \"data\":["
|
|
for HDD in ${HDDs}; do
|
|
if [ $FIRST == "0" ]; then
|
|
JSON="${JSON},"
|
|
fi
|
|
JSON=${JSON}"{ \"{#HDD}\":\"${HDD}\"}"
|
|
FIRST="0"
|
|
done
|
|
JSON=${JSON}"]}"
|
|
echo ${JSON}
|
Powered by TurnKey Linux.