Red Hat System Administration III - Unit 10 - System Monitoring and Logs
Usage Reports
df -h-- provides info about mountsdu-- directory level analysis--maxdepth-- how many subdirs to traverse
iostat-- get details on cpu usage and disk device statisticsiostat -N-- logical volume informationiostat -dNk <interval> <number_of_repetitions>-- logical volume information
vmstat-- get virtual memory statsr-- ??b-- ??swpd-- ??free-- ??buff-- ??cache-- ??si-- ??so-- ??bi-- ??bo-- ??
Monitoring with AIDE and star
-
AIDEchecks the integrity of files on disk -
Install the
aidepackage - Config
/etc/aide.conffile - Run the
/usr/bin/aide --initto build the initial db - Store
/etc/aide.conf,/usr/bin/aideand/var/lib/aide/aide.db.new.gzin a secure location -
Copy the
/var/lib/aide/aide.db.new.gzto/var/lib/aide/aide.db.gz(the expected name) -
saris generally used by cron to gather system information about a server- Available in
sysstatpackage
- Available in
Tuning tmpwatch and logrotate
tmpwatchis used to remove folders that haven't been modified in X dayslogrotateis used to rotate logs daily
Remote logging service
/etc/rsyslog.conffile- Go through man page of
rsyslogdto get info on facilities levels- debug
- info | |
- panic
-
To send to remotehost
> vi /etc/rsyslog.conf *.* @@192.168.0.254:514 -
Receive syslog messages via TCP:
# Provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 514
Logrotate
- Force logrotation with:
> logrotate -f /etc/logrotate.conf