Solved

Command to see server status on a Ubuntu box

Posted on 2013-01-15
6
444 Views
Last Modified: 2013-01-16
Hi, I have the following servers running on my Ubuntu linux box:

Apache
Mysql
Asterisk

What command do I use to see the status of the servers running on my machine, I would like to know if the server is running or stopped. I will use this output to display the status of these servers to a web page.

Thanks for the help.

A
0
Comment
Question by:aej1973
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 38785022
ps ax|egrep '(apache|httpd|mysqld|asterisk)'
# or
ps -ef|egrep '(apache|httpd|mysqld|asterisk)'
0
 
LVL 62

Accepted Solution

by:
gheist earned 150 total points
ID: 38785239
/etc/init.d/service "status"
0
 

Author Comment

by:aej1973
ID: 38785274
gheist, I do not have a file/directory service in init.d. Can you please clarify, thank you.
0
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

Author Comment

by:aej1973
ID: 38785285
Thank you for the suggestion, I was able to run the following command to get what I was looking for;

service apache2 status
service mysql status

Thank you.

A
0
 
LVL 62

Expert Comment

by:gheist
ID: 38786020
Most likely you want snmp and something like nagios in long run...
0
 
LVL 62

Expert Comment

by:gheist
ID: 38786024
P.S not mentioning a version of ubundu yields not very accurate commands
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question