Daily.sh Failing on New Install

Good afternoon everyone!

I have a fresh install of LibreNMS on Debian 12. I migrated the data from my previous install and everything appeared to be working fine yesterday. Today, however, I was experiencing some difficulties with weathermapper (not related to this problem). As part of troubleshooting that I ran validate.php, which led to the following output:

===========================================

Component Version
LibreNMS 24.1.0-39-gf9fc80966 (2024-01-17T21:58:08+00:00)
DB Schema 2023_12_12_171400_alert_rule_note (277)
PHP 8.2.7
Python 3.11.2
Database MariaDB 10.11.4-MariaDB-1~deb12u1
RRDTool 1.7.2
SNMP 5.9.3
===========================================

[OK] Composer Version: 2.6.6
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok
[WARN] Your install is over 24 hours out of date, last update: Wed, 17 Jan 2024 21:58:08 +0000
[FIX]:
Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.

My cron.d/librenms is as follows:
@daily * * * * librenms /opt/librenms/daily.sh >> /dev/null 2>&1

When I try to manually run daily.sh, I get the following error:

./daily.sh: 34: source: not found
./daily.sh: 52: Syntax error: “(” unexpected (expecting “}”)

I am running both the validate.php and daily.sh as librenms user.

Any help is appreciated.

What is the configured shell for user LibreNMS? It needs to be /bin/bash. It’s probably something else now (I’m guessing /bin/sh)

Try:
sudo usermod -s /bin/bash librenms

After that logout before trying again.

root@nuc:/# su librenms --shell=/bin/sh
$ source ~/.env
sh: 1: source: not found
$
root@nuc:/# su librenms --shell=/bin/bash
librenms@nuc:/$ source ~/.env
librenms@nuc:/$

Tozz,

I have performed the recommended task and even replicated what you did with verifying that it went to a blank line when you typed in source ~/.env. However, I am still getting the error running daily.sh.

librenms@LibreNMS:~$ librenms@LibreNMS:~$ source ~/.env
librenms@LibreNMS:~$
librenms@LibreNMS:~$ sh ./daily.sh
./daily.sh: 34: source: not found
./daily.sh: 52: Syntax error: “(” unexpected (expecting “}”)
librenms@LibreNMS:~$

Tozz,

I finally got it work. For some reason I was getting a non-printed error that /root/.bashrc access was denied. I had to add the user to the sudoers list and execute the daily.sh with the command su librenms -c “/opt/librenms/daily.sh” in order to get it to work manually. I have updated my cron task accordingly and we will see if it works tonight at midnight.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.