• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
HP-UX 11i Log File Management with Logrotate by Dusan Baljevic
 

HP-UX 11i Log File Management with Logrotate by Dusan Baljevic

on

  • 136 views

HP-UX 11i Log File Management with Logrotate

HP-UX 11i Log File Management with Logrotate

Statistics

Views

Total Views
136
Views on SlideShare
136
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    HP-UX 11i Log File Management with Logrotate by Dusan Baljevic HP-UX 11i Log File Management with Logrotate by Dusan Baljevic Document Transcript

    • Dusan Baljevic dusan.baljevic@ieee.org By default, HP-UX does not have any global tool to manage log file archiving and rotation. A good, open-source option is to use logrotate. a) Go to: http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-3.8.7/ Install it on HP-UX server (and all prerequisites). b) Set up a cron job. For example: # crontab -l # Entry for monitoring status of the EMSHAProvider 5,20,35,50 * * * * /etc/opt/resmon/lbin/mon_EMSHAProvider_state.sh 5,20,35,50 * * * * /opt/sfm/bin/restart_sfm.sh 10,20,30,40,50 * * * * /usr/sbin/dmesg - >> /var/adm/messages # Entry for vacuuming the CERDB 5 1 * * * /opt/psb/vacuum 5,20,35,50 * * * * /opt/raidsaprovider/bin/restart_raidsaprovider.sh 5,20,35,50 * * * * /opt/sas/provider/bin/restart_sasprovider.sh 5,20,35,50 * * * * /opt/fcprovider/bin/restart_fcprovider.sh 5,20,35,50 * * * * /opt/dasprovider/bin/restart_dasprovider.sh 5,20,35,50 * * * * /opt/psb/bin/restart_logserv.sh # logrotate 0 0 * * * /usr/local/sbin/logrotate /etc/logrotate.conf>/var/adm/syslog/logrotate.log 2>&1 c) Set up the /etc/logrotate.conf. For example: # cat /etc/logrotate.conf # sample logrotate configuration file compress /var/adm/syslog/syslog.log { rotate 5 weekly postrotate /usr/bin/kill -HUP `cat /var/run/syslog.pid` endscript } /var/adm/syslog/mail.log { rotate 5 weekly postrotate /usr/bin/kill -HUP `cat /var/run/syslog.pid` endscript }
    • /var/adm/syslog/vseassist.log { rotate 12 monthly missingok } /var/adm/sw/swverify.log { rotate 5 weekly postrotate /sbin/init.d/swagentd stop /sbin/init.d/swagentd start endscript } #/var/log/httpd/access.log { # rotate 5 # mail root # size 100k # sharedscripts # postrotate # /usr/bin/killall -HUP httpd # endscript #} # no packages own wtmp -- we'll rotate them here /var/adm/wtmp { monthly create 0664 adm adm rotate 12 } /var/adm/wtmps { monthly create 0664 adm adm rotate 12 } /var/opt/wbem/*.log { monthly rotate 2 olddir /var/opt/wbem/prevmonth missingok postrotate /sbin/init.d/cim_server stop /sbin/init.d/cim_server start endscript nocompress }
    • d) Check how it works: # cat /var/run/logrotate.status logrotate state -- version 2 "/var/adm/wtmp" 2013-3-16 "/var/adm/sw/swverify.log" 2013-3-16 "/var/adm/syslog/vseassist.log" 2011-3-16 "/var/opt/wbem/wbemassist.log" 2013-3-16 "/var/opt/wbem/install.log" 2011-3-16 "/var/adm/syslog/syslog.log" 2013-3-16 "/var/adm/wtmps" 2013-3-16 "/var/adm/syslog/mail.log" 2013-3-16