mirror of
https://github.com/librenms/docker.git
synced 2026-01-23 02:14:48 +00:00
Merge 6534c6b2b7 into f45cd5726f
This commit is contained in:
commit
5dca461cf1
3 changed files with 32 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ RUN apk --update --no-cache add \
|
|||
imagemagick \
|
||||
ipmitool \
|
||||
iputils \
|
||||
logrotate \
|
||||
libcap-utils \
|
||||
mariadb-client \
|
||||
monitoring-plugins \
|
||||
|
|
|
|||
12
README.md
12
README.md
|
|
@ -153,6 +153,18 @@ linux/s390x
|
|||
* `DISPATCHER_NODE_ID`: Unique node ID for your dispatcher service
|
||||
* `DISPATCHER_ARGS`: Additional args to pass to the [dispatcher service](https://github.com/librenms/librenms/blob/master/librenms-service.py)
|
||||
|
||||
### Logrotate
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> Logrotate could be enabled to avoid large log files.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
> When activated, logs exceeding the specified retention period will be deleted.
|
||||
|
||||
* `LOGROTATE_ENABLED`: Set to `true` to enable logrotate for LibreNMS logs (default `false`)
|
||||
|
||||
### Syslog-ng
|
||||
|
||||
> [!WARNING]
|
||||
|
|
|
|||
|
|
@ -257,3 +257,22 @@ for template in ${templates}; do
|
|||
echo " Adding ${template} alert template"
|
||||
ln -sf /data/alert-templates/${template} ${LIBRENMS_PATH}/resources/views/alerts/templates/${template}
|
||||
done
|
||||
|
||||
# Configure logrotate if enabled except for syslogng and snmptrapd sidecars
|
||||
if [ ${LOGROTATE_ENABLED:-false} = true ] && [ "$SIDECAR_SYSLOGNG" != "1" ] && [ "$SIDECAR_SNMPTRAPD" != "1" ];
|
||||
then
|
||||
cat <<'EOF' > /etc/logrotate.d/librenms
|
||||
${LIBRENMS_PATH}/logs/*.log {
|
||||
su librenms librenms
|
||||
create 664 librenms librenms
|
||||
weekly
|
||||
rotate 6
|
||||
compress
|
||||
delaycompress
|
||||
missingok
|
||||
notifempty
|
||||
copytruncate
|
||||
}
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue