Skip to content

Commit

Permalink
Install a newsyslog config file to rotate Librenms logs.
Browse files Browse the repository at this point in the history
PR:		255427
Reported by:	James French <james@french.id.au>
  • Loading branch information
dlangille committed Apr 28, 2021
1 parent 5c48802 commit 76bc66d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net-mgmt/librenms/Makefile
Expand Up @@ -2,6 +2,7 @@

PORTNAME= librenms
PORTVERSION= 21.4.0
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= LOCAL/dvl:vendor
Expand Down Expand Up @@ -194,4 +195,9 @@ post-install:
@${ECHO_CMD} "@dir(root,www,0775) ${WWWDIR}/${f}" >> ${TMPPLIST}
.endfor

@${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d
${INSTALL_DATA} ${FILESDIR}/newsyslog.conf.sample ${STAGEDIR}/${WWWDIR}/contrib/newsyslog.conf.sample
@${ECHO_CMD} "@dir etc/newsyslog.conf.d" >> ${TMPPLIST}
@${ECHO_CMD} "@sample ${WWWDIR}/contrib/newsyslog.conf.sample etc/newsyslog.conf.d/librenms.conf" >> ${TMPPLIST}

.include <bsd.port.mk>
7 changes: 7 additions & 0 deletions net-mgmt/librenms/files/newsyslog.conf.sample
@@ -0,0 +1,7 @@
# configuration file for newsyslog for librenms
#
# see newsyslog.conf(5) for details
#
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/var/log/librenms/librenms.log www:www 644 7 * $D0 J /var/run/librenms/librenms.pid
/var/log/librenms/librenms-service.log www:www 644 7 * $D0 J /var/run/librenms/librenms.pid
7 changes: 7 additions & 0 deletions net-mgmt/librenms/files/pkg-message.in
Expand Up @@ -11,6 +11,8 @@ with the following notes:
NOTE: setting sql-mode="" is no longer required. You can remove
it from /usr/local/etc/mysql/my.cnf

However, 'lower_case_table_names=0' is required.

HEADS UP

Polling via cron job has been removed.. Please use the Dispatcher.
Expand All @@ -28,6 +30,11 @@ The service will log to /var/log/librems/librenms-service.log

see also https://docs.librenms.org/Extensions/Dispatcher-Service/

For log file rotation

* sample file installed to %%WWWDIR%%/contrib/newsyslog.conf.sample
* actual file installed, never overwriting, to %%PREFIX%%/etc/newsyslog.conf.d/librenms.conf

When converting from PYPOLLER to the Dispatcher Service (PYSERVICE),
these steps will help you get started:

Expand Down

0 comments on commit 76bc66d

Please sign in to comment.