System Log Files

This logs_system_objects.cfg example specifies system log files with associated update and size data.  Various Pikt scripts reference this to handle log file rotation and truncation, also to report when log files aren't being updated.

///////////////////////////////////////////////////////////////////////////////
//
// logs_system_objects.cfg
//
///////////////////////////////////////////////////////////////////////////////

LogsSystem

// these fields must be tab-delimited!  from this point onward, the only
// spaces in this file should be in preprocessor directive lines (for example,
// '#if piktmaster') or comment lines, or in preproc or postproc fields

// all numeric fields must be actual numbers, not for example, 2*60*60 or
// 2*=KB, but rather 7200 or 2048

// when both days and secs are 0, this is the signal for PIKT to skip the
// fileage (and existence) test

// for the binary field, binary files are 1, text files are 0

// maxsize is in KB; a negative number for the maxsize says not to truncate,
// to report only

// preproc is the command(s), if any, to do pre-truncation (for example, to
// stop a daemon)
// postproc is the command(s), if any, to do post-truncation (for example, to
// restart a daemon)

//      macroname       filepath                days    secs    binary  maxsize
        preproc postproc

#if mailserver
        syslog          /var/log/syslog         0       600     0       100000
        .       /etc/init.d/syslog stop; sleep 60; /etc/init.d/syslog start
#elsif solaris
        syslog          /var/log/syslog         0       10800   0       100000
        .       /etc/init.d/syslog stop; sleep 60; /etc/init.d/syslog start
#elsif linux
        syslog          /var/log/messages       0       10800   0       10000
        .       =pikt +S SigHupSyslogd
#endif

#if solaris
        messages        /var/adm/messages       7       0       0       10000
        .       /etc/init.d/syslog stop; sleep 60; /etc/init.d/syslog start
#elsif linux
        messages        /var/log/messages       7       0       0       10000
        .       =pikt +S SigHupSyslogd
#endif

#if solaris | murmansk
        authlog         /var/log/authlog        0       0       0       10000
        .       .
#elsif linux
        authlog         /var/log/auth.log       7       0       0       10000
        .       .
#endif

#if solaris
#  if sunsuser
        sulog           /var/adm/sulog          30      0       0       10000
        .       .
#  else
        sulog           /var/adm/sulog          0       0       0       10000
        .       .
#  endif
#endif

#if solaris
        lpd-errs        /var/adm/lpd-errs       0       0       0       10000
        .       .
#elsif linux
        lpd-errs        /var/log/lpd-errs       0       0       0       10000
        .       .
#endif

        ntpd_log        /var/log/ntpd.log       0       0       0       10000
        .       .

#if solaris
        pacct           /var/adm/pacct          0       0       1       4096
        .       .
#elsif linux
        pacct           /var/log/pacct          0       0       1       -4096
        .       .
#endif

#if linux
        wtmp            /var/log/wtmp           7       0       1       -512
        .       .
#endif

#if solaris
        wtmpx           /var/adm/wtmpx          7       0       1       1024
        .       .
#endif

#if solaris
        last_log        /var/adm/lastlog        7       0       1       512
        .       .
#elsif linux
        last_log        /var/adm/lastlog        7       0       1       -512
        .       .
#endif

#if solaris
        vold_log        /var/adm/vold.log       0       0       0       10000
        .       .
        cron_log        /var/cron/log           1       0       0       10000
        /etc/init.d/cron stop /etc/init.d/cron start
        cron_olog       /var/cron/olog          0       0       0       10000
        /etc/init.d/cron stop /etc/init.d/cron start
        lpsched_log     /var/lp/logs/lpsched    0       0       0       10000
        .       .
#endif

[...]

///////////////////////////////////////////////////////////////////////////////

// pikt stuff in its own logs_pikt_objects.cfg file

///////////////////////////////////////////////////////////////////////////////

// local stuff in its own logs_local_objects.cfg file

///////////////////////////////////////////////////////////////////////////////

On the piktmaster system, we would install the LogsSystem.obj file to each PIKT slave system with the command:

# piktc -iv +O LogsSystem +H all        [or: ... -H down]

Open Hand For more examples, see Samples.

 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2008-09-06.   This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.   Copyright © 1998-2008 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
search terms
script macro