Cron-Pollers

Guys

In my cron file, I can see these three cron jobs
Please advise why should I use two times discovery? one time as discovery-wrapper.py
and other time as discovery.php, should I disable 1? or disable both?
As I have item number 3 which runs every minute

33 */6 * * * librenms /opt/librenms/discovery-wrapper.py 25 >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/1 * * * * librenms /opt/librenms/cronic /opt/librenms/poller-wrapper.py 25

What will be the best practice for these cron timers if I’ve 500 Devices

You are using way too many threads for the discovery-wrapper.py that could cause the system to crash. Discovery. I would only use two threads for discovery-wrapper.py. Discovery is meant to run in the background and take its time.

Also reason, why you have two discovery in librenmscron, is because, discovery-wrapper.py is used to go out every 6 hours and discovery your devices and discovery.php -h new is used only when you add a new device.

Looks like you have 1-minute polling I would change that back to 5-minute polling if you have 500 devices.

Here is what my discovery and poller librenms cron look like and I have 600+ devices.

33 */6    * * *   librenms    /opt/librenms/discovery-wrapper.py 2 >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5  *    * * *   librenms    /opt/librenms/cronic /opt/librenms/poller-wrapper.py 23

discovery-wrapper.py polls more SNMP info then poller-wrapper.py?

Those are two diffrent things.

discovery-wrapper.py = runs in the background and tries to added devices it also runs discovery on your devices in librenms every 6 hours.

and

poller-wrapper.py = pulls all the data on your devices in librenms.

I changed discovery-wrapper.py to 2 threads
but left poller-wrapper.py to run every two minute
as I’ve delay set to 3 minute, in this case if something happens alert will be triggered in 5 minutes which is also too much time, but at least it will eliminate false positive alerts as cron will run 2 times before alert will be triggered

How is your polling time with 600 devices trying to polled with in 2 minutes?

Right now I’ve 400 hundreds devices and I’m running 50 threads , thinking to increase it to 100 , I’ve allocated 16vcpu with 128G RAM Server

I gotcha thats really good spec.

I was talking about your poller time in the Web UI under settings → Poller → Pollers

image

at this stage, with 50 threads puller time takes 1 minute 30 seconds to pull info from all devices

1 Like

In following this thread, I just made the following changes to my system -

from -

33 */6 * * * librenms /opt/librenms/discovery.php -h all >> /dev/null 2>&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/check-services.php >> /dev/null 2>&1

to:

33 */6 * * * librenms /opt/librenms/discovery.php -h all >> /dev/null 2>&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/check-services.php >> /dev/null 2>&1

new 1/4/18

33 */6 * * * librenms /opt/librenms/discovery-wrapper.py 2 >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/cronic /opt/librenms/poller-wrapper.py 23

Does this jive with you?

-Mike

Mike that looks good.

1 Like

Thanks Kevin.

-Mike

1 Like