Script to check OBI 10g & 11g services


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to check OBI 10g & 11g services
# 1  
Old 07-09-2012
Script to check OBI 10g & 11g services

Hello Unix experts,

I am very new to shell scripting.However,I have been asigned a task in Unix-that I need to prepare a script which will check if OBI 10g and OBI 11g services are running or not and to send email if the services are down.In addition to it,I also need to check whether Weblogic 11g is running in it as well.We have four production servers in which these services run.How do I capture these services and how do I run the script from all these four boxes?Any help will be appreciated.


Cheers
DG
# 2  
Old 07-09-2012
You can use
Code:
 ps -ef | grep "string of your interest"

# 3  
Old 07-09-2012
Hello,

I was actually thinking of a script that will send email when the services are found to be stopped or halted.
# 4  
Old 07-09-2012
Can you explain your interests and till where have you reached in achieving them?
# 5  
Old 07-12-2012
This is the script I had written

Code:
echo "Check OBI service.." >> $LOGFILE
        ps -ef | grep sawserver  >> $LOGFILE
        obisrvc_count=`ps -ef | grep sawserver | grep -v grep | wc -l`
        if [ $obisrvc_count -gt 0 ]
        then
                echo "OBI Service Running.." >> $LOGFILE
                flag=0
        else
                echo "OBI Service NOT Running.. Please check.." >> $LOGFILE
                flag=2
        fi
}

However,our boxes host both 10g and 11g OBI services..How do i capture both with this script?Please help?
Also,how do I send automated mail when the service fails.?
# 6  
Old 07-12-2012
You can use egrep for checking both the 10g and 11g services!!

Regarding mails, You can always use mailx.

A small correction to ur code, (not a big deal though Smilie )
Code:
 ps -ef | grep sawserver  >> $LOGFILE
obisrvc_count=`ps -ef | grep sawserver | grep -v grep | wc -l`

You could change this to,
Code:
 ps -ef | grep sawserver | grep -v grep >> $LOGFILE
obisrvc_count=`grep -c sawserver $LOGFILE`

Best wishes
This User Gave Thanks to PikK45 For This Post:
# 7  
Old 07-13-2012
Thanks brother...

Just a question,how do i exactly use egrep to distinguish between 10g and 11g services,coould you elaborate more please?
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. IP Networking

What's the difference between Cisco SFP-10G-SR and XFP-10G-MM-SR ?

We're connecting a ASA 10G port with Cisco SFP-10G-SR transceiver to SCE 10G port with XFP-10G-MM-SR, can they connect each other? We also want to know what's the difference between them? (1 Reply)
Discussion started by: Ayaerlee
1 Replies

2. Shell Programming and Scripting

Script to Start services based on dependent services on other AIX machine

Hi, I just started working on a script. After my research, i found a command which can help me: AIM: To build a script which starts the services (Services 1) on server 1 automatically whenever its down. And it has a dependency on other service (Service 2) on Server 2. So my script has to... (4 Replies)
Discussion started by: draghun9
4 Replies

3. Solaris

need help in oracle upgrade from 10g to 11g

Hi , situation has come where in i want to upgrade my database from 10g to 11g ,my code heavily depends on Pro*C , i just want to know if i upgrade my DB from 10g to 11g , will there be any changes in my pro*c compiler ..? if so then wat are the prerequisites i need to check ..? thanks ... (2 Replies)
Discussion started by: senkerth
2 Replies

4. Shell Programming and Scripting

Script to Check & Edit Content of a file (Addition of comma in each lines of code)

Hi all, I need to write an automated bash shell script which performs such operations: 1. Grep the header of everyline with the initial of "T" in "FILE_A" 2. Perform a for loop, Count the numbers of comma in the line of code, if (no. of comma < 17) ADD the comma until 17; ... (2 Replies)
Discussion started by: big_nutz
2 Replies

5. AIX

how to check status of various services and port?

How can i check which service is activated on my AIX Box? how one can check particular port is open or not (like ftp/telnet port)? I dont have admin rights (1 Reply)
Discussion started by: ashish4422
1 Replies

6. UNIX for Dummies Questions & Answers

Looking for administration tool to check if services are running

Hi! We are having problems with our unix servers (SunOS 5.9) that services for some of our applications are continuously going down. (this is more due to the applications installed than the UNIX OS). What I am looking for is some kind of administrative tool where I can set what service to scan... (1 Reply)
Discussion started by: erinor
1 Replies
Login or Register to Ask a Question