Enable SNMP Discovery on Distributed Pollers only?

I have the following configuration:

  • One LibreNMS Web Server
  • One Dedicated MariaDB, Redis, rrdcached server
  • 3 Distributed Pollers

Only the 3 DPs are in IP space that is allowed to query SNMP devices. I’m not sure if I’m misunderstanding the capabilities of LibreNMS, but what I would like is for the 3 pollers to do all the SNMP, Ping, etc monitoring and the Web server be only a web server.

It’s working fine if the devices are already discovered, but when I want to add a device, the web server tries to do the discovery process instead of dispatching the job to one of the pollers. Is this expected behavior?

Here is some info about my setup:
./validate.php

====================================
Component | Version
--------- | -------
LibreNMS  | 22.8.0
DB Schema | 2022_07_03_1947_add_app_data (244)
PHP       | 8.1.9
Python    | 3.9.2
Database  | MariaDB 10.5.15-MariaDB-0+deb11u1
RRDTool   | 1.7.2
SNMP      | 5.9
====================================

[OK]    Composer Version: 2.4.1
[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]    
[OK]    Database schema correct
[OK]    MySQl and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service is enabled
[OK]    Locks are functional
[OK]    Python wrapper cron entry is not present
[OK]    Redis is functional
[OK]    rrdtool version ok
[OK]    Connected to rrdcached

The next two commands have been run on Poller-3 (not the webend).

./discovery.php -h librenms-db-1.domain.net -d

LibreNMS Discovery
SQL[select `migration` from `migrations` order by `id` desc limit 1 [] 1.54ms] 
  
SQL[select count(*) as aggregate from `migrations` limit 1 [] 1.08ms] 
  
SQL[select version() [] 1.1ms] 
  
===================================
Version info:
Commit SHA: 6400f88752f8faa5321611f48b07cfa4dee16ce3
Commit Date: 1661442525
DB Schema: 2022_07_03_1947_add_app_data (244)
PHP: 8.1.9
Database: MariaDB 10.5.15-MariaDB-0+deb11u1
RRDTool: 1.7.2
SNMP: 5.9
==================================DEBUG!
Updating os_def.cache  
SQL[SELECT * FROM `devices` WHERE disabled = 0 AND `hostname` LIKE 'librenms-db-1.domain.net' AND poller_group IN(1) ORDER BY device_id DESC [] 1.71ms] 
  
./discovery.php librenms-db-1.domain.net 2022-08-26 08:06:03 - 0 devices discovered in 0.226 secs  

SNMP [0/0.00s]:   
SQL [5/0.07s]: Select[5/0.07s]  
InfluxDB [0/0.00s]:   
RRD [0/0.00s]:

./poller.php -h librenms-db-1.domain.net -r -f -d

LibreNMS Poller
SQL[select `migration` from `migrations` order by `id` desc limit 1 [] 1.01ms] 
  
SQL[select count(*) as aggregate from `migrations` limit 1 [] 0.84ms] 
  
SQL[select version() [] 1.02ms] 
  
===================================
Version info:
Commit SHA: 6400f88752f8faa5321611f48b07cfa4dee16ce3
Commit Date: 1661442525
DB Schema: 2022_07_03_1947_add_app_data (244)
PHP: 8.1.9
Database: MariaDB 10.5.15-MariaDB-0+deb11u1
RRDTool: 1.7.2
SNMP: 5.9
==================================DEBUG!
Updating os_def.cache  
Starting polling run:

SQL[SELECT * FROM `devices` WHERE `disabled` = 0 AND `hostname` = 'librenms-db-1.domain.net' ORDER BY `device_id` ASC [] 1.23ms] 
  
./poller.php librenms-db-1.domain.net 2022-08-26 08:08:54 - 0 devices polled in 0.228 secs  

SNMP [0/0.00s]:   
SQL [5/0.05s]: Select[5/0.05s]

Hi

my solution was to make poller groups and split devices in different poller groups, so every poller is responsible for it own devices (polling/discovering)

Unfortunately, that hasn’t worked for me so far. When I attempt to add a new device, I select the poller group that has the DPs in it, select Add, and I still see the discovery process spawn on the LibreNMS Web server (I’m watching via htop).

Ideally, I want to completely disable the discovery function on this server and leave it all up to the DPs

hi @skeels78

did you disable two discovery line and poller in cron on main (web) server ?

I did. This is what it looks like now:

#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
#*    *    * * *   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
*    *    * * *   librenms    cd /opt/librenms/ && php artisan schedule:run >> /dev/null 2>&1

# Daily maintenance script. DO NOT DISABLE!
# If you want to modify updates:
#  Switch to monthly stable release: https://docs.librenms.org/General/Releases/
#  Disable updates: https://docs.librenms.org/General/Updating/
15   0    * * *   librenms    /opt/librenms/daily.sh >> /dev/null 2>&1

uhhh, if i get it right, you are using LibreNMS service / systemd ?

i must admit, i have no experience with this scenario
only old school (upper half of cron file :slight_smile: ) discovery / polling

the fact is, that main server is in default_group which is zero
and i think there is some logic mismatch with zero group, so yes, my experience is same as yours, aka distributed polling/discovery is tricky to set up

but, as i wrote, i have a success with 4 different (non zero) poller, and on main WEB/SQL server, i have disabled ALL cron entry, only daily.sh is in game

sorry, but newer used systemd/service … so i am afraid i could not help you further

maybe, but … take this suggestion with reserve, maybe for test, you could try to change in DB:
table poller_group, and change ID for default poller group to something different, like 255, for test

On the DSs, yes, I’m using the service file. I enabled it also on the web server, but disabled it shortly after. Now that I think about it - I’ll go back, enable the service file on the web server, let the web server poller show up, then do as you suggested and place it in a different group that has nothing in it.

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