R1 audit – which Disk Safe where?

Much irritation with the R1soft interface... no strike.. irritation with R1soft. I need to audit what disk safe is where to better distribute IO load and use of storage - and possibly re build of head unit (thus import ALL of the disk safes). Using the UI is a vast VAST pain. So here is a script to audit what disk safe is where using their /metadata2/DiskSafeMetaData file buried within each Disk Safe.

The following uses JQ and gets me out of a tight spot really rather quickly and thoroughly. If it is useful to you too - happy days... as the GUI sucks ass for this kind of thing*.

Oh - you need JQ installed (apt-get install jq) to make short work of the nasty escaped JSON files... as awk/sed/grep quickly become and escaping hell otherwise. This assumes that you have your volumes mounted off of the /media directory too - and will happily make its way through them one by one.

#!/bin/bash

for burt in `ls /media`
do
cd /media/$burt
echo
echo " ########## $burt ########## "
echo
df -h | grep $burt$ | awk '{ print "Mount "$1 "  //  Capacity "$2 "  //  Used " $3 }'
echo
echo
for foo in `ls `;
do
cat  $foo/metadata2/DiskSafeMetaData | jq -r '.[0]' | jq -r .uuid
cat  $foo/metadata2/DiskSafeMetaData | jq -r '.[0]' | jq -r .lastKnownDiskSafeName
cat  $foo/metadata2/DiskSafeMetaData | jq -r '.[0]' | jq -r .lastAssociatedAgentDescription
cat  $foo/metadata2/DiskSafeMetaData | jq -r '.[0]' | jq -r .lastAssociatedAgentHostName
du -sh $foo | awk '{ print $1 }'
echo
echo
done
echo
done

* Footnote: On why this platform vexes me so much right now... for some of the following reasons dwelling on 'just' the server side of things:
  - If you don't have a wide screen monitor there is no scroll bar, you need to tab to save / cancel;
  - 9 Failed jobs eh? Click on that - see three successful ones;
  - Deleted Protected Servers and tick the "and all the rest option" - doesn't - Policies live on as Null jobs;
  - Menu options just stopping working after a while, restart only option to resolve;
  - You have to use the /TaskHistory URL which has no link to it to see what is actually running;
  - Support either blame too much or too little Java heap size as the issue for crashing;
  - It *still* does not seem to scale;
  - Java Keystore.... WHY WHY DOES IT HAVE TO HURT SO MUCH.

Leave a Reply

Your email address will not be published. Required fields are marked *