VMware Cloud Community
AndreasHammargr
Contributor
Contributor

Compressing vMA logfiles

I'm using vMA to collect logfiles from my 5 esxi hosts, and I have run into a problem. I would like to keep the disks for vMA as low as possible, but these logs keep growing larger and larger.

Is there no way with vilogger to enable compression on the rotated files?

With normal logrotate you can specify "compress", but I have found no such thing with vilogger.

It would be good to be able to keep more than 1 day of logs..

Any ideas?

0 Kudos
4 Replies
lamw
Community Manager
Community Manager

vilogger does not support any type of compression, it's too bad as you said you can easily fill up /var/log pretty quickly. There's no easy work around, you could create a new rule for logrotate, but the problem is the path to host needs to be updated each time/etc. Recommendation is to add a secondary disk that's much larger to support the huge amount of logs and redirect it to new disk OR setup syslog which provides the same exact capablities and setup compression that way.

0 Kudos
colinj
Contributor
Contributor

So does vilogger actually use logrotate to manage the logs it collects? Is there a logrotate.conf file that can be modified. I've checked and the /etc/logrotate.conf has no mention of /var/log/vmware so I'm guessing that if there is another config file it is elsewhere on the system.

While I'm asking, is it possible to have vilogger rotate based on dates and not on file size? It would be nice to be able to say that logs are kept for a specific amount of time and that a single log file contains a single days worth of data.

Thanks!

0 Kudos
lamw
Community Manager
Community Manager

You need to use vilogger utility itself when configuring the collection period, number of rotations and max file size


[vi-admin@tancredi ~]$ vilogger --help
Usage: vilogger <command>
command is one of:
        enable          [--server <SERVER>]
                        [--logname <LOGNAME>]
                        [--collectionperiod <PERIOD in seconds: 10 to 3600>]
                        [--numrotation <ROTATION: 1 to 1024>]
                        [--maxfilesize <SIZE in MB: 1 to 1024>]

        disable         [--server <SERVER>]
                        [--logname <LOGNAME>]
                        [--force]

        list            [--server <SERVER>]
                        [--logname <LOGNAME>]

        updatepolicy    [--server <SERVER>]
                        [--logname <LOGNAME>]
                        <logpolicy: at least one of the following must be specified>
                                [--collectionperiod <PERIOD in seconds: 10 to 3600>]
                                [--numrotation <ROTATION: 1 to 1024>]
                                [--maxfilesize <SIZE in MB: 1 to 1024>]

        help | --help | -h  [<command name>]

The changes are then stored in /etc/vmware/vMA/vMA.conf which should not be manually changed but using vilogger

0 Kudos
vhristev
Contributor
Contributor

Hello ,

I have same situation here I want to compress my log files but as i see only clean way is to configure RSYSLOG.

I try to setup logrotate for /var/log/vmware/HOST but with no luck.

Any ideas how to do it with vilogger and logrotate

0 Kudos