Product specifications

5 – Detailed Descriptions of Command LineTools
D000006-000 Rev A 5-43
Q
5.4.3.4.1
Using iba_report to monitor for fabric changes
iba_report can easily be used in other scripts. For example the following simple
script could be run as a cron job to identify if the fabric has changed as compared
to the initial design:
#!/bin/bash
# specify some filenames to use
expected_config=/usr/local/report.master # master copy of
config previously created
config=/tmp/report$$ # where we will generate new report
diffs=/tmp/report.diff$$ # where we will generate diffs
iba_report -o all -d 5 -P > $config 2>/dev/null
if ! diff $config $expected_config > $diffs 2>/dev/null
then
# notify admin, for example mail the new report to the admin
cat $diffs $expected_config $config |
mail -s "fabric change detected" admin@somewhere
fi
rm -f $config $diffs