From 611010bba89b02677cda3e06fb23dfed15ebbb38 Mon Sep 17 00:00:00 2001 From: do Date: Sun, 19 Apr 2020 21:51:43 +0200 Subject: [PATCH] rsyslog for arms --- base/init.sls | 7 ++-- base/log/rsyslog/client.sls | 68 +++++++++++++++++++++---------------- grafana.sls | 1 + haproxy.sls | 4 +-- top.sls | 8 ++--- 5 files changed, 49 insertions(+), 39 deletions(-) diff --git a/base/init.sls b/base/init.sls index 614919a..dd0e0e2 100644 --- a/base/init.sls +++ b/base/init.sls @@ -2,7 +2,6 @@ # vim: ft=yaml --- -include: - - log.rsyslog.client - - sys.sysctl - - kubernetes +#include: +# - .log.rsyslog.client +# - .sys.sysctl diff --git a/base/log/rsyslog/client.sls b/base/log/rsyslog/client.sls index a29bd25..f803037 100644 --- a/base/log/rsyslog/client.sls +++ b/base/log/rsyslog/client.sls @@ -3,35 +3,45 @@ --- rsyslog: - target: 192.168.10.2 # omit if you do not want to forward logs - # NOTE: be careful using target and listen on - # the same server, you can cause a loop - #targets: # If you want to use more than one target, - # - log1.example.com # you can specify targets as a list. - # - log2.example.com # The single 'target' directive takes precendence over this however. - - protocol: udp # protocol to use to send to target - listentcp: false # omit to disable listening on tcp port - listentcpprt: 10514 # specify tcp listen port ($InputTCPServerRun) - listenudp: false # omit to disable listening on udp port - impstats: false # impstats set to true to enable impstats - impstatsinterval: 600 # impstats interval to gather stats - impstatsseverity: 6 # The numerical syslog severity code to be used for generated messages. Default is 6(info) - impstatsresetcounters: 'on' # When set to “on”, counters are automatically reset after they are emitted - impstatslogsyslog: 'on' # This is a boolean setting specifying if data should be sent to the usual syslog stream - impstatsformat: legacy # Impstats format. Legacy is default but other options can be used. - impstatssyslogrule: 'syslog.=debug /var/log/rsyslog-stats' # Impstats log rule. - imkllog: true # omit to log kernel messages - imjournal: false # omit to log journal messages - immark: false # enable/disable mark messages support - markmessageperiod: 1200 # Specifies when mark messages are written (seconds) - #logbasepath: /mnt/logs # base path for logs to be saved to - # also enables logging per host, per day - fileowner: root # set the owner of the logfiles - filegroup: adm # set the group of the logfiles - filemode: '0640' # mode for created log files - dirmode: '0755' # mode for dirs created in log file paths - template: 'RSYSLOG_FileFormat' # file default template + client: + enabled: true + run_user: root + run_group: adm + output: + remote: + log.chaos: + action: '@log.chaos' + filter: "*.*" + enabled: true + # target: 192.168.10.2 # omit if you do not want to forward logs + # # NOTE: be careful using target and listen on + # # the same server, you can cause a loop + # #targets: # If you want to use more than one target, + # # - log1.example.com # you can specify targets as a list. + # # - log2.example.com # The single 'target' directive takes precendence over this however. + # + # protocol: udp # protocol to use to send to target + # listentcp: false # omit to disable listening on tcp port + # listentcpprt: 10514 # specify tcp listen port ($InputTCPServerRun) + # listenudp: false # omit to disable listening on udp port + # impstats: false # impstats set to true to enable impstats + # impstatsinterval: 600 # impstats interval to gather stats + # impstatsseverity: 6 # The numerical syslog severity code to be used for generated messages. Default is 6(info) + # impstatsresetcounters: 'on' # When set to “on”, counters are automatically reset after they are emitted + # impstatslogsyslog: 'on' # This is a boolean setting specifying if data should be sent to the usual syslog stream + # impstatsformat: legacy # Impstats format. Legacy is default but other options can be used. + # impstatssyslogrule: 'syslog.=debug /var/log/rsyslog-stats' # Impstats log rule. + # imkllog: true # omit to log kernel messages + # imjournal: false # omit to log journal messages + # immark: false # enable/disable mark messages support + # markmessageperiod: 1200 # Specifies when mark messages are written (seconds) + # #logbasepath: /mnt/logs # base path for logs to be saved to + # # also enables logging per host, per day + # fileowner: root # set the owner of the logfiles + # filegroup: adm # set the group of the logfiles + # filemode: '0640' # mode for created log files + # dirmode: '0755' # mode for dirs created in log file paths + # template: 'RSYSLOG_FileFormat' # file default template #custom: # Put custom config files in /etc/rsyslog.d/. # - 001_custom1.conf # Files must be reachable from path `salt://rsyslog/` diff --git a/grafana.sls b/grafana.sls index 42b5753..c07334e 100644 --- a/grafana.sls +++ b/grafana.sls @@ -36,4 +36,5 @@ grafana: org_role: Viewer log: level: error + mode: syslog diff --git a/haproxy.sls b/haproxy.sls index 15fb518..d668d2d 100644 --- a/haproxy.sls +++ b/haproxy.sls @@ -88,7 +88,7 @@ haproxy: check: check server3: name: pine03 - host: 192.168.10.19 + host: 192.168.10.162 port: 7480 check: check backend2: @@ -107,7 +107,7 @@ haproxy: check: check #server3: # name: pine03 - # host: 192.168.10.19 + # host: 192.168.10.162 # port: 8080 # check: check backend3: diff --git a/top.sls b/top.sls index 3749387..82a7698 100644 --- a/top.sls +++ b/top.sls @@ -13,11 +13,11 @@ base: - grafana - prometheus.prometheus - base.log.rsyslog.client - 'osarch:arm64 or osarch:armel': - - match: grain + 'G@osarch:arm64 or G@osarch:armel': + - match: compound - base.log.rsyslog.client - 'osarch:armhf and not fqdn:tumor.chaos': - - match: grain + 'G@osarch:armhf and not G@fqdn:tumor.chaos': + - match: compound - base.log.rsyslog.client #'pine03*':