1. Disable the vRNI Controller polling in vRNI (detailed below) or any other Software / Scripts that uses a CLI method to pull relevant Network Information from the NSX Controllers, this should prevent the creation of a large volume of log files.
Polling Information from the NSX Controllers can be disabled on vRNI with the following steps:
2. Login in to root mode of the controller .To switch to the root user on any controller node, we first need the root password for the specific controller. Please follow below steps to get root access to controller
Root Login steps for NSX-V Controller Nodes:
Login in to root mode of NSX Manager using KB2149630.
Look for the controller id in the Networking & Security Tab in the vSphere (Web) client under the controller deployment section (Networking & Security > Installation & Upgrade > Management > NSX Controller Nodes).
Execute the following command in the Linux shell of the NSX Manager:
/home/secureall/secureall/sem/WEB-INF/classes/GetNvpApiPassword.sh controller-NN
Note: Replace controller-NN with the correct controller id. For example: controller-12)In the last line you will find the root password for this controller node:
Now, login as “admin” via SSH on the controller
Enter the root password which was displayed on the NSX Manager shell.Now you are in root mode of controller
3. Delete or transfer the auth.log.* and syslog.* files from /var/log/ directory periodically. Controller reboot or redeployment is not required.
Backup the rsyslog file to /tmp
Edit the rsyslog file
usr/bin/systemctl reload syslog.service > /dev/null_
with
usr/bin/systemctl kill -s HUP rsyslog.service > /dev/null_
Example file after edits:
cat rsyslog/var/log/syslog
{
rotate 56
size 32M
create
missingok
notifempty
delaycompress
compress
postrotate
/usr/bin/systemctl kill -s HUP rsyslog.service > /dev/null
endscript
}
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
rotate 4
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/bin/systemctl kill -s HUP rsyslog.service > /dev/null
endscript
}
Execute logrotate to read new config
Restart log service
rsyslog.service - System Logging Service
Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-10-05 21:16:17 UTC; 2s ago
Docs: man:rsyslogd(8)
http://www.rsyslog.com/doc/
Main PID: 11057 (rsyslogd)
Tasks: 6
CGroup: /system.slice/rsyslog.service
└─11057 /usr/sbin/rsyslogd -n
Oct 05 21:16:17 nsx-controller systemd[1]: Starting System Logging Service...
Oct 05 21:16:17 nsx-controller systemd[1]: Started System Logging Service.
Once the service restarts check /var/log to see the file syslog start writing logs into it.
Change to the /var/log directory and remove or transfer the identified large files consuming all the space