Package Details: librenms 1.67-1

Git Clone URL: https://aur.archlinux.org/librenms.git (read-only, click to copy)
Package Base: librenms
Description: Autodiscovering PHP/MySQL/SNMP based network monitoring
Upstream URL: https://www.librenms.org/
Licenses: GPL3
Submitter: freaknils
Maintainer: dvzrv
Last Packager: dvzrv
Votes: 4
Popularity: 0.000031
First Submitted: 2015-12-14 12:03
Last Updated: 2020-09-05 09:34

Pinned Comments

dvzrv commented on 2019-02-28 19:35

I've now updated to 1.48.1. Please note: This fundamentally changes everything about how this package was built/installed before! It now thrives to be as FHS compliant as possible and only state files, log files and caches (and of course configs) are writable by the librenms user.

This also changes to a user/group setup of librenms/librenms instead of librenms/http, as the latter is unsafe (it can access all other web applications' data!).

Make sure to test this setup before just switching to it. Make backups!

Known problems are:

  • librenms.service has issues reading something from the .env configuration (it can read it, but fails parsing it, somehow). If you can debug it, please do. I couldn't get it to work properly...

  • the cron jobs are currently untested, as I only have systemd timers (those could be added within this repository).

  • There is a bug with the laravel vendor stuff, not supporting php 7.3*, so you will see error pages from time to time (a page refresh worked for me every time though...). Librenms upstream needs to fix this...

  • I've only tested this with nginx + uwsgi and plan to also add an example file for uwsgi

Last but not least: If you want co-maintainership of this package, please let me know. Be warned: It's not pretty. Only attempt if you have a high tolerance towards php/python pain.

Latest Comments

« First ‹ Previous 1 2 3 Next › Last »

dvzrv commented on 2018-03-10 01:18

@Anthony25:

ln -sf /var/log/${pkgname} logs

should be in package() (not install(), sorry):

ln -sf "/var/log/${pkgname}" "${pkgdir}/usr/share/webapps/${pkgname}/logs"

Plus, you can add yourself as maintainer! ;-)

Anthony25 commented on 2018-03-09 23:29

@dvzrv: Thanks for the review.

I tried to fix it as much as I could. I just don't see what you mean by Do that in install() and use ${pkgdir}!.

dvzrv commented on 2018-03-05 11:53

@Anthony25: You're welcome. That's what I'm here for ;-) Sometimes it's easier to just start from scratch.

However, there are still some things to fix:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n8

Should be GPL3 (pacman -Ql licenses).

You can switch to https for url.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n11

source has to be unique ("${pkgname}-${pkgver}.tar.gz::<https://github.com/>${pkgname}/${pkgname}/archive/${pkgver}.tar.gz")

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n33

Do that in install() and use ${pkgdir}!

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n37

You can just install them in one go: install -d "$pkgdir"/{etc/{webapps/$pkgname,logrotate.d},usr/share/webapps/$pkgname,var/log/$pkgname} and fix the permissions using tmpfiles.d. Also, 775 is probably too permissive for the logs of such an application.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n42

All PKGBUILD functions are in ${srcdir} initially. No need to use it again. Still, cd should be the first thing to do, unless you have weird sources.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n45

If you are symlinking this file later on anyways, but it's just the default (an example file, I suppose?), why not just leave it there, or is the user supposed to modify this file? Also, use install -Dm644 instead of cp.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n56

A cleaner way would be to install this as a separate file.

P.S.: You got tab-poisening ;-)

https://aur.archlinux.org/cgit/aur.git/tree/librenms.sysusers?h=librenms#n3

I think it's not a good choice to set /usr/share/webapps/librenms as the user's $HOME. Leaving it empty is a better choice. https://www.freedesktop.org/software/systemd/man/sysusers.d.html#Home%20Directory

https://aur.archlinux.org/cgit/aur.git/tree/librenms.tmpfile?h=librenms#n2

Is that really needed? Does the application or the webserver need to modify files on your filesystem, apart from the logs? If not, don't use this!

Sorry for the many edits of this post. The new Markdown support still bugs me ;-)

Anthony25 commented on 2018-03-05 00:06

@dvzrv: thanks a lot for your review.

For my defense, all comments you've made were about something I've not written, but it is not an excuse as I did not change them.

I began to fix a lot of the issues your pointed, only the pear packages are still badly installed at the pkg installation. When I will find some time to create the 2 AUR packages needed for those, I will be able to add them as dependencies and remove the usage of pear. However, if anyone has some free time to create those packages, tell me and I will handle the changes on the librenms side as soon as possible.

dvzrv commented on 2018-03-04 17:31

"I changed the versioning system, so please force the package installation to upgrade."

@Anthony25: That's where you usually introduce an epoch: https://wiki.archlinux.org/index.php/PKGBUILD#epoch

Please re-read the Arch packaging standards: https://wiki.archlinux.org/index.php/Arch_packaging_standards

dvzrv commented on 2018-03-04 17:27

@Anthony25: Please use sysusers.d (man sysusers.d) and tmpfiles.d (man tmpfiles.d) to setup the dedicated user and set file permissions. The install file is not needed at all.

Also, please, never do something like this: https://aur.archlinux.org/cgit/aur.git/tree/librenms.install?h=librenms#n11 You thereby introduce files to the filesystem, that are not owned by any package! This is bad! If those packages are dependencies to this package, you have to provide them!

If you have to do modifications to the source before you use install(), put those actions to prepare() (e.g. the use of sed). Sometimes (depending on the project really) one will have to make sure, that files are 0644 and folders are 0755.

If you symlink, copy, move or install during install(), you have to use $pkgdir as destination! Please fix this!

Anthony25 commented on 2018-02-18 15:26

I updated the package. It now copies the logrotate config file in /etc/logrotate.d and correctly symlinks the logs dir to /var/logs/librenms.

I quickly tested it, but please report any bug you might find.

Anthony25 commented on 2018-02-11 01:32

@TheAmigo: thanks a lot, I will update the package as soon as I can.

FYI, I don't use it anymore, I moved to kubernetes for a lot of self-hosting tools. I will continue to maintain it, but I think it would be better to be maintained by someone also using it. If someone would like to be the new maintainer, contact me.

TheAmigo commented on 2018-02-11 01:25

It looks like the logs are pointed at /var/log/librenms (seems decent), but the link in /usr/share/webapps/librenms/logs is broken.

Also, the logrotate snippet (/usr/share/webapps/librenms/misc/librenms.logrotate) should be updated to point to the actual log directory, or even better, copied directly into /etc/logrotate.d/

Anthony25 commented on 2018-01-21 06:33

@nguillaumin: Thanks, I updated the package.