Cron Daemon - poller-wrapper.py - /bin/sh: 1: librenms: not found

I am getting a whole lot of these in mail for the librenms account anyone have a helpful pointer to clear it up? I am sure it is something simple I screwed up. :slight_smile:

Return-Path: [email protected]
X-Original-To: librenms
Delivered-To: [email protected]
Received: by Libre.myco.local (Postfix, from userid 999)
id 13AE71C1334; Thu, 7 Mar 2019 11:35:01 -0500 (EST)
From: [email protected] (Cron Daemon)
To: [email protected]
Subject: Cron librenms@Libre librenms /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/opt/librenms>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=librenms>
Message-Id: [email protected]
Date: Thu, 7 Mar 2019 11:35:01 -0500 (EST)

/bin/sh: 1: librenms: not found

crontab is currently:

33   */6  * * *   librenms    /opt/librenms/cronic /opt/librenms/discovery-wrapper.py 1
*/5  *    * * *   librenms    /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16
15   0    * * *   librenms    /opt/librenms/daily.sh >> /dev/null 2>&1
*    *    * * *   librenms    /opt/librenms/alerts.php >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/poll-billing.php >> /dev/null 2>&1
01   *    * * *   librenms    /opt/librenms/billing-calculate.php >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/check-services.php >> /dev/null 2>&1

What happens when you run /opt/librenms/poller-wrapper.py by hand as the librenms user?

Looks like normal results when run by hand:

$ /opt/librenms/poller-wrapper.py
INFO: starting the poller at 2019-03-07 13:03:17 with 16 threads, slowest devices first
INFO: worker Thread-16 finished device 5 in 8 seconds

INFO: worker Thread-1 finished device 117 in 46 seconds
INFO: poller-wrapper polled 104 devices in 46 seconds with 16 workers

Other than e-mail for librenms filling up - all other things seem to be working fine.

What Linux distro?

You may want to remove the librenms part of your cron lines.

Ubuntu 18.04

$ uname -a
Linux LIBRE 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I will try that -

I only have familiarity with Centos so it may be necessary in Ubuntu

So the default nonroot cron setup defines the cronjobs to specifically run as librenms… but I was able to stop the e-mail by telling cron not to report on the job via e-mail.

>> /dev/null 2>&1

So the line in cron becomes:

`

*/5 * * * * librenms /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16 >> /dev/null 2>&1

Thanks for the help!!
`

1 Like