AIX

 View Only
  • 1.  Log rotation in AIX7.2 TL5

    Posted Tue February 28, 2023 04:03 PM

    Hi all,
    Our team has a daily log rotation of Netcool logs by logmgr and cron.
    But, Log rotation did not work when TL5 was applied to the Netcool server(AIX7.2 TL4).
    We checked the cronlog and found that /usr/sbin/logrotate was executed, but the /usr/sbin/logrotate command failed to execute.

    =========

    root      : CMD ( /usr/sbin/logrotate -f /opt/freeware/etc/logrotate.d/logmgr_NCOMS_AML1.conf -s /opt/freeware/var/lib/logrotate.status ) : PID ( 5112250 ) : Wed Feb  1 00:00:00 2023

    Cron Job with pid: 5112250 Failed

    root      : CMD ( /usr/sbin/logrotate -f /opt/freeware/etc/logrotate.d/logmgr_ITM.conf -s /opt/freeware/var/lib/logrotate.status ) : PID ( 25821572 ) : Wed Feb  1 00:00:00 2023

    Cron Job with pid: 25821572 Failed

    =========

    Why does the logrotate process fail?
    Is there a possibility that the AIX7.2 TL4 server will not be able to read the format of the syntax because of the application of TL5?

    Please give us some advice on which parts we need to investigate and revise more.



    ------------------------------
    Sujin Jeon
    ------------------------------


  • 2.  RE: Log rotation in AIX7.2 TL5

    IBM Champion
    Posted Wed March 01, 2023 03:37 AM

    Hi Sujin,

    you can try to run logrotate with -v (verbose) flag to see the output and a possible error message.

    /usr/sbin/logrotate -v -f /opt/freeware/etc/logrotate.d/logmgr_ITM.conf -s /opt/freeware/var/lib/logrotate.status


    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 3.  RE: Log rotation in AIX7.2 TL5

    IBM Champion
    Posted Wed March 01, 2023 04:23 AM
    Edited by José Pina Coelho Wed March 01, 2023 04:23 AM

    You gave us the syslog of the the cronjob which tells us the cronjob failed, not the output of the command.

    Are you redirecting stderr/stdout to /dev/null ?

    Andrey's question is the path forward.

    PS: TL5 doesn't change anything on log formats.



  • 4.  RE: Log rotation in AIX7.2 TL5

    Posted Wed March 01, 2023 08:57 AM

    I had logrotate working fine with 7.2 TL5 at my last site.  Make sure that you're running the latest version that is avalaible in the repository.



    ------------------------------
    Phill Rowbottom
    ------------------------------



  • 5.  RE: Log rotation in AIX7.2 TL5

    Posted Wed March 01, 2023 10:20 AM

    At my last site we were running 7.2 TL5 and had no issues with logrotate.  We did have it updated to the latest version avaialbe in the repository, thus it might be worth checking that you have a current version installed.



    ------------------------------
    Phill Rowbottom
    ------------------------------



  • 6.  RE: Log rotation in AIX7.2 TL5

    Posted Thu March 02, 2023 07:12 AM

    My guess is that your logrotate problem arose not because of upgrading AIX but because you updated the RPMs AIX tools.

    What version of logrotate RPM have you installed? 3.14  or 3.18 ? 

    I ask this question since logrotate pkg does not include in 3.18 /usr/sbin/logrotate (which is actually a link you could create manually:  See the following outputs of two different AIX systems:

    @root:/adm/sys>rpm -lq logrotate-3.14.0-4.ppc
    /opt/freeware/doc/logrotate-3.14.0
    /opt/freeware/doc/logrotate-3.14.0/COPYING
    /opt/freeware/etc/cron.daily/logrotate
    /opt/freeware/etc/logrotate.conf
    /opt/freeware/etc/logrotate.d
    /opt/freeware/man/man5/logrotate.conf.5
    /opt/freeware/man/man8/logrotate.8
    /opt/freeware/sbin/logrotate
    /opt/freeware/sbin/logrotate_32
    /opt/freeware/sbin/logrotate_64
    /opt/freeware/var/lib/logrotate.status
    /usr/sbin/logrotate
    /usr/sbin/logrotate_32
    /usr/sbin/logrotate_64

    @root:/adm/sys>ls -ld /usr/sbin/logrotate
    lrwxrwxrwx    1 root     system           33 Jun  3 2021  /usr/sbin/logrotate -> ../../opt/freeware/sbin/logrotate
    @root:/adm/sys>oslevel -s
    7200-04-02-2028

    ON ANOTHER SERVER:

    @root:/adm/sys>rpm -aq|grep logrotate
    logrotate-3.18.0-3.ppc
    @root:/adm/sys>oslevel -s
    7200-05-04-2220
    @root:/adm/sys>rpm -aq|grep logrotate
    logrotate-3.18.0-3.ppc
    @root:/adm/sys>rpm -lq logrotate
    /opt/freeware/doc/logrotate-3.18.0
    /opt/freeware/doc/logrotate-3.18.0/COPYING
    /opt/freeware/etc/cron.daily/logrotate
    /opt/freeware/etc/logrotate.conf
    /opt/freeware/etc/logrotate.d
    /opt/freeware/man/man5/logrotate.conf.5
    /opt/freeware/man/man8/logrotate.8
    /opt/freeware/sbin/logrotate
    /opt/freeware/sbin/logrotate_32
    /opt/freeware/sbin/logrotate_64
    /opt/freeware/var/lib/logrotate
    /opt/freeware/var/lib/logrotate/logrotate.status
    @root:/adm/sys>ls -ld /usr/sbin/logrotate
    /usr/sbin/logrotate not found



    ------------------------------
    Ivan Montesino Martinez del Cerro
    ------------------------------