Bash Shell Script

Check Size of a File in BASH Script – alert.log oracle help

Size of a File in a directory location can be checked using a small shell script. #!/bin/bash str_LogName = “/u01/SAQIB/MyFile” int_fileSIZE=$(du -b $str_LogName | awk ‘{ print $1 }’) echo $str_LogName However, if we want to see if the size is greater than a particular amount say 3MB, we will use the following script. #!/bin/bash… Continue reading Check Size of a File in BASH Script – alert.log oracle help

Bash Shell Script

Ping a Server for Status in BASH Script [Linux]

#!/bin/bash ################################################################ # AUTHOR: Saqib Mujtaba # SCRIPT: Ping servers status in a network # DATED : 07/02/2014 # TYPE : BASH Shell Script ################################################################ array_serverIP=”192.168.01.1 10.0.0.01″ #PINGS FOR COMPUTER STATUS for ip in $array_serverIP ; do ( ping $ip -c2 &> /dev/null ; if [ $? -eq 0 ]; then echo “$ip is Up”… Continue reading Ping a Server for Status in BASH Script [Linux]

Bash Shell Script

Bash Script to Ping Servers and Checks Services Status

#!/bin/bash ######################################################################## #Script to ping servers and Checks Services [oracle,pmon,smon,tns] for Status # ####################################################################### #List of IP addresses array_serverIP=”10.0.0.1 192.168.0.1″ array_SERVICES=”oracle pmon smon tns” for ip in $array_serverIP ; do ( ping $ip -c2 &> /dev/null ; if [ $? -eq 0 ]; then echo “$ip is Up” else echo “$ip is Down” fi )&… Continue reading Bash Script to Ping Servers and Checks Services Status