How do I test if memched is configured correctly between my poller server and "master server" in distributed polling setup

When asking for help and support, please provide as much information as possible. This should include:

  • Steps to reproduce an issue.
  • The output of ./validate.php

If it’s an issue with the WebUI then please consider including the browser version you are using.

If you need to post any text longer than a few lines, please use a pastebin service such as https://p.libren.ms using non-expiring pastes.

How do I test if memched is configured correctly between my poller server and “master server” in distributed polling setup?

My poller is polling the exact amount of devices that my “Master server” server is polling. From what I haves read it sounds like the 2 servers cant speak to each other via the memcached.

./validate.php -g distributedpoller

Will give it a try and let you know, Thanks

I ran command on Master server

@majesticnms:/opt/librenms# ./validate.php -g distributedpoller

Component Version
LibreNMS 1.38-30-g7e4bae2
DB Schema 247
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.6.3
[OK] Dependencies up-to-date.
Checking distributedpoller: OK
[OK] Connection to memcached is ok
root@majesticnms:/opt/librenms# ./validate.php

Component Version
LibreNMS 1.38-30-g7e4bae2
DB Schema 247
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.6.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
root@majesticnms:/opt/librenms#

and on the Poller

[OK] Composer Version: 1.6.3
[OK] Dependencies up-to-date.
Checking distributedpoller: OK
[OK] Connection to memcached is ok

./validate.php

Component Version
LibreNMS 1.38-30-g7e4bae2
DB Schema 247
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.6.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
root@majesticnmsp1:/opt/librenms#

Im still seeing both servers polling bot devices

Anything I can check

You are running a single central memcached install aren’t you?

Hi

I have 2 VMS

1st VM - 192.168.0.11
This is server does everything, WebGui, DB, Alerts, discovery.

This is config of config.php

Database config

$config[‘db_host’] = ‘localhost’;
$config[‘db_port’] = ‘3306’;
$config[‘db_user’] = ‘librenms’;
$config[‘db_pass’] = ‘xxxxxxxx’;
$config[‘db_name’] = ‘librenms’;
$config[‘db_socket’] = ‘’;

$config[‘rrdcached’] = “unix:/var/run/rrdcached.sock”;
$config[‘rrdtool_version’] = 1.5;

Memcached

$config[‘memcached’][‘enable’] = true;
$config[‘distributed_poller_memcached_host’] = ‘localhost’;
$config[‘distributed_poller_memcached_port’] = ‘11211’;

Distributed poller

$config[‘distributed_poller’] = true;

2nd VM - 192.168.0.12
This server is only supposed to poll devices

This is config for config.php

Database config

$config[‘db_host’] = ‘192.168.0.11’;
$config[‘db_port’] = ‘3306’;
$config[‘db_user’] = ‘librenms’;
$config[‘db_pass’] = ‘xxxxxxxxx’;
$config[‘db_name’] = ‘librenms’;
$config[‘db_socket’] = ‘’;

$config[‘rrdcached’] = “192.168.0.11:42217”;
$config[‘rrdtool_version’] = ‘1.5.5’;

Memcached

$config[‘memcached’][‘enable’] = true;

Distributed poller

$config[‘distributed_poller’] = true;
$config[‘distributed_poller_name’] = file_get_contents(’/etc/hostname’);
$config[‘distributed_poller_group’] = ‘0’;
$config[‘distributed_poller_memcached_host’] = “192.168.0.11”;
$config[‘distributed_poller_memcached_port’] = 11211;
$config[‘rrdcached’] = “192.168.0.11:42217”;

I would like to setup a 3rd and 4th VM as pollers later on.

I have installed memcached on both VMS by following the steps below:

apt-get install memcached
apt-get install php-memcached
systemctl restart apache2

Below is the config on the 1st VM for Memcached

memcached default config file

-d
logfile /var/log/memcached.log
-m 64
-p 11211
-u memcache
-l 192.168.0.11

Below is the config on the 2nd VM for Memcached
-d
logfile /var/log/memcached.log
-m 64
-p 11211
-u memcache
-l 127.0.0.1

Let me know if you require any other configuration information.

I’m confused by your config - it seems to indicate you use one memcached install but you say you’ve installed it on both servers.

You must use only ONE memcached server and point all pollers to it. This is the only thing explaining why you have both pollers duplicating the work.

Okay so do i only need install the following on one VM server 192.168.0.11

apt-get install memcached
apt-get install php-memcached
systemctl restart apache2

If so then I should only need to remove memcached on the VM2 ?

You don’t need php-memcached either as we no longer use it. You need the python version but yes, memcached server only on ONE install. Then point your config.php options to use that one memcached instance.

Did a clean install of Lirbenms for the poller, did not install memcache or PHP-Cache

root@majesticnmsp2:/opt/librenms# ./validate.php

Component Version
LibreNMS 1.38-37-ge74af0a
DB Schema 247
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.6.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[FAIL] Missing PHP extension: memcached
[FIX] Please install memcached

This is config.php of the new poller:

Database config

$config[‘db_host’] = ‘192.168.0.11’;
$config[‘db_port’] = ‘3306’;
$config[‘db_user’] = ‘librenms’;
$config[‘db_pass’] = ‘xxxxxxxx’;
$config[‘db_name’] = ‘librenms’;
$config[‘db_socket’] = ‘’;

Distributed poller

$config[‘distributed_poller’] = true;
$config[‘distributed_poller_name’] = file_get_contents(‘/etc/hostname’);
$config[‘distributed_poller_group’] = ‘0’;
$config[‘distributed_poller_memcached_host’] = “192.168.0.11”;
$config[‘distributed_poller_memcached_port’] = ‘11211’;
$config[‘rrdcached’] = “192.168.0.11:42217”;

This is a screenshot on new poller showing that memcache not installed

I still see devices being polled by both servers:

Run poller-wrapper manually on both at the same time.

This is just an issue with your setup, I can’t tell what but you have something wrong with your memcached setup / config.

Thanks LAF…

Is there an installation doc i can follow to install memcache for librenms…i cant find anything unless i missed it.

Could you share how you installed for distributed polling?

i found this in the docs:

Memcached
SNMP Extend
Copy the memcached script to /etc/snmp/ on your remote server.

Make the script executable: chmod +x /etc/snmp/memcached

Edit your snmpd.conf file (usually /etc/snmp/snmpd.conf) and add:

extend memcached /etc/snmp/memcached
Restart snmpd on your host

Do i need to do the above to get it working correctly?

Thanks

Ok so I have configured a memcache server and point my 2 pollers to the memcache server.

I have added 2 devices.

Now im not sure if each poller should poll 1 devices each?

That depends on how you configure groups. If each poller is in the default group of 0 and the devices are then they will only be polled once each - which poller does that depends on how quick they are done. 2 devices isn’t a good test to see a 50/50 split but you will NOT see both pollers poll the devices at the same time.

Thanks LAF will add more devices and see how it goes…Thanks for the patience and help so far.