사전준비
2023.06.21 - [4. 개발 플랫폼 Low Code] - Usage2ADW 무료 툴 - OCI 사용량 확인 with APEX
2023.06.21 - [4. 개발 플랫폼 Low Code] - Usage2ADW 무료 툴 - OCI 사용량 DBCS로 저장
실행(백그라운드)
nohup python3 /home/opc/showoci/showoci.py -ip -d -csv /home/opc/showoci/report/local/csv/local >> /home/opc/showoci/report/local/csv/a.log &
데이터로드 to ADB
ls -ltr /home/opc/showoci/report/local/csv/
/home/opc/usage_reports_to_adw/shell_scripts/run_load_showoci_csv_to_adw.sh
예시
# Run report for all resources except identity from Cloud Shell
python3 showoci.py -dt -ani
# Run Report for all compute resources and produce CSV file using Cloud Shell
python3 showoci.py -dt -c -csv $HOME/output
# Run Report for all compute and database resources and produce CSV file using Cloud Shell
python3 showoci.py -dt -c -d -csv $HOME/output
# Run Report for all compute resources filter by compartment=AdiZohar and region=us-ashburn-1 using instance principle
python3 showoci.py -ip -c -cp AdiZohar -rg us-ashburn-1
# Run Report for PaaS Services filter by region us-phoenix-1 using user authentication profile=Adi and produce CSV
python3 showoci.py -paas -rg us-phoenix-1 -t Adi -csv $HOME/output
# Run Report for PaaS Services and produce JSON file
python3 showoci.py -paas -js
ShowOCI VM 수동 설치
VM 생성
VM OCID 복사
Dynamic Group 생성 (복사한 OCID 입력)
정책생성
필수 요소 설치(Python 3.9, GIT, OCI Package)
sudo yum -y update
sudo yum -y install git
sudo dnf -y module install python39
sudo dnf -y install python39-pip
sudo dnf -y install python39-setuptools
sudo alternatives --set python3 /usr/bin/python3.9
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade oci oci-cli
python3 -m pip install --upgrade oracledb
Instance Principal 테스트
oci os ns get --auth instance_principal
GIT 복제
git clone https://github.com/oracle/oci-python-sdk
ln -s oci-python-sdk/examples/showoci .
실행
cd showoci
python3 showoci.py -ip -ani
mkdir -p /home/opc/showoci/report/local/csv/
nohup python3 /home/opc/showoci/showoci.py -ip -api -c -cn -d -f -l -paas -dataai -csv /home/opc/showoci/report/local/csv/local >> /home/opc/showoci/report/local/csv/a.log &
참고
https://github.com/oracle/oci-python-sdk/tree/master/examples/showoci
'2. 기본 인프라 IaaS' 카테고리의 다른 글
ODI - 웹 에디션 - LB에 SSL 적용 후 도메인 연결 (0) | 2023.10.19 |
---|---|
ODI - Oracle Data Integrator: 웹 에디션 무료 버전 - 설치편 (0) | 2023.10.12 |
OCI콘솔 Login (0) | 2023.04.03 |
Attach Block Volume (0) | 2023.03.06 |
AutoScaling (0) | 2023.03.03 |
댓글