Shell Script to Ping Hostnames and Send SMS if Host is not Available

We use the below procedure to ping hosts and based on availability send SMS to our team. The SMS is send by calling a web service from the BASH Shell script using curl  The hosts are defined in a file called hosts.txt -- Shell Script -- #!/bin/bash current_time=$(date "+%Y%m%d%H%M%S%3N") #### Above Date Format is in … Continue reading Shell Script to Ping Hostnames and Send SMS if Host is not Available

RMAN Script for Tape Backup : Tivoli Storage Manager

[sourcecode language="sql"] run { allocate channel sbt1 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; allocate channel sbt2 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE'; BACKUP DATABASE FORMAT 'MW_FULL_%s_%D_%M_%Y' tag 'MW_DAILY_FULL_DB_BKP'; BACKUP archivelog all not backed up 1 times format 'ARCH_%d_ALL_%s_%t' tag 'MW_ARCH_LOG_BKP'; release channel sbt1; release channel sbt2; } [/sourcecode]

Monitor Tablespace Script Oracle 12c 11g 10g

The Below Script will generate output if percentage of tablespace space left free is less tan 20%. You can easily put in a shell script and schedule it on crontab to send alerts on a daily basis.   select df.tablespace_name tspace, round(sum(fs.bytes)/(df.bytes) * 100) "%_free", round(sum(fs.bytes)/(1024*1024)) free_ts_size, df.bytes/(1024*1024) tot_ts_size from dba_free_space fs, (select tablespace_name, sum(bytes) … Continue reading Monitor Tablespace Script Oracle 12c 11g 10g

Shell Script to Monitor Oracle Tablespace and Send Email Alert Only If Threshold Exceeds

[code language="bash"] export MMSG=/tmp/$$.mail export ADDR="email address here" export ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=appdev1 file=/tmp/${$}_`date +%Y%m%d` sqlplus -s system/password << .eof > $file set pages 0 select df.tablespace_name tspace, round(sum(fs.bytes)/(df.bytes) * 100) "%_free", round(sum(fs.bytes)/(1024*1024)) free_ts_size, df.bytes/(1024*1024) tot_ts_size from dba_free_space fs, (select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name ) df where fs.tablespace_name = df.tablespace_name group by … Continue reading Shell Script to Monitor Oracle Tablespace and Send Email Alert Only If Threshold Exceeds

Shell Script to Monitor AIX Filesystem and Send Email

The Below Shell Script checks the Filesystem mount points and using AWK outputs all filesystem exceeding 90% space to a file called diskspacepoll. Once that is done the sed command removes any special character like '%' from the output file and cleans it to a file called output.log The next important logic is in the … Continue reading Shell Script to Monitor AIX Filesystem and Send Email