Selasa, 22 Mei 2012

Logwatch di Linux

Bagi mereka yang Windows Minded tentu tidak pernah mengetahui bagaimana cara Linux memanjakan pengelolanya. Salah satunya adalah fasilitas logwatch yang sangat membantu siapa saja yang bertugas mengelola komputer-komputer Linux didalam jaringan. Padanannya sulit dicari di Windows, kecuali membuat sendiri atau membeli produk tentunya. Apabila dikonfigurasikan dengan tepat, logwatch akan sangat berguna karena akan memberikan laporan bagaimana kondisi dan keadaan sebuah komputer. Mari kita melihat contoh bentuk laporan logwatch yang sederhana saja.
From   : logwatch@komputer1.kantor.bjm
To     : root@komputer1.kantor.bjm
Subject: Logwatch for komputer1.kantor.bjm (Linux)
Date   : Wed, 2 May 2012 09:21:05 +0800 (CIT)
 
################# Logwatch 7.3.6 (05/19/07) #################
   Processing Initiated: Wed May 2 09:21:05 2012
   Date Range Processed: yesterday
          ( 2012-May-01 )
          Period is day.
   Detail Level of Output: 0
   Type of Output: unformatted
   Logfiles for Host: komputer1.kantor.bjm
##############################################################
 
--------------------- Automount Begin ------------------------
 
**Unmatched Entries**
lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master: 1 Time(s)
 
---------------------- Automount End -------------------------
 
 
--------------------- clam-update Begin ------------------------
 
 
No updates detected in the log for the freshclam daemon (the ClamAV update process). If the freshclam daemon is not running, you may need to restart it. Other options:
 
A. If you no longer wish to run freshclam, deleting the log file (default is freshclam.log) will suppress this error message.
 
B. If you use a different log file, update the appropriate configuration file. For example:
echo "LogFile = log_file" >> /etc/logwatch/conf/logfiles/clam-update.conf
where log_file is the filename of the freshclam log file.  
C. If you are logging using syslog, you need to indicate that your log file uses the syslog format. For example:
      echo "*OnlyService = freshclam" >> /etc/logwatch/conf/logfiles/clam-update.conf
      echo "*RemoveHeaders" >> /etc/logwatch/conf/logfiles/clam-update.conf
 
---------------------- clam-update End -------------------------
 
 
--------------------- httpd Begin ------------------------  
Requests with error response codes
      405 Method Not Allowed
      /10322d: 1 Time(s)
      /homes: 1 Time(s)
 
---------------------- httpd End -------------------------  
 
--------------------- pam_unix Begin ------------------------
 
gdm-password:
    Unknown Entries:
      session opened for user paijo by (uid=0): 1 Time(s)
 
---------------------- pam_unix End -------------------------
 
 
--------------------- Postfix Begin ------------------------
 
      1 Postfix start  
---------------------- Postfix End -------------------------
 
 
--------------------- samba Begin ------------------------  
Connections Denied:
    smbd/process.c:2299(smbd_process) 192.168.2.17 : 1 Time(s)
    smbd/process.c:2299(smbd_process) 192.168.2.35 : 1 Time(s)
    smbd/process.c:2299(smbd_process) 192.168.2.66 : 1 Time(s)
    smbd/process.c:2299(smbd_process) 192.168.1.103 : 9 Time(s)
    smbd/process.c:2299(smbd_process) 192.168.1.47 : 1 Time(s)
    smbd/process.c:2299(smbd_process) 192.168.2.109 : 18 Time(s)
    smbd/process.c:2299(smbd_process) 192.168.2.70 : 1 Time(s)
 
---------------------- samba End -------------------------  
 
------------ Connections (secure-log) Begin ---------------
 
**Unmatched Entries**
    polkitd(authority=local): Registered Authentication Agent for session /org/freedesktop/ConsoleKit/Session1 (system bus name :1.25 [/usr/libexec/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8): 1 Time(s)
    polkitd(authority=local): Registered Authentication Agent for session /org/freedesktop/ConsoleKit/Session2 (system bus name :1.47 [/usr/libexec/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.utf8): 1 Time(s)
    polkitd(authority=local): Unregistered Authentication Agent for session /org/freedesktop/ConsoleKit/Session1 (system bus name :1.25, object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus): 1 Time(s)
    webmin: Webmin starting: 1 Time(s)  
------------ Connections (secure-log) End ------------
 
 
--------------------- SSHD Begin ------------------------
 
SSHD Started: 2 Time(s)
 
---------------------- SSHD End -------------------------
 
 
--------------------- Disk Space Begin ------------------------
 
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVolRoot     77G  4.8G   69G  7%  /
/dev/mapper/VolGroup00-LogVolBackup  191G  188M  182G  1%  /backup
/dev/md0                             291M   32M  244M  12% /boot /dev/mapper/VolGroup00-LogVolHome 183G  890M  173G  1%  /home  
------------------ Disk Space End ---------------------
 
 
###################### Logwatch End #########################
Cukup banyak informasi yang bisa kita lihat dari laporan logwatch ini.
 
1. Dari struktur laporan pertama adalah periode pembuatan laporan. Dalam hal ini periode pelaporan adalah harian.
 
2. Terlihat service-service apa saja yang aktif. Pada contoh laporan diatas terlihat service samba, httpd, sshd, dan postifx. Tentunya kita harus sudah mengenali nama-nama server tersebut. httpd adalah web server, sshd adalah server ssh, postfix adalah mail server. Server-server ini diaktifkan dan dikonfigurasikan sesuai fungsi mesin yang diinstall linux diatas.
 
3. Selain service-service juga terdapat laporan pemakaian harddisk pada setiap partisinya. Apabila kita menggunakan LVM (Large Volume Management) maka akan terlihat juga laporannya.
 
4. Apabila kita menginstall clamav maka terdapat laporan status update anti virusnya. Pada contoh laporan diatas terlihat update tidak berjalan. Dari sinilah kita bisa meneliti kekurangan konfigurasi yang masih harus dilakukan.
 
5. Pada sub bagian pam_unix kita bisa melihat pesan yang berhubungan dengan kesalahan mengisikan password.
 
6. Dan seterusnya.
 
Tiap pelaporan logwatch akan berubah-ubah tergantung pada apa saja service yang diaktifkan dan aktivitas yang dilakukan pada komputer tersebut. Jika terdapat aktivitas install atau uninstall program maka semua juga akan tercatat.
 
Dengan membaca secara rutin laporan yang datang lewat email ini maka kita setidaknya tahu kondisi dan aktivitas pada komputer tanpa harus mendatangi komputer hanya sekedar untuk memeriksa kondisinya. Karena itu komputer-komputer yang menggunakan OS linux selama logwatch rutin mengirimkan laporan, sebetulnya bisa tetap terpantau tanpa perlu kehadiran personil IT secara fisik, terkecuali terjadi kerusakan hardware atau jaringan yang memang tidak dapat diduga atau prediksi sebelumnya.
 

Tidak ada komentar:

Posting Komentar