How to monitor your Linux server ?

Ideally, there exists 2 strategies to remotely monitor your web server. One amongst that could be a a lot of preventative monitoring that is done straight using the command prompt or the web hosting control panel whereas by using third party services or tools you can also monitor the up-time. Both the strategies are crucial from the disaster recovery and bar purpose of view. Both these types of monitoring will assist you avoid your server from going down.

Monitoring the server logs or system logs is one aspect, however you’ll be able to monitor processes on your system additionally. If you’ve got a selected application running on the server that you suppose to consume a great deal of resources like RAM and CPU, an easy command will assist you with monitoring the method that’s feeding up most of your server resources. Simply log-in to your SSH and run the command :

top

This command would show your server’s memory usage, the overall range of users that are on-line, average server load, CPU consumption, total up-time, memory (virtual) and also the time since each method has been running. In-addition to that this command would additionally assist you view the user who is operating the method, this could assist you with investigating the suspected users. Once completed with it, you simply required to type “q” to exit.

This so proves helpful once you want to see the most CPU intensive processes running at a given purpose of your time. However what in-case wherever you wish to see all the methodes that are operational at a given time? there’s a new tool which will assist you with observance every process termed because the “ps”. to view the processes you need to enter the following in your SSH :

ps aux

Incase you would like to view it on a per-page basis, you have to kind :

ps aux | less

After doing this if you encounter a process that you’re feeling, should be terminated, you need to make a note the process ID (PID) as listed on the screen. Once you’ve created a list of such processes just run the command as shown below:

kill 1234

You must change the PID for every process you would like to terminate. If you would like to terminate/kill each process that runs below a selected command, you’ll be able to use the command as follow:

killall command-name

These easy steps will assist you avoid your server from going down due to some resource intensive processes that are advisedly or mistakenly been run.