add bundle:rsyslogd
This commit is contained in:
parent
36dac3be7c
commit
39576fda38
6 changed files with 89 additions and 3 deletions
10
bundles/rsyslogd/files/logrotate.conf
Normal file
10
bundles/rsyslogd/files/logrotate.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
/var/log/rsyslog/*/*.log
|
||||
{
|
||||
rotate 4
|
||||
daily
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
18
bundles/rsyslogd/files/rsyslog.conf
Normal file
18
bundles/rsyslogd/files/rsyslog.conf
Normal file
|
@ -0,0 +1,18 @@
|
|||
# provides UDP syslog reception
|
||||
module(load="imudp")
|
||||
input(type="imudp" port="514")
|
||||
|
||||
# provides TCP syslog reception
|
||||
module(load="imtcp")
|
||||
input(type="imtcp" port="514")
|
||||
|
||||
$FileOwner root
|
||||
$FileGroup adm
|
||||
$FileCreateMode 0640
|
||||
$DirCreateMode 0755
|
||||
$Umask 0022
|
||||
|
||||
$WorkDirectory /var/spool/rsyslog
|
||||
|
||||
$template remote-incoming-logs,"/var/log/rsyslog/%HOSTNAME%/%PROGRAMNAME%.log"
|
||||
*.* ?remote-incoming-logs
|
18
bundles/rsyslogd/items.py
Normal file
18
bundles/rsyslogd/items.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
files['/etc/logrotate.d/rsyslog'] = {
|
||||
'source': 'logrotate.conf',
|
||||
}
|
||||
|
||||
files['/etc/rsyslog.conf'] = {
|
||||
'triggers': {
|
||||
'svc_systemd:rsyslog:restart',
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd['rsyslog'] = {
|
||||
'needs': {
|
||||
'pkg_apt:rsyslog',
|
||||
},
|
||||
'after': {
|
||||
'file:/etc/rsyslog.conf',
|
||||
},
|
||||
}
|
32
bundles/rsyslogd/metadata.py
Normal file
32
bundles/rsyslogd/metadata.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
from bundlewrap.metadata import atomic
|
||||
|
||||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'rsyslog': {},
|
||||
},
|
||||
},
|
||||
'icinga2_api': {
|
||||
'rsyslog': {
|
||||
'services': {
|
||||
'RSYSLOGD PROCESS': {
|
||||
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_systemd_unit rsyslog',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'firewall/port_rules',
|
||||
)
|
||||
def firewall(metadata):
|
||||
return {
|
||||
'firewall': {
|
||||
'port_rules': {
|
||||
'514': atomic(metadata.get('rsyslogd/restrict-to', set())),
|
||||
'514/udp': atomic(metadata.get('rsyslogd/restrict-to', set())),
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue