LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Script to check tomcat and Pgsql running or not (https://www.linuxquestions.org/questions/linux-newbie-8/script-to-check-tomcat-and-pgsql-running-or-not-887903/)

praveenhari 06-23-2011 05:24 AM

Script to check tomcat and Pgsql running or not
 
Hi,

I have Linux server with cent OS.I have installed tomacat6.0 and postgresSQL8.3 on it.The thing is i wanna know whether the tomcat and postgresSQL is running or not using the script.Help me please.

ssrameez 06-23-2011 05:39 AM

You can write a shell/perl script.

use the "ps -ef|grep '<process name>'|grep -v grep"
"ps -ef|grep '<process name>'|grep -v grep|wc -l" - this will give you the process count

based on that you can check whether a process is running or not.

Try out something and give the code here if you are still facing any issues.

we will give you suggestions to correct/improve.

--Rameez


All times are GMT -5. The time now is 12:22 PM.