User Tools

Site Tools


tsm:tsm_report_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tsm:tsm_report_script [2023/06/20 15:35]
manu [version 06-2023]
tsm:tsm_report_script [2023/06/21 17:42] (current)
manu [version 06-2023]
Line 666: Line 666:
 NAGIOSTAG=0 NAGIOSTAG=0
 TAG=TAG TAG=TAG
-for line in $(cat $TMPFILE.scratch1)+for line in $(cat $TMPFILE.scratch1 ​2>/​dev/​null)
 do do
   if [ $(echo $line | cut -d';'​ -f2) -le "​${alert_libr_maxscr[1]}"​ ]   if [ $(echo $line | cut -d';'​ -f2) -le "​${alert_libr_maxscr[1]}"​ ]
Line 681: Line 681:
   echo "​TD;​$NAGIOSTAG;​$TAG;​$line"​ >> $TMPFILE.scratch   echo "​TD;​$NAGIOSTAG;​$TAG;​$line"​ >> $TMPFILE.scratch
 done done
-rm $TMPFILE.scratch1 > /​dev/​null ​2>&1+rm $TMPFILE.scratch1 ​2>/​dev/​null
  
-for type in $(cat $TMPFILE.paths1 | cut -d';'​ -f1 | sort | uniq)+for type in $(cat $TMPFILE.paths1 ​2>/​dev/​null ​| cut -d';'​ -f1 | sort | uniq)
 do do
   online=$(cat $TMPFILE.paths1 | grep "​^$type"​ | cut -d';'​ -f2 | grep '​YES'​ | wc -l | awk '​{print $1}')   online=$(cat $TMPFILE.paths1 | grep "​^$type"​ | cut -d';'​ -f2 | grep '​YES'​ | wc -l | awk '​{print $1}')
Line 700: Line 700:
   echo "​TD;​$NAGIOSTAG;​$TAG;​$type;​$online;​$offline"​ >> $TMPFILE.paths   echo "​TD;​$NAGIOSTAG;​$TAG;​$type;​$online;​$offline"​ >> $TMPFILE.paths
 done done
-rm $TMPFILE.paths1+rm $TMPFILE.paths1 ​2>/​dev/​null
  
 for line in $(cat $TMPFILE.drives1) for line in $(cat $TMPFILE.drives1)
Line 730: Line 730:
   echo "​TD;​$NAGIOSTAG;​$TAG;​$library;"'​|'";​$type;​$online"'​|/​|'"​$total"​ >> $TMPFILE.drives   echo "​TD;​$NAGIOSTAG;​$TAG;​$library;"'​|'";​$type;​$online"'​|/​|'"​$total"​ >> $TMPFILE.drives
 done done
-rm $TMPFILE.drives1+rm $TMPFILE.drives1 ​2>/​dev/​null
 } }
  
Line 1240: Line 1240:
  
 <​code>​ <​code>​
-#!/bin/bash 
-#set -x 
-#​==================================================================== 
-#@(#) Script to generate a HTML report on TSM activity 
-#       ​format of line before HMTL : 
-#          html_tag;​nagios_tag;​reserved;​output_from_select_TSM 
-#​==================================================================== 
-# version 1.0 
-# version 1.1 report send by mail 
-# version 1.2 suppress unused informations 
-# version 1.3 add statistics on 5 latest daily backups, and dedup stats 
-# version 1.4 add expired nodes and filespaces 
-# version 1.5 check node replication 
-# version 1.6 centralize alert threshold in cfg file (08/2016) 
-# version 1.7 add container space (09/2019) 
- 
-dir=`dirname $0` 
-. $dir/.env 
-. $configfile 
- 
-os=$(uname -s | tr '​A-Z'​ '​a-z'​) 
- 
-if [[ $os == "​aix"​ ]] 
-then 
-  # Needs rpm package coreutil 
-  DATE_BIN=/​opt/​freeware/​bin/​date 
-  if [ ! -x /​opt/​freeware/​bin/​date ] 
-  then 
-    echo "​Install bash and coreutil packages rpm or bff" 
-    exit 1 
-  fi 
-  DSMADMC1="/​usr/​tivoli/​tsm/​client/​ba/​bin64/​dsmadmc -id=${tsm_admin} -pa=${tsm_password}"​ 
-  HOSTNAME=$(/​usr/​bin/​hostname -s) 
-else 
-  if [[ $os == "​linux"​ ]] 
-  then 
-    DATE_BIN=/​bin/​date 
-    DSMADMC1="/​opt/​tivoli/​tsm/​client/​ba/​bin/​dsmadmc -id=${tsm_admin} -pa=${tsm_password}"​ 
-    HOSTNAME=$(/​bin/​hostname -s) 
-  else 
-    echo "​ERROR:​ Unknown OS" 
-    exit 1 
-  fi 
-fi 
-[root@hrstsm01 ~]# cat /​root/​scripts_full/​tsm_daily_report.sh 
 #!/bin/bash #!/bin/bash
 #set -x #set -x
Line 1377: Line 1332:
     NAGIOSTAG=0     NAGIOSTAG=0
   fi   fi
 +fi
 +
 +# Check latest backup DB date
 +if [ $($DSMADMC $OPT_COMMA $OPT_DATAONLY "​select * from db where LAST_BACKUP_DATE>​=current_timestamp-24 hours" | tr ','​ '​\n'​ | wc -l) -lt "​10"​ ]
 +then
 +  NAGIOSTAG=2
 fi fi
 echo "​TD;​$NAGIOSTAG;​$TAG;​$db_name;​$filesys_sz_gb;​${pct_used} %" >> $TMPFILE.db_log echo "​TD;​$NAGIOSTAG;​$TAG;​$db_name;​$filesys_sz_gb;​${pct_used} %" >> $TMPFILE.db_log
Line 1412: Line 1373:
 { {
 echo "# Check last DB backup date" echo "# Check last DB backup date"
-$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select LAST_BACKUP_DATE,​LAST_REORG,​TRANSLATE('​a bc:​de:​fg',​ DIGITS(current_timestamp-LAST_BACKUP_DATE),​ '​_______abcdefgh_____',​ ' ') as ELAPTIME from db" | sed '​s/​\./,/​g'​ | cut -d','​ -f1,3,5 | sed '​s/,/;/​g'​ | sed 's/\ /|/g' > $TMPFILE.last_backup_db_tsm1+$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select LAST_BACKUP_DATE,​LAST_REORG,​TRANSLATE('​a bc:​de:​fg',​ DIGITS(current_timestamp-LAST_BACKUP_DATE),​ '​_______abcdefgh_____','​ ') as ELAPTIME from db" | sed '​s/​\./,/​g'​ | cut -d','​ -f1,3,5 | sed '​s/,/;/​g'​ | sed 's/\ /|/g' > $TMPFILE.last_backup_db_tsm1
  
 if [ $(tail -1 $TMPFILE.last_backup_db_tsm1 | egrep -q '​^[0-9][0-9]';​echo $?) -ne 0 ] if [ $(tail -1 $TMPFILE.last_backup_db_tsm1 | egrep -q '​^[0-9][0-9]';​echo $?) -ne 0 ]
Line 1430: Line 1391:
 rm $TMPFILE.last_backup_db_tsm1 rm $TMPFILE.last_backup_db_tsm1
 } }
- 
  
 #​---------------------------- #​----------------------------
Line 1553: Line 1513:
 for act in $(head -1 $TMPFILE.total | cut -d';'​ -f4- | sed 's/;/\ /g') for act in $(head -1 $TMPFILE.total | cut -d';'​ -f4- | sed 's/;/\ /g')
 do do
-  value=$(grep "​^$act;"​ $TMPFILE.activitytotal | cut -d';'​ -f2)+  ​value=$(cat $TMPFILE.activitytotal | sed '​s/​NAS|//'​ | grep -i "​^$act;"​ | cut -d';'​ -f2 | paste -s -d+ - | bc) 
 +  #value=$(grep "​^$act;"​ $TMPFILE.activitytotal | cut -d';'​ -f2)
   value1="​$value1;​$value"​   value1="​$value1;​$value"​
 done done
