Add syslog-ng. Update telegraf

This commit is contained in:
2022-02-20 12:07:56 +01:00
parent a3216e225b
commit ba3b87e73b
14 changed files with 198 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: syslog-ng
# Configures syslog-ng
# ==============================================================================
declare hostname
bashio::require.unprotected
readonly CONFIG="/etc/syslog-ng/syslog-ng.conf"
CUSTOM_CONF=$(bashio::config 'custom_conf.location')
bashio::log.info "Using custom conf file"
rm /etc/syslog-ng/syslog-ng.conf
cp "${CUSTOM_CONF}" /etc/syslog-ng/syslog-ng.conf
bashio::log.info "Finished updating config"

View File

@@ -0,0 +1 @@
/etc/syslog-ng/syslog-ng.conf false root 0755 0755

View File

@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: syslog-ng
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services

View File

@@ -0,0 +1,10 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Example
# Runs example1 script
# ==============================================================================
bashio::log.info "Starting syslog-ng"
exec /usr/sbin/syslog-ng -F

View File

@@ -0,0 +1,36 @@
@version: 3.29
options {
use_dns(no);
create_dirs(yes);
ts_format(iso);
};
source s_systemd {
system();
internal();
};
source s_homeassistant {
file("/var/log/home-assistant.log" program-override("homeassistant"));
};
destination d_remotesyslog {
syslog("192.168.100.254" transport("udp") port("1514"));
};
rewrite r_host {
set("homeassistant", value("HOST"));
};
log {
source(s_systemd);
rewrite(r_host);
destination(d_remotesyslog);
};
log {
source(s_homeassistant);
rewrite(r_host);
destination(d_remotesyslog);
};