Some monitoring commands for server

VPS and dedicated server security tips. Preventing from attacks, ddos and more.

Some monitoring commands for server

Postby Mark » Mon Dec 14, 2009 1:05 pm

Commands: :ugeek:

top: - used for the viewing current process going on the server. You will get a dynamic table of running process as a output .The table content following columns.
For example using more option with the top command you can get a better output
For example: -

top c PID USER Page Ranking NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

PID: - process id
User: - owner of that process
We omit the Page Ranking NI VIRT RES SHR
%CPU: - CPU usage of the process
%MEM : - memory usage of the proces TIME+ :- the process is running form.
COMMAND: - the actual command

You can kill or renice the process is causing high load on the using the kill command

Format:-
1. Kill -9 PID

-9 is special Kill signal, which will kill the process.

2. Killall process name

killall -9 lighttpd

Another command to view process going on the server,

ps aufx

Usage :-

ps aufx | grep processname

example :-

ps aufx | grep nobody

ps -aux | grep ftp >> used for checking ftp action taken by user like uploading /downloading files

Log files :-
tail -f /usr/local/apache/logs/access_log :-
tail -f /usr/local/apache/logs/error_log :- site access error logs
tail -f /var/log/exim_mainlog :- mail logs.

usr/local/apache/logs :: access log, error log, if configured php logs, domain logs(domlogs),module logs, httpd pid

tail -f /usr/local/apache/logs/access_log fro httpd



/var/log/

* /var/log/message: Genreal message and system releated stuff

* /var/log/auth.log: Authenication logs

* /var/log/kern.log: Kernel logs

* /var/log/cron.log: Crond logs

* /var/log/maillog: Mail logs

* /var/log/qmail/ : Qmail log directory (more files inside this directory)

* /var/log/httpd/: Apache access and error logs directory

* /var/log/lighttpd: Lighttpd access and error logs directory

* /var/log/boot.log : System boot log

* /var/log/mysqld.log: MySQL database server log file

* /var/log/secure: Authentication log

* /var/log/utmp or /var/log/wtmp : Login records file

* /var/log/yum.log: Yum log files





For spamming issue or high mail queue you can check the logs



tail -f /var/log/exim_mainlog | grep sendmail, public_html, tmp



MYSQL:-



mysqladmin processlist :- shows current mysql database usage



watch mysqladmin processlist :- dynamic usage of mysql process .



Service restart commands- /scripts/restartsrv_servicename

restartsrv_entropychat*

restartsrv_exim*

restartsrv_eximstats*

restartsrv_ftpserver*

restartsrv_httpd*

restartsrv_imap*

restartsrv_inetd*

restartsrv_interchange*

restartsrv_ipaliases*

restartsrv_melange*

restartsrv_mysql*

restartsrv_named*

restartsrv_nsd*

restartsrv_postgres*

restartsrv_postgresql*

restartsrv_proftpd*

restartsrv_pureftpd*

restartsrv_rsyslogd*

restartsrv_spamd*

restartsrv_sshd*

restartsrv_syslogd*

restartsrv_tailwatchd*

restartsrv_tomcat*

restartsrv_xinetd*
Mark
 
Posts: 124
Joined: Fri Dec 11, 2009 2:18 pm

Re: Some monitoring commands for server

Postby Jhon Kelly » Tue Dec 22, 2009 9:16 am

As I know there are no softwear like this and the fttp server softwear can use only local area network . you may use the the meter for checking your download speed how bandwith incoming or out going etc...
Jhon Kelly
 
Posts: 101
Joined: Fri Dec 18, 2009 9:32 am


Return to Securing your server

Who is online

Users browsing this forum: No registered users and 2 guests

cron