Line 1815: Line 1776:
 rm $TMPFILE.scratch1 2>/​dev/​null rm $TMPFILE.scratch1 2>/​dev/​null
  
-for type in $(cat $TMPFILE.paths1 | cut -d';'​ -f1 | sort | uniq)+for type in $(cat $TMPFILE.paths1 ​2>/​dev/​null ​| cut -d';'​ -f1 | sort | uniq)
 do do
   online=$(cat $TMPFILE.paths1 | grep "​^$type"​ | cut -d';'​ -f2 | grep '​YES'​ | wc -l | awk '​{print $1}')   online=$(cat $TMPFILE.paths1 | grep "​^$type"​ | cut -d';'​ -f2 | grep '​YES'​ | wc -l | awk '​{print $1}')
Line 1832: Line 1793:
   echo "​TD;​$NAGIOSTAG;​$TAG;​$type;​$online;​$offline"​ >> $TMPFILE.paths   echo "​TD;​$NAGIOSTAG;​$TAG;​$type;​$online;​$offline"​ >> $TMPFILE.paths
 done done
-rm $TMPFILE.paths1+rm $TMPFILE.paths1 ​2>/​dev/​null
  
-for line in $(cat $TMPFILE.drives1)+for line in $(cat $TMPFILE.drives1 ​2>/​dev/​null)
 do do
   end=$(echo $line | cut -d';'​ -f4)   end=$(echo $line | cut -d';'​ -f4)
Line 1843: Line 1804:
   fi   fi
 done done
-for library in $(cat $TMPFILE.drives1 | cut -d';'​ -f1 | sort | uniq)+for library in $(cat $TMPFILE.drives1 ​2>/​dev/​null ​| cut -d';'​ -f1 | sort | uniq)
 do do
   online=$(cat $TMPFILE.drives1 | grep "​^$library"​ | cut -d';'​ -f4 | grep '​YES'​ | wc -l | awk '​{print $1}')   online=$(cat $TMPFILE.drives1 | grep "​^$library"​ | cut -d';'​ -f4 | grep '​YES'​ | wc -l | awk '​{print $1}')
Line 1871: Line 1832:
 echo "​TH;​4;​TAG;​VOLUME_NAME;​STGPOOL_NAME;​ACCESS;​WRITE_ERRORS;​READ_ERRORS"​ > $TMPFILE.volume_error echo "​TH;​4;​TAG;​VOLUME_NAME;​STGPOOL_NAME;​ACCESS;​WRITE_ERRORS;​READ_ERRORS"​ > $TMPFILE.volume_error
 $DSMADMC $OPT_COMMA $OPT_DATAONLY "​select VOLUME_NAME,​STGPOOL_NAME,​ACCESS,​WRITE_ERRORS,​READ_ERRORS from volumes where ACCESS<>'​READWRITE'​ and ACCESS<>'​OFFSITE'"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -iv "​found|return"​ | grep -v '​^/'​ | sed "​s/​^/​TD;​2;​$TAG;/"​ >> $TMPFILE.volume_error $DSMADMC $OPT_COMMA $OPT_DATAONLY "​select VOLUME_NAME,​STGPOOL_NAME,​ACCESS,​WRITE_ERRORS,​READ_ERRORS from volumes where ACCESS<>'​READWRITE'​ and ACCESS<>'​OFFSITE'"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -iv "​found|return"​ | grep -v '​^/'​ | sed "​s/​^/​TD;​2;​$TAG;/"​ >> $TMPFILE.volume_error
