Solved

Command to see server status on a Ubuntu box

Posted on 2013-01-15
6
440 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
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help in Setting up VLAN interfaces in Ubuntu 14.04 LTS 7 69
System Analysis 5 61
listing all functions in JavaScript 19 216
Need To Change Centos 6 Timestamp Form In Log File 24 92
After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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