1
0
Fork 0
mirror of https://github.com/librenms/docker.git synced 2026-01-23 02:14:48 +00:00
This commit is contained in:
Charly Forot 2026-01-22 13:45:25 -06:00 committed by GitHub
commit 5dca461cf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 0 deletions

View file

@ -24,6 +24,7 @@ RUN apk --update --no-cache add \
imagemagick \
ipmitool \
iputils \
logrotate \
libcap-utils \
mariadb-client \
monitoring-plugins \

View file

@ -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]

View file

@ -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