-$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select VOLUME_NAME,​STGPOOL_NAME,​ACCESS,​WRITE_ERRORS,​READ_ERRORS from volumes where WRITE_ERRORS<>'​0'​ or READ_ERRORS<>'​0'"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -iv "​found|return"​ | sed "​s/​^/​TD;​1;​$TAG;/"​ >> $TMPFILE.volume_error +$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select VOLUME_NAME,​STGPOOL_NAME,​ACCESS,​WRITE_ERRORS,​READ_ERRORS from volumes where WRITE_ERRORS<>'​0'​ or READ_ERRORS<>'​0'"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -iv "​found|return" ​| grep -v '​^/' ​| sed "​s/​^/​TD;​1;​$TAG;/"​ >> $TMPFILE.volume_error 
-$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select CONTAINER_NAME,​STGPOOL_NAME,​STATE from containers where STATE<>'​AVAILABLE'"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -iv "​found|return"​ | sed "​s/​^/​TD;​1;​$TAG;/"​ | sed "​s/​$/;​0;​0/"​ >> $TMPFILE.volume_error+$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select CONTAINER_NAME,​STGPOOL_NAME,​STATE from containers where STATE<>'​AVAILABLE' and TYPE<>'​CLOUD'"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -iv "​found|return"​ | sed "​s/​^/​TD;​1;​$TAG;/"​ | sed "​s/​$/;​0;​0/"​ >> $TMPFILE.volume_error
 } }
  
Line 1891: Line 1852:
 NAGIOSTAG=0 NAGIOSTAG=0
 TAG=TAG TAG=TAG
 +
 HEADER="​TH;​4;​TAG;​DOMAIN_NAME;​NODE_NAME"​ HEADER="​TH;​4;​TAG;​DOMAIN_NAME;​NODE_NAME"​
  
Line 1992: Line 1954:
  
 #​---------------------------- #​----------------------------
-check_expired_data ​()+check_expired_filespaces ​()
 { {
 echo "# Collect expired filespaces"​ echo "# Collect expired filespaces"​
-$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select NODE_NAME,​FILESPACE_NAME,​FILESPACE_ID,​FILESPACE_TYPE,​CAPACITY,​PCT_UTIL,​to_char(char(BACKUP_END),'​YYYY-MM-DD'​) as LAST_ACCESS from filespaces where node_name<>''​ order by node_name"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | sed -e '​s/"//​g'​ -e "​s/'//​g"​ | sed -e '​s/​\\a/​\\A/​g'​ -e '​s/​\\b/​\\B/​g'​ -e '​s/​\\c/​\\C/​g'​ -e '​s/​\\f/​\\F/​g'​ -e '​s/​\\n/​\\N/​g'​ -e '​s/​\\r/​\\R/​g'​ -e '​s/​\\t/​\\T/​g'​ -e '​s/​\\v/​\\V/​g'​ | sed -e '​s/​^/"/'​ -e "​s/​^/'/"​ | sed -e '​s/​$/"/'​ -e "​s/​$/'/"​ | egrep -v "​ANR2034E|ANS8001I"​ > $TMPFILE.filespaces_last_access.tmp+if [ ${filespace_stat} == "​no"​ ] 
 +then 
 +  ​$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select NODE_NAME,​FILESPACE_NAME,​FILESPACE_ID,​FILESPACE_TYPE,​CAPACITY,​PCT_UTIL,​to_char(char(BACKUP_END),'​YYYY-MM-DD'​) as LAST_ACCESS from filespaces where node_name<>''​ order by node_name"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | sed -e '​s/"//​g'​ -e "​s/'//​g"​ | sed -e '​s/​\\a/​\\A/​g'​ -e '​s/​\\b/​\\B/​g'​ -e '​s/​\\c/​\\C/​g'​ -e '​s/​\\f/​\\F/​g'​ -e '​s/​\\n/​\\N/​g'​ -e '​s/​\\r/​\\R/​g'​ -e '​s/​\\t/​\\T/​g'​ -e '​s/​\\v/​\\V/​g'​ | sed -e '​s/​^/"/'​ -e "​s/​^/'/"​ | sed -e '​s/​$/"/'​ -e "​s/​$/'/"​ | egrep -v "​ANR2034E|ANS8001I"​ > $TMPFILE.filespaces_last_access.tmp
  
-$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select NODE_NAME,​FILESPACE_ID,​sum(REPORTING_MB) as MB,​sum(NUM_FILES) as nb_files from occupancy group by NODE_NAME,​FILESPACE_ID order by NODE_NAME"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -v "​ANR2034E|ANS8001I"​ > $TMPFILE.occupancy_per_filespace.tmp+  ​$DSMADMC $OPT_COMMA $OPT_DATAONLY "​select NODE_NAME,​FILESPACE_ID,​sum(REPORTING_MB) as MB,​sum(NUM_FILES) as nb_files from occupancy group by NODE_NAME,​FILESPACE_ID order by NODE_NAME"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -v "​ANR2034E|ANS8001I"​ > $TMPFILE.occupancy_per_filespace.tmp
  
-echo "​TH;​4;​TAG;​NODE_NAME;​FILESPACE_NAME;​FILESPACE_ID;​FILESPACE_TYPE;​CAPACITY;​PCT_UTIL;​LAST_ACCESS;​REPORTING_SIZE_MB;​NB_FILES"​ > $TMPFILE.filespaces_last_access+  ​echo "​TH;​4;​TAG;​NODE_NAME;​FILESPACE_NAME;​FILESPACE_ID;​FILESPACE_TYPE;​CAPACITY;​PCT_UTIL;​LAST_ACCESS;​REPORTING_SIZE_MB;​NB_FILES"​ > $TMPFILE.filespaces_last_access
  
-for line in $(cat $TMPFILE.filespaces_last_access.tmp) +  ​for line in $(cat $TMPFILE.filespaces_last_access.tmp) 
-do +  do 
-  end=$(echo $line | cut -d';'​ -f7 | sed -e '​s/"//​g'​ -e "​s/'//​g"​) +    end=$(echo $line | cut -d';'​ -f7 | sed -e '​s/"//​g'​ -e "​s/'//​g"​) 
-  node=$(echo $line | cut -d';'​ -f1 | sed -e '​s/"//​g'​ -e "​s/'//​g"​) +    node=$(echo $line | cut -d';'​ -f1 | sed -e '​s/"//​g'​ -e "​s/'//​g"​) 
-  fsid=$(echo $line | cut -d';'​ -f3) +    fsid=$(echo $line | cut -d';'​ -f3) 
-  grep "​^$node;​$fsid;"​ $TMPFILE.occupancy_per_filespace.tmp > /dev/null 2>&1 +    grep "​^$node;​$fsid;"​ $TMPFILE.occupancy_per_filespace.tmp > /dev/null 2>&​1 
-  if [ $? -eq 0 ] +    if [ $? -eq 0 ]
-  then +
-    ​occ=$(grep "​^$node;​$fsid;"​ $TMPFILE.occupancy_per_filespace.tmp | cut -d';'​ -f3,4) +
-  else +
-    occ="​EMPTY;"​ +
-  fi +
-  node_exception=$(echo ${node_expired} | sed -e '​s/​^/;/'​ -e '​s/,/;​\|;/​g'​ -e '​s/​$/;/'​) +
-  ​if [ $(echo ";​$node;"​ | egrep "​${node_exception}"​ > /​dev/​null;​echo ​$?-eq 0 +
-  then +
-    NAGIOSTAG=4 +
-  else +
-    if [[ "​$end"​ < "​$EXPIRED"​ ]]+
     then     then
-      ​NAGIOSTAG=1+      ​occ=$(grep "​^$node;​$fsid;"​ $TMPFILE.occupancy_per_filespace.tmp | cut -d';'​ -f3,4)
     else     else
-      ​NAGIOSTAG=0+      ​occ="​EMPTY;"​
     fi     fi
-  ​fi +    node_exception=$(echo ${node_expired} | sed -e '​s/​^/;/'​ -e '​s/,/;​\|;/​g'​ -e '​s/​$/;/'​) 
-  echo "​TD;​$NAGIOSTAG;​$TAG;​$line;​$occ"​ | sed -e '​s/"//​g'​ -e "​s/'//​g"​ >> $TMPFILE.filespaces_last_access +    if [ $(echo ";​$node;"​ | egrep "​${node_exception}"​ > /​dev/​null;​echo $?) -eq 0 ] 
-done+    then 
 +      NAGIOSTAG=4 
 +    else 
 +      if [[ "​$end"​ < "​$EXPIRED"​ ]] 
 +      then 
 +        NAGIOSTAG=1 
 +      else 
 +        NAGIOSTAG=0 
 +      ​fi 
 +    fi 
 +    ​echo "​TD;​$NAGIOSTAG;​$TAG;​$line;​$occ"​ | sed -e '​s/"//​g'​ -e "​s/'//​g"​ >> $TMPFILE.filespaces_last_access 
 +  done
  
-rm $TMPFILE.filespaces_last_access.tmp $TMPFILE.occupancy_per_filespace.tmp +  ​rm $TMPFILE.filespaces_last_access.tmp $TMPFILE.occupancy_per_filespace.tmp
-if [ ${filespace_stat} == "​no"​ ] +
-then +
-  rm $TMPFILE.filespaces_last_access > /dev/null 2>&1+
 fi fi
 +}
  
 +#​----------------------------
 +check_expired_nodes ()
 +{
 echo "# Collect expired nodes" echo "# Collect expired nodes"
 $DSMADMC $OPT_COMMA $OPT_DATAONLY "​SELECT node_name,​domain_name,​platform_name,​client_os_level,​TRIM(CHAR(client_version))||'​.'​||TRIM(CHAR(client_release))||'​.'​||TRIM(CHAR(client_level))||'​-'​||TRIM(CHAR(client_sublevel)) as TSM_Version,​DATE(lastacc_time) AS LASTACC_TIME,​TCP_NAME,​TCP_ADDRESS FROM nodes order by node_name"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -v "​ANR2034E|ANS8001I"​ > $TMPFILE.nodes_last_access.tmp $DSMADMC $OPT_COMMA $OPT_DATAONLY "​SELECT node_name,​domain_name,​platform_name,​client_os_level,​TRIM(CHAR(client_version))||'​.'​||TRIM(CHAR(client_release))||'​.'​||TRIM(CHAR(client_level))||'​-'​||TRIM(CHAR(client_sublevel)) as TSM_Version,​DATE(lastacc_time) AS LASTACC_TIME,​TCP_NAME,​TCP_ADDRESS FROM nodes order by node_name"​ | sed '​s/,/;/​g'​ | sed 's/\ /|/g' | egrep -v "​ANR2034E|ANS8001I"​ > $TMPFILE.nodes_last_access.tmp
Line 2120: Line 2085:
 <meta http-equiv="​Content-Type"​ content="​text/​html;​ charset=utf-8">​ <meta http-equiv="​Content-Type"​ content="​text/​html;​ charset=utf-8">​
 </​head>​ </​head>​
-<h1>TSM Backup ​Report'​ $server $(date "​+%d-%m-%Y %H:​%M"​) version: $tsmversion '</​h1>​+<h1>Spectrum Protect ​Report'​ $server $(date "​+%d-%m-%Y %H:​%M"​) version: $tsmversion '</​h1>​
 <​body>​ <​body>​
 <br> <br>
Line 2130: Line 2095:
 for i in db_log last_backup_db_tsm admin volume_error scratch dirspace stgpool_stats paths drives client failed_vm backup_vm replication error total sum_admin stgpool_occ auditocc daily_backup-arch_per_node filespaces_last_access nodes_last_access for i in db_log last_backup_db_tsm admin volume_error scratch dirspace stgpool_stats paths drives client failed_vm backup_vm replication error total sum_admin stgpool_occ auditocc daily_backup-arch_per_node filespaces_last_access nodes_last_access
 do do
-  nb_line=$(cat $TMPFILE.$i* | wc -l)+  nb_line=$(cat $TMPFILE.$i* ​2>/​dev/​null ​| wc -l)
   if [ "​$nb_line"​ -gt "​1"​ ]   if [ "​$nb_line"​ -gt "​1"​ ]
   then   then
Line 2186: Line 2151:
   then   then
     echo | mailx -a "​$htmlfile"​ -r "​$tsmemailsender"​ -s "​$subject"​ $tsmemailreceiver     echo | mailx -a "​$htmlfile"​ -r "​$tsmemailsender"​ -s "​$subject"​ $tsmemailreceiver
-    echo | mailx -a /​root/​scripts/​reports/​q_act.$TODAY.gz -r "​$tsmemailsender"​ -s "​$subject logs" ​emmanuel.iffly@ctg.lu+    echo | mailx -a /​root/​scripts/​reports/​q_act.$TODAY.gz -r "​$tsmemailsender"​ -s "​$subject logs" ​myemail@pt.lu
   fi   fi
 fi fi
Line 2206: Line 2171:
   rm  $TMPFILE* 2> /dev/null   rm  $TMPFILE* 2> /dev/null
   htmlfile=$logpath/​tsm_daily_report_${TODAY}_${server}.html   htmlfile=$logpath/​tsm_daily_report_${TODAY}_${server}.html
-  if [ $($DSMADMC "q db" ​| grep -q ANS1017E; echo $?) -eq 0 ]+  if [ $(timeout 5 $DSMADMC "q db" ​> /dev/null 2>&1; echo $?) -ne 0 ]
   then   then
     subject=$(echo "TSM daily report $TODAY from location $server DOWN !!!")     subject=$(echo "TSM daily report $TODAY from location $server DOWN !!!")
Line 2226: Line 2191:
     check_library     check_library
     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)
-#    ​check_volume_error+    ​check_volume_error
     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)
     auditocc     auditocc
Line 2236: Line 2201:
     daily_backuparch_per_node     daily_backuparch_per_node
     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)
-    ​check_expired_data+    ​check_expired_nodes 
 +    d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s) 
 +    check_expired_filespaces
     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)     d2=$(date +%s); echo "$(( (d2 - d1) )) seconds";​d1=$(date +%s)
     repl_status     repl_status
Line 2245: Line 2212:
   send_email $server   send_email $server
   #​copy_to_apache   #​copy_to_apache
-  rm $TMPFILE*+  rm $TMPFILE* ​2>/​dev/​null
 done done
  
Line 2253: Line 2220:
 } }
  
 +mv -f $logname ${logname}.1
 main > $logname 2>&1 main > $logname 2>&1
 </​code>​ </​code>​
 +
 +
 +|                        ​STGPOOL_NAME | CONTAINER1 | S3 | DISK01 |
 +|                            ​POOLTYPE | PRIMARY | PRIMARY | PRIMARY |
 +|                            ​DEVCLASS | | | DISK |
 +|                            ​STG_TYPE | DIRECTORY | CLOUD | DEVCLASS |
 +|                     EST_CAPACITY_MB | 25126572.0 | | 12288000.0 |
 +|                        ​PCT_UTILIZED | 40.6 | | 52.3 |
 +|                         PCT_LOGICAL | | | 100.0 |
 +|                          ​MAXSCRATCH | | | |
 +|                      ​NUMSCRATCHUSED | | | |
 +|                          ​COMPRESSED | YES | YES | |
 +|                         DEDUPLICATE | YES | YES | NO |
 +|             TOTAL_UNUSED_PENDING_MB | 482 G | 7,078 M | |
 +|                ​DEDUP_SPACE_SAVED_MB | 7254348 | 14192097 | |
 +|                 COMP_SPACE_SAVED_MB | 21609587 | 1689699 | |
 +|                      ​SPACE_SAVED_MB | 28863934 | 15881795 | |
 +|                           ENCRYPTED | Yes | Yes | |
 +|                       PCT_ENCRYPTED | 100.00 | 100.00 | |
 +|                ​TOTAL_CLOUD_SPACE_MB | | 11025099 | |
 +|                 USED_CLOUD_SPACE_MB | | 10391137 | |
 +|               LOCAL_EST_CAPACITY_MB | | 0.0| |
 +|                  ​LOCAL_PCT_UTILIZED | | 0.0| |
  
tsm/tsm_report_script.1687268156.txt.gz · Last modified: 2023/06/20 15:35 by manu