mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 08:03:30 +02:00
Merge pull request #1377 from clinta/patch-2
Do not allow the master to join twice
This commit is contained in:
+4
-1
@@ -133,6 +133,9 @@ if ('distributed_poller' in config and
|
|||||||
import uuid
|
import uuid
|
||||||
memc = memcache.Client([config['distributed_poller_memcached_host'] + ':' +
|
memc = memcache.Client([config['distributed_poller_memcached_host'] + ':' +
|
||||||
str(config['distributed_poller_memcached_port'])])
|
str(config['distributed_poller_memcached_port'])])
|
||||||
|
if str(memc.get("poller.master")) == config['distributed_poller_name']:
|
||||||
|
print "This sytem is already joined as the poller master."
|
||||||
|
sys.exit(2)
|
||||||
if memc_alive():
|
if memc_alive():
|
||||||
if memc.get("poller.master") is None:
|
if memc.get("poller.master") is None:
|
||||||
print "Registered as Master"
|
print "Registered as Master"
|
||||||
@@ -148,7 +151,7 @@ if ('distributed_poller' in config and
|
|||||||
print "Could not connect to memcached, disabling distributed poller."
|
print "Could not connect to memcached, disabling distributed poller."
|
||||||
distpoll = False
|
distpoll = False
|
||||||
IsNode = False
|
IsNode = False
|
||||||
except:
|
except ImportError:
|
||||||
print "ERROR: missing memcache python module:"
|
print "ERROR: missing memcache python module:"
|
||||||
print "On deb systems: apt-get install python-memcache"
|
print "On deb systems: apt-get install python-memcache"
|
||||||
print "On other systems: easy_install python-memcached"
|
print "On other systems: easy_install python-memcached"
|
||||||
|
|||||||
Reference in New Issue
Block a user