Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Before this, my server running but webmin are not accessible and website very slow. i dont know what happened and I simply restart.

But I think better if I know whats the problem and fix it without restart

(I use Centos, Lighttpd, MySQL, PHP, and Webmin)

So, do you know what command to use to check if everything running fine via SSH?

Thanks

share|improve this question
5  
If there wast just a single command to "check if everything" was "running fine" then I think there'd be a lot less of a need for a site like Server Fault. –  Evan Anderson Jan 20 '10 at 23:37
    
I need the command, not comment.. since I have no idea about Webmin dependencies –  Kewasen Jan 20 '10 at 23:50
2  
Evan's point is that you're asking for years of admin experience to be summed up in a single answer. There is no way to do what you're asking with a single command. I would start with the logs. Look through and see if you can find any errors. –  einstiien Jan 21 '10 at 0:01
    
Systems administration is a lot like programming which is, after all, just typing... codinghorror.com/blog/archives/001188.html –  Evan Anderson Jan 21 '10 at 0:09
add comment

4 Answers

To check if everything is running fine first you must have a baseline. Without knowing what is normal you will find it very difficult to figure out what is out of the ordinary.

You should login to your system occasionally and run commands like below. Examine the output, and take time to learn about the commands and learn what is normal for your system.

  • top (displays information about tasks)
  • vmstat (report virtual memory statistics)
  • free (display amount of free and used memory in the system)
  • sar (system activity report)
  • df -h (disk usage in blocks)
  • df -hi - (disk usage in inodes)
  • iotop - (top-like I/O monitor)
  • tcpdump -qn - (dump network traffic)

Periodically examine your log files in /var/log. Doing this necessary so you will know what to ignore when are having problems.

Ideally you should setup a network monitoring system to gather data the above tools normally collect.

Check out some of the other questions about troubleshooting. There are a few good general questions that should help you get started.

share|improve this answer
add comment

I usually just start with a 'top' command to see what's going on with the various processes currently running and what kind of resources they're using.

It's what I use in *nix, as opposed to Task Manager in Windows land.

share|improve this answer
add comment

This command should tell you all the running services, make sure everything you expect to be running, is.

service --status-all | less

If you see a service that isnt running, or you want to just try restarting a service you can use,

chkconfig httpd off
chkconfig httpd on

You can also use these 2 commands to check the top Mem and CPU hogs respectively

ps -auxf | sort -nr -k 4 | head -10
ps -auxf | sort -nr -k 3 | head -10

You may also want to try running strace against some of your programs and see if you can gleam any information from the logs.

share|improve this answer
add comment

I normally follow

uptime

service --status-all | less

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.