Hi all
It seems that my installs (9 servers in total) do not want to update, as they get internet service through a proxy. I have put the http_- and https_proxy directives in /etc/environment as per documentation, and have even added EnvironmentFile=/etc/environment directive to /etc/systemd/system/librenms.service, but the daily updates still fail, and I keep on getting big red error messages about it in the web ui.
Any ideas?
Thanks in advance!
Bad info disregard
Do you still have daily.sh running in your cron? If you used an older version of LibreNMS to create your librenms cron file the directions for switching to the dispatcher service can be a bit confusing because it doesn’t have the comments that the new file has.
See: https://github.com/librenms/librenms/blob/master/librenms.nonroot.cron
If that’s not it, and assuming your cron jobs are running nonroot and update as the librenms user, you might try adding:
export http_proxy=http://user:password@proxy/
export https_proxy=http://user:password@proxy/
To your librenms user’s ~/.bash_profile and ~/.bashrc files.
No I don’t have those crons running anymore. As per install guide, I moved the cron files out of there into another directory. The install was done about 2 weeks ago, so not sure what your definition of “old” is?
But all cron entries have been disabled, so solely relying on the service.
You’re right, it looks like all cron task should be removed. The line in the current file…
# Daily maintenance script. DO NOT DISABLE!
…led me to believe the dispatcher still needed the daily cron task to present.
But anyway, I still think loading the environmental variables in profiles is the better way to go. Both because you can test running the daily script manually as the librenms user and expect the same result. But also because as I understand it, the EnvironmentFile systemd option has some quirks when you’re calling unit files that execute other environments. Meaning your http(s)_proxy vars should be present when librenms.service calls librenms-service.py but may no longer be present when librenms-service.py calls daily.sh.
I haven’t tried this, but adding PassEnvironment might help?
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#PassEnvironment=