I use the following script
#du /data/ -s #array=($(du /data/ -s)) array=($(du /data/* -s)) #echo ${array[@]} #echo ${array[1]} echo "<prtg>" #looping for ((i=0; i<${#array[*]}; i++)); do echo " <result>" echo " <value>${array[i]}</value>" ((i++)) echo " <channel>${array[i]}</channel>" echo " <Unit>BytesFile</Unit>" echo " <VolumeSize>GigaByte</VolumeSize>" echo " </result>" done echo "</prtg>"
with the result
<prtg> <result> <value>1662621368</value> <channel>/data/backup</channel> <Unit>BytesFile</Unit> <VolumeSize>GigaByte</VolumeSize> </result> <result> <value>137446176</value> <channel>/data/backupsnapshot</channel> <Unit>BytesFile</Unit> <VolumeSize>GigaByte</VolumeSize> </result> ....more results... </prtg>
But the result show like that:
What actually really confused me is that it makes no difference, when I change <VolumeSize>GigaByte</VolumeSize>" to Byte. What did I miss here, if I'd like to have it in TB or GB?
Add comment