Add rsyslog

This commit is contained in:
Alex D. 2021-06-25 18:25:42 +00:00
parent 5b971f954b
commit 06fce3eb9d
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
12 changed files with 119 additions and 0 deletions

61
config/rsyslog/APKBUILD Normal file
View File

@ -0,0 +1,61 @@
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
. ../APKBUILD-config.template
pkgver=2021.06.25.02
pkgrel=0
source="
rsyslogd.conf
"
_modules="
postfix
dovecot
rspamd
haproxy
nginx
grafana
postgresql
redis
"
# TODO
#
# INFLUXDATA: logger
# telegraf
# influxdb
#
# Others:
# fastd
for i in $_modules; do
subpackages="$subpackages $pkgname-$i:_defmodule"
source="$source modules/$i"
done
package() {
rx_install "rsyslogd.conf"
}
_defmodule() {
_modname="${subpkgname##$pkgname-}"
install_if="$pkgname redxen-config-$_modname"
_module "$_modname"
}
_module() {
MODNAME="$1"
_rx_installdir="$_rx_installdir/modules" rx_install "$1"
}
sha512sums="
6d768bec78b2c62e6c909f90ce7c29436a7f7a4cca39400fa109c1da89b1d0d096537a2ef119c8c94f608d29f3e21379280fe57f47ae2ebbfa17a47a935871b8 rsyslogd.conf
97cf61eaef40a397a106ccbf4000e4c22404a200dae3863619a39e0c4494e6fbd9e04986383aa6b8eae529f1782cb1bb890e07e9972fcb3dc9c2c680783d5091 postfix
7645eca9320e98c9c6d1504e683bff6f70c9eb722e270a01c2888d8e9ecfd6ce395b553f586db745ae5475842add8d49f9f0e8e33a9d41bc1b9c892737dbf24c dovecot
389e81e5e90af3329e83e10b215c5e7d6e8118f21a5c051560472c4d7809bd22f65615791a95f57e88df12dd3b2ddaa8221086c95a497888422b5679315bba55 rspamd
0390e0c42c55f6557dbdd1358e902b88072cc4451852584417cf38c902961d5de96a82d64a2ba298370827e51b95816798ac7940aeec4dfb1d929e4626af46c6 haproxy
195ec4edb77869fe9203a36e71e32c41821ba4bbf0ce8ffc92671813f66fd8f9b10bf269c05e8dfcaa419b00eef955d2b9f82d61376cf460366b893dd106240c nginx
506bb6badc1f53a59079311e5c2d2a0036dcc06101d31dcdfce954d7a328572f8398a087d67ea5c78d07ccf4f63b70d17f9f65298f6f44f8c5fe507bbb48f78c grafana
10a12c9adf9d212e885b8e1f1d0f0f20d1c932aaf6cfe3591d73345f4f8f470e0163324c3be197b53b850f72aa0bf72b55d1b83eb42cb6737a9914080754cfe7 postgresql
edf49b401f91e75a83ea4994ad020fa8343a68097e5c6d613f8da7e89521f6782d5698c9f5f69e03f2cfe15b961e7be02f3a80df8ad8466b51057b5828366ee0 redis
"

View File

@ -0,0 +1 @@
if $programname == 'dovecot' then /var/log/dovecot.log

View File

@ -0,0 +1 @@
if $programname == 'grafana' then /var/log/grafana.log

View File

@ -0,0 +1 @@
if $programname == 'haproxy' then /var/log/haproxy.log

View File

@ -0,0 +1,2 @@
if $programname == 'nginx' then /var/log/nginx.log

View File

@ -0,0 +1 @@
if $programname == 'postfix' then /var/log/postfix.log

View File

@ -0,0 +1 @@
if $programname == 'postgres' then /var/log/postgresql.log

View File

@ -0,0 +1 @@
if $programname == 'redis' then /var/log/redis.log

View File

@ -0,0 +1 @@
if $programname == 'rspamd' then /var/log/rspamd.log

View File

@ -0,0 +1,29 @@
$WorkDirectory /var/lib/rsyslog
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$AbortOnUncleanConfig on
#### Modules ####
# Provides --MARK-- message capability.
module(load="immark")
# Provides support for local system logging (e.g. via logger command).
module(load="imuxsock")
# Reads kernel messages.
module(load="imklog")
# Accepts messages via udp.
module(load="imudp")
input(type="imudp" port="514")
#### Rules ####
# Base
*.* /var/log/messages
kern.* /var/log/kern.log
*.emerg :omusrmsg:*
# Includes
include(file="/etc/redxen/rsyslog/modules/*" mode="optional")

19
openrc/rsyslog/APKBUILD Normal file
View File

@ -0,0 +1,19 @@
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
. ../APKBUILD-openrc.template
pkgver=2021.06.25.01
pkgrel=0
depends="$depends $_rx_pkgname-openrc"
source="conffile"
package() {
rx_openrc_runlevel_add
rx_openrc_runfile_link
rx_openrc_conffile_install
}
sha512sums="
763af55f0f35aa7e565301ceb0aed095efbc807cd21f582a7cc42c0f696b184ca489086aa8c27d8f63732716bd104996b24ce4b10fb49681a6bd05a76b9c314e conffile
"

1
openrc/rsyslog/conffile Normal file
View File

@ -0,0 +1 @@
cfgfile="/etc/redxen/rsyslog/rsyslogd.conf"