Solved

Seeting Logs in AIX

Posted on 2009-05-11
7
1,793 Views
Last Modified: 2013-11-17
Hello i would like to retain logs of 90 days in aix , please tell me how to do this and how to check the current no. of days are set on server

Thanks
0
Comment
Question by:prashantchauhan
  • 3
  • 2
  • 2
7 Comments
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 250 total points
ID: 24354451
Hi,

There's not a default tool in AIX to do that. There's a tool called logrotate. IT is available through Toolbox CD. It supports only V5.3 of AIX though.

Cheers,
K.


0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 24354616
Hi,
which logs are you talking about?
There is, except for syslog and cron, no automatic log rotation facility in AIX.
- syslog: configuration is done in /etc/syslog.conf. Look for the keywords "rotate, size, time, files ...", where rotation based on time is configured by the "time" keyword. Specify a number and h(our), d(ay) or w(eek) following "time".
- cron: this is configured in /etc/cronlog.conf (only with AIX 5300-04 or higher, or AIX 6). Rotation based on time is not possible, it can be done based on size only.
For all the other logs governed by the OS you will need something like "logrotate"
Find logrotate here -
http://www.perzl.org/aix/index.php?n=Main.Logrotate
 
wmp
 
 
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 24354710
logrotate (as can be obtained e.g. from perzl.org) supports AIX levels starting with 4.2, afaik ...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:prashantchauhan
ID: 24363385
Hello Please can u look at this and let me know how should i get this details from the server and would like to implemnet on all my aix server
retention-log.JPG
0
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 250 total points
ID: 24363708
Hi,

IBM Syslog can not archive your wtmp nor your failedlogins. So you'll need logwatch to accomplish this. You can etiher use tour ToolBox CD (for AIX 5.3 and higher) or you can download it from here:
http://www.perzl.org/aix/index.php?n=Main.Logrotate
As some other experts told. (Use the command oslevel to see what version of os you are using)

Once you've downloaded it you need
coreutils
popt
libopt.a

Pagkages must be installed on your system. So you'll need your toolbox CD and OS CD's anyway.

You'll see WTMP is there. Notice the keywords monthls suggesting that it wil be rotated every 30 days and rotate 3 meaning that it will keep 3 older versions meaning that you'll have 3 monthly copies. a total of 90 days of retention will be there.

For the other files you need to go to /etc/logrotate.d and create a file called sulog. It should contain these lines:

/var/adm/sulog {
      create 0600 root system
      sharedscripts
}
   
and create another file called failedlogins under the same folder conatining::
/etc/security/failedlogins {
    create 0644 root system
   sharedscripts
}


I hope this helps.

Cheers,
K.



# see "man logrotate" for details

# rotate log files monthly

monthly
 

# keep 4 months worth of backlogs

rotate 4
 

# create new (empty) log files after rotating old ones

create
 

# uncomment this if you want your log files compressed

compress
 

# RPM packages drop log rotation information into this directory

include /etc/logrotate.d
 

# no packages own wtmp -- we'll rotate them here

/var/log/wtmp {

    monthly

    create 0664 root utmp

    rotate 3

}
 

# system-specific logs may be also be configured here.

Open in new window

0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 24364107
The required packages coreutils, popt, gettext, info are available here, too. No need for OS CDs or the toolbox CD.
http://www.perzl.org/aix/index.php?n=Main.HomePage 
0
 

Author Closing Comment

by:prashantchauhan
ID: 31580140
many thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now