Arief Yudhawarman

Masih belajar buat blog

ERROR: Date::Manip unable to determine TimeZone (Logwatch)

leave a comment »

Setiap hari dapat email seperti ini dari cron daemon.

Service cron daily mengeksekusi script logwatch

Logwatch is a customizable log analysis system. Logwatch parses through your system’s logs and creates a report analyzing areas that you specify. Logwatch is easy to use and will work right out of the package on most systems.

Setelah membaca perldoc Date::Manip dan browsing artikel Methods To Change TimeZone in Linux problem ini bisa diatasi dengan set environment variable TZ sebelum menjalankan script logwatch.

export TZ=America/Los_Angeles; /usr/share/logwatch/scripts/

Mengapa menggunakan timezone America/Los Angeles ? Penulis sudah mencoba menggunakan timezone Asia/Jakarta tetapi muncul error seperti pada gambar di atas. Alternatif lain menggunakan timezone JAVT.

export TZ=JAVT; /usr/share/logwatch/scripts/

Set environment variable TZ bisa dilakukan di script logwatch. Edit file /usr/share/logwatch/scripts/ dan masukkan baris yang bercetak tebal:

$ENV{'HOSTNAME'} = $Config{'hostname'};
$ENV{'OSname'} = $OSname;
$ENV{'TZ'} = 'JAVT';

Jika kita tidak memerlukan logwatch untuk menganalisa log samba dan vsftp, edit file konfigurasi /usr/share/logwatch/default.conf/logwatch.conf, tambahkan baris yang bercetak tebal di bawah ini:

# You can also disable certain services (when specifying all)
Service = "-zz-network"     # Prevents execution of zz-network service, which
                            # prints useful network configuration info.
Service = "-zz-sys"         # Prevents execution of zz-sys service, which
                            # prints useful system configuration info.
Service = "-eximstats"      # Prevents execution of eximstats service, which
                            # is a wrapper for the eximstats program.
# If you only cared about FTP messages, you could use these 2 lines
# instead of the above:
#Service = ftpd-messages   # Processes ftpd messages in /var/log/messages
#Service = ftpd-xferlog    # Processes ftpd messages in /var/log/xferlog
# Maybe you only wanted reports on PAM messages, then you would use:
#Service = pam_pwdb        # PAM_pwdb messages - usually quite a bit
#Service = pam             # General PAM messages... usually not many
Service = "-vsftpd"
Service = "-samba"

Written by awarmanf

May 16, 2013 at 8:27 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: