Command to see server status on a Ubuntu box

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
aej1973Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
gheistConnect With a Mentor Commented:
/etc/init.d/service "status"
0
 
ahoffmannCommented:
ps ax|egrep '(apache|httpd|mysqld|asterisk)'
# or
ps -ef|egrep '(apache|httpd|mysqld|asterisk)'
0
 
aej1973Author Commented:
gheist, I do not have a file/directory service in init.d. Can you please clarify, thank you.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
aej1973Author Commented:
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
 
gheistCommented:
Most likely you want snmp and something like nagios in long run...
0
 
gheistCommented:
P.S not mentioning a version of ubundu yields not very accurate commands
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.