mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Finished distributed poller check
This commit is contained in:
19
validate.php
19
validate.php
@@ -168,11 +168,14 @@ foreach ($modules as $module) {
|
||||
print_fail('You have not configured $config[\'distributed_poller_memcached_port\']');
|
||||
}
|
||||
else {
|
||||
$memcache = new Memcached();
|
||||
$memcache->addServer($config['distributed_poller_memcached_host'], $config['distributed_poller_memcached_port']);
|
||||
if (!$memcache->getStats()) {
|
||||
$connection = @fsockopen($config['distributed_poller_memcached_host'], $config['distributed_poller_memcached_port']);
|
||||
if (!is_resource($connection)) {
|
||||
print_fail('We could not get memcached stats, it is possible that we cannot connect to your memcached server, please check');
|
||||
}
|
||||
else {
|
||||
fclose($connection);
|
||||
print_ok('Connection to memcached is ok');
|
||||
}
|
||||
}
|
||||
if (empty($config['rrdcached'])) {
|
||||
print_fail('You have not configured $config[\'rrdcached\']');
|
||||
@@ -181,7 +184,15 @@ foreach ($modules as $module) {
|
||||
print_fail('You have not configured $config[\'rrd_dir\']');
|
||||
}
|
||||
else {
|
||||
|
||||
list($host,$port) = explode(':',$config['rrdcached']);
|
||||
$connection = @fsockopen($host, $port);
|
||||
if (is_resource($connection)) {
|
||||
fclose($connection);
|
||||
print_ok('Connection to rrdcached is ok');
|
||||
}
|
||||
else {
|
||||
print_fail('Cannot connect to rrdcached instance');
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user