Here a usefull script to check backup on all dbs in a db2 instance.
It can be used with monitoring products as zabbix or nagios.
#!/bin/sh INS=$1 NOW=`date -d '1 day ago' '+%Y%m%d'` UNIQUE=`date +%Y%m` DBS=/tmp/dbs.$UNIQUE OUTZ=/tmp/outfordbs.$UNIQUE su - $INS -c "db2 list database directory" | grep alias | awk '{ print $4 }' > $DBS while read LN; do RESULT=$(su - $INS -c " db2 list history backup since $NOW for $LN" | grep 'B D' -m 1 | awk '{print $3}') if [ -z "${RESULT}" ]; then RESULT=" : !!!!!!!!!!!!!! !!!!!!!!!!!!!! ERROR" fi echo $LN $RESULT >> $OUTZ done < $DBS cat $OUTZ rm $DBS rm $OUTZ |