HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //lib/python2.7/site-packages/lap/active_xtradb.py
# This plugin differs from xtradb_cluster because it's active:
# it's checked outside machines

import random
import urllib2

# This check is based on https://github.com/olafz/percona-clustercheck
#
# All clusters installed here have an tiny script listening on port 9200
# that returns 200 OK if the cluster is OK and 503 otherwise.
#
# To make sure that the cluster is up, we need to receive at least a 200

def __run__(params):
    nodes = params.get('nodes').split()
    random.shuffle(nodes)

    url_template = 'http://{0}:9200/'
    for node in nodes:
        try:
            url = urllib2.urlopen(url_template.format(node))
            if url.getcode() == 200:
                return [0, 'OK']
        except:
            continue

    return [2, "CRITICAL: cluster is offline"]