Solved

Command to see server status on a Ubuntu box

Posted on 2013-01-15
6
435 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
  • 3
  • 2
6 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
ps ax|egrep '(apache|httpd|mysqld|asterisk)'
# or
ps -ef|egrep '(apache|httpd|mysqld|asterisk)'
0
 
LVL 61

Accepted Solution

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

Author Comment

by:aej1973
Comment Utility
gheist, I do not have a file/directory service in init.d. Can you please clarify, thank you.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:aej1973
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
Most likely you want snmp and something like nagios in long run...
0
 
LVL 61

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now