after i jumped to the 21.10.x release (I am using the montly releases only)
i noticed an issue in the 6 hours discovery process of my devices.
I am using the cron based polling and discovery (not the dispatcher service)
Right now I am on [21.10.0-38-gbc8efedc8 - Thu Oct 21 2021 06:20:57 GMT+0200]
but discovery is not working at the moment either
My devices showing:
The first one runs a full discovery scan every 6 hours using the threaded discovery-wrapper, the second runs a discovery of only new devices every 5 minutes using discovery.php.
What happens if you run discovery manually ?
For example using the threaded wrapper. First switch to the librenms user whatever that is:
sudo su - librenms
Then
/opt/librenms/discovery-wrapper.py 2
You should see something like:
2021-10-21 11:14:31,493 :: INFO :: starting the discovery check at 2021-10-21 11:14:31 with 2 threads for 340 devices
2021-10-21 11:15:18,583 :: INFO :: worker Thread-2 finished device 274 in 47 seconds
2021-10-21 11:15:22,069 :: INFO :: worker Thread-1 finished device 169 in 50 seconds
2021-10-21 11:16:11,770 :: INFO :: worker Thread-1 finished device 14 in 49 seconds
Or if you want more details you can use the single threaded discovery.php in “all” mode:
/opt/librenms/discovery.php -h all
This is slow but will give a very verbose output and hopefully pinpoint any errors you might be seeing.
Give it plenty of time to complete. Cronic is just a wrapper script that suppresses output unless there are errors, so it will appear to “hang” only because it doesn’t show any output. Cronic is there to reduce the number of emails sent by cron.
If you don’t have cron configured to send emails (or the emails go nowhere) you could just remove /opt/librenms/cronic from your cron line as it’s not necessary for it to work.
I have this MAILTO="" in my cron file.
A long time ago when i configured it. I guess it was needed to send emails or is it just
needed to send emails if cron has any problems?
By default cron will send an email for any script/command that has any output at all - good or bad. This can lead to a lot of annoying emails.
I don’t use cronic elsewhere but from looking at the script it appears to simply suppress output unless the wrapped script returns an error, then it passes it through so it can be emailed. That way only errors are emailed to you.
Another option is to simply redirect output to /dev/null, then you will never get an email from that script.
If you have MAILTO="" that probably suppresses all emails from cron, in that case just try removing /opt/librenms/cronic and run the discovery wrapper directly to see if that works.
Thanks for the infos.
It is real strange.
when i manually do:
/opt/librenms/cronic /opt/librenms/discovery-wrapper.py 16
I see in the log file: which is correct