Storage tips & tricks - graphing an IBM storage system (e.g. DS3400) with MRTG


For this you need to have the IBM StorageManager installed in /opt/IBM_DS.
You also need to have MRTG installed on that system.
Installation-procedure for these two products is beyond the scope of this web-page.

What to do

Entry in cron

Add the following to the crontab of a user:
*/5 * * * *     /opt/IBM_DS/client/SMcli -e -c 'save storageSubsystem performanceStats file="/tmp/storage_system_stats.txt";' > /dev/null
You need to replace the two IP-adresses (here: with the ones of the controllers of your storage system!

Script to fetch data from storagemanager script-output

Create the following file in /usr/local/bin/storage_fields:
#! /bin/sh

export PATH=/usr/bin:$PATH


UPTIME=`head -n 1 $FILE | cut -d ':' -f 2- | sed -e "s/ - Polling interval in seconds:.*//g" | cut -d '-' -f 2-`
HOSTNAME=`head -n 1 $FILE | cut -d ':' -f 2 | awk '{ print $1; }'`

CONTROLLERA=`grep 'CONTROLLER IN SLOT A' $FILE | cut -d "," -f 2-`
CONTROLLERB=`grep 'CONTROLLER IN SLOT B' $FILE | cut -d "," -f 2-`

FIELDA=`echo $CONTROLLERA | cut -d "," -f $1 | sed -e 's/"//g' | cut -d '.' -f 1`
FIELDB=`echo $CONTROLLERB | cut -d "," -f $1 | sed -e 's/"//g' | cut -d '.' -f 1`

echo $FIELDA
echo $FIELDB
echo $UPTIME
Do not forget to invoke:
chmod +x /usr/local/bin/storage_fields

MRTG configuration

Then, add the following to the mrtg.cfg (which is usually located in /etc) file:
Target[ss_total_ios]: `/usr/local/bin/storage_fields 1`
MaxBytes[ss_total_ios]: 1000000
Options[ss_total_ios]: gauge,growright
Title[ss_total_ios]: Total IOs
YLegend[ss_total_ios]: IOs
LegendI[ss_total_ios]:  Controller A
LegendO[ss_total_ios]:  Controller B
PageTop[ss_total_ios]: <H1>Total IOs</H1>
ShortLegend[ss_total_ios]: IOs

Target[ss_total_readperc]: `/usr/local/bin/storage_fields 2`
MaxBytes[ss_total_readperc]: 1000000
Options[ss_total_readperc]: gauge,growright
Title[ss_total_readperc]: Read percentage
YLegend[ss_total_readperc]: percentage
LegendI[ss_total_readperc]:  Controller A
LegendO[ss_total_readperc]:  Controller B
PageTop[ss_total_readperc]: <H1>Read percentage</H1>
ShortLegend[ss_total_readperc]: percentage

Target[ss_total_cachehit]: `/usr/local/bin/storage_fields 3`
MaxBytes[ss_total_cachehit]: 1000000
Options[ss_total_cachehit]: gauge,growright
Title[ss_total_cachehit]: Cache hit percentage
YLegend[ss_total_cachehit]: percentage
LegendI[ss_total_cachehit]:  Controller A
LegendO[ss_total_cachehit]:  Controller B
PageTop[ss_total_cachehit]: <H1>Cache hit percentage</H1>
ShortLegend[ss_total_cachehit]: percentage

Target[ss_total_currentkbsec]: `/usr/local/bin/storage_fields 5`
MaxBytes[ss_total_currentkbsec]: 1000000
Options[ss_total_currentkbsec]: gauge,growright
Title[ss_total_currentkbsec]: Current KB/s
YLegend[ss_total_currentkbsec]: KB/s
LegendI[ss_total_currentkbsec]:  Controller A
LegendO[ss_total_currentkbsec]:  Controller B
PageTop[ss_total_currentkbsec]: <H1>Current KB/s</H1>
ShortLegend[ss_total_currentkbsec]: KB/s

Target[ss_total_currentiosec]: `/usr/local/bin/storage_fields 6`
MaxBytes[ss_total_currentiosec]: 1000000
Options[ss_total_currentiosec]: gauge,growright
Title[ss_total_currentiosec]: Current IO/s
YLegend[ss_total_currentiosec]: IO/s
LegendI[ss_total_currentiosec]:  Controller A
LegendO[ss_total_currentiosec]:  Controller B
PageTop[ss_total_currentiosec]: <H1>Current IO/s</H1>
ShortLegend[ss_total_currentiosec]: IO/s


This is the result of a short run (half an hour) of mrtg against a DS3400:

The Lotter allows you to participate in lotteries from all over the world!