If you have a VPS service or a Dedicated Server, there are several commands that you can execute (as root) from the Linux console (or using the program putty), I will explain what each one is for:
netstat -antu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
This command will tell you the number of connections there are on your server (from or to) and will order them from smallest to largest. It is very useful to control or discover if there is an attacking or suspicious IP on the server.
ps aux | awk '{print $11}' | sort | uniq -c | sort -n
This command will show you a list of processes on the server, just like the previous one, it will count and group them from highest to lowest. It is useful to know if any service is being abused, for example if your server is overloaded and you have more than 60 exim processes running, it is very likely due to this and by restarting that service it will normalize a bit.
mysqladmin processlist | awk '{print $4}' | sort | uniq -c | sort -n
This, like the previous ones, shows, adds and counts the number of accesses to MySQL. It may not look very good due to the format of the output (some dashes or strange characters appear that do not help), but it is very useful to find if any user or database is causing problems on the server.
ps aux | more
This command will show you all the processes that are running on the server, you can go between them with the space bar or with [enter].
exiqgrep -o 259200 -i | xargs exim -Mrm
With this command, you will automatically delete all emails in the queue that are older than 3 days (72 hours, 259200 seconds). It is very likely that if an email could not be sent after 3 days, it will not be sent on the 4th day either, so it is better to free the email queue so that the server is not overloaded with these old emails.
exim -bp | exiqsumm | sort -n
This command will show us the entire waiting queue, ordered by the number of emails from each domain. It is useful to detect if a domain is spamming or if many of your accounts are failing (due to lack of space or some other conflict) since when they do not reach your account, these emails remain in the waiting queue. The same if you send thousands of emails, they accumulate as the server cannot send them simultaneously and can overload the server.
Knowledgebase
- 3 Users Found This Useful