Syslog rotation settings
search cancel

Syslog rotation settings

book

Article ID: 331143

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Settings to be verified in Network Configuration Manager (NCM) when syslog file is not getting rotated. 

Steps to change the log rotation from default value 7. 

Environment

NCM 10.1.x

Resolution

If Syslog file present under $VOYENCE_HOME/cm is not getting log rotated. Please verify below steps:

  • Please check the Syslog file permission under $VOYENCE_HOME/cm. It should be ncm:voyence permission. If not please change the permission using below command 
    • "chown ncm:voyence $VOYENCE_HOME/cm/Syslog*" 
  • Open /etc/logrotate.d/eventlogrotate

  • Copy below content in this file:

#Copyright © [2019] VMware, Inc. All rights reserved. This product is protected by copyright and intellectual property laws in the United States and other countries as well as by international treaties. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents.

#

# Version ==version==.==build==

# $Date: 2009-02-23 20:51:54 $

# $RCSfile: eventlogrotate,v $

# $Revision: 1.6 $

 

/opt/smarts-ncm/logs/ssh.log{

    su ncm voyence

    rotate 7

    daily

}

/opt/smarts-ncm/cm/Syslog {

    su ncm voyence

    rotate 7

    daily

    size=100k

    sharedscripts

    postrotate

           if ps -ae | grep rsyslogd > /dev/null

           then

            /usr/bin/killall -HUP rsyslogd

        fi

        if ps -ae | grep [^r]syslogd > /dev/null

           then

             /usr/bin/killall -HUP syslogd

        fi

    endscript

}

  • Reload crond 

    systemctl reload crond

  • Restart crond 

    systemctl restart crond

To change the Syslog rotation in Smarts NCM from the default value (7), do the following:

  • Log in to the Smarts NCM server with root privileges.
  • Open the eventlogrotate file in vi editor:

      vi /etc/logrotate.d/eventlogrotate

  • Search the file and find "rotate 7".
  • Change 7 to the desired number, and save and close the file.
  • Reload crond systemctl reload crond
  • Restart crond systemctl restart crond