LogrotateConfAll - Combiner for logrotate configuration¶
Combiner for accessing all the logrotate configuration files. It collects all LogrotateConf generated from each single logrotate configuration file.
There may be multiple logrotate configuration, and the main configuration file is
/etc/logrotate.conf
. Only the options defined in this file are global
options, and all other options (if there are) will be discarded.
- class insights.combiners.logrotate_conf.LogRotateConfTree(confs)[source]¶
Bases:
ConfigCombiner
Exposes logrotate configuration through the parsr query interface.
See the
insights.core.ConfigComponent
class for example usage.
- class insights.combiners.logrotate_conf.LogrotateConfAll(lrt_conf)[source]¶
Bases:
object
Class for combining all the logrotate configuration files.
Sample files:
# /etc/logrotate.conf: compress rotate 7 /var/log/messages { rotate 5 weekly postrotate /sbin/killall -HUP syslogd endscript } # /etc/logrotate.d/httpd "/var/log/httpd/access.log" /var/log/httpd/error.log { rotate 5 mail www@my.org size=100k sharedscripts postrotate /sbin/killall -HUP httpd endscript } # /etc/logrotate.d/newscrit /var/log/news/*.crit { monthly rotate 2 olddir /var/log/news/old missingok postrotate kill -HUP `cat /var/run/inn.pid` endscript nocompress }
Examples
>>> all_lrt.global_options ['compress', 'rotate'] >>> all_lrt['rotate'] '7' >>> '/var/log/httpd/access.log' in all_lrt.log_files True >>> all_lrt['/var/log/httpd/access.log']['rotate'] '5' >>> all_lrt.configfile_of_logfile('/var/log/news/olds.crit') '/etc/logrotate.d/newscrit' >>> all_lrt.options_of_logfile('/var/log/httpd/access.log')['mail'] 'www@my.org'
- data¶
All parsed options and log files are stored in this dictionary
- Type:
dict
- global_options¶
List of global options defined in
/etc/logrotate.conf
- Type:
list
- log_files¶
List of log files in all logrotate configuration files
- Type:
list