본문 바로가기
Oracle/Exadata

[Sundiag] 한 노드에서 한번에 EXADATA H/W 수집하는 쉘

by 취미툰 2023. 2. 8.
반응형

Exadata SR진행 시 sundiag.sh이라는 HW 정보를 수집하는 쉘이있습니다.

각 노드별로 접속해서 수집을 해야하는 쉘인데 

한 노드에서 각 노드에 접속해서 로그를 모아주는 쉘입니다.

출처의 블로그에서 정보를 찾았으며, 약간의 수정 후에 사용했습니다.

잘되네요

 

 

root에서 수행합니다.

1번노드에서 수행하였습니다.

 

 

쉘 내용

(변경할 내용1) all_group 인지 (db 노드 & cell 노드 ) cell_group (cell 노드) 인지 확인후 이름 변경

(변경할 내용2 ) all_group 인지 (db 노드 & cell 노드 ) cell_group (cell 노드) 인지 확인후 이름 변경

#!/bin/bash
#   Description: Simple script to get all sundiag outputs from all nodes and tar them ready for support under /tmp/
#                If you want to get the ILOM snapshot use parameter snapshot as first argument
#   Written by:  Simo Vilmunen 06-JAN-2017
#
#   How to use:  run as get_sundiag_from_all_nodes.sh           --to get normal sundiag from all nodes
#
#   Output: Will be written to /tmp/sundiag_output_<current_date> and tarball created under /tmp/
#
#   Version: 1.0 10/01/2017

export script_dir=/tmp/sundiag_output_$(date +%Y%m%d)
export script_log=/tmp/sundiag_output_$(date +%Y%m%d)/diagnostics_output_$(date +%Y%m%d).log

echo `date`": Starting to run sundiag scripts from all nodes" | tee -a "$script_log"

if [ -d "$script_dir" ]
then
echo `date`": /tmp/sundiag_output_$(date +%Y%m%d) exists" | tee -a "$script_log"
rm -rf /tmp/sundiag_output_$(date +%Y%m%d)/*
else
mkdir "/tmp/sundiag_output_$(date +%Y%m%d)"
echo `date`": Directory /tmp/sundiag_output_$(date +%Y%m%d_%H%M%S) created"  | tee -a "$script_log"
fi

touch "${script_log}"

#  Backup old sundiag files and remove them after zipped
echo `date`": Compressing old sundiag files and removing them" | tee -a "$script_log"
dcli -g /root/cell_group -l root "zip -u /var/log/exadatatmp/previous_sundiag_outputs.zip /var/log/exadatatmp/sundiag*.tar.bz2" | tee -a "$script_log"
dcli -g /root/cell_group -l root 'rm /var/log/exadatatmp/sundiag*.tar.bz2' | tee -a "$script_log"


#  Normal sundiag.sh execution

echo `date`": Running dcli sundiag.sh on all nodes" | tee -a "$script_log"
dcli -g /root/cell_group -l root '/opt/oracle.SupportTools/sundiag.sh osw 2023/02/03_16:00:00-2023/02/03_19:00:00 2>/dev/null'   | tee -a "$script_log" >/dev/null

for H in `cat /root/cell_group`; do  scp -p $H:/var/log/exadatatmp/sundiag*.tar.bz2 /tmp/sundiag_output_$(date +%Y%m%d) ; done  | tee -a "$script_log"

export file_name=exa_rack_sundiag_$(date +%Y%m%d_%H%M%S).tar.bz2

cd /tmp;tar -jcvf /tmp/${file_name} sundiag_output_$(date +%Y%m%d)/sundiag*.tar.bz2  | tee -a "$script_log"

echo `date`": Combined tar file of /tmp/sundiag_output_$(date +%Y%m%d) created as /tmp/${file_name}"  | tee -a "$script_log"

echo `date`":  You can review the logfile ${script_log} for errors. All done now. Have a great day."  | tee -a "$script_log"

 

출처 : https://www.thatfinnishguy.blog/2017/01/10/automated-sundiag-sh-for-exadata-nodes/

 

Automated sundiag.sh for Exadata nodes | That Finnish Guy

We recently had to collect sundiag.sh output to one of our Service Requests and I followed note “Oracle Exadata Diagnostic Information required for Disk Failures and some other Hardware issues (Doc ID 761868.1)“. And while there isn’t too much of wo

www.thatfinnishguy.blog

 

반응형

댓글