Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 107
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 234
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 235
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 236
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 237
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 238
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 239
import agent_util
class ElasticSearchPlugin(agent_util.Plugin):
textkey = "elasticsearch"
label = "Elastic Search"
@classmethod
def get_metadata(self, config):
status = agent_util.SUPPORTED
msg = None
if not config:
self.log.info(
"The [elasticsearch] config block not found in the config file"
)
return {}
if not "hostname" in config or not "port" in config:
self.log.info(
"The [elasticsearch] config block does not contain variables for hostname and/or port"
)
return {}
if not agent_util.which("curl", exc=False):
self.log.info("curl not found!")
status = agent_util.UNSUPPORTED
msg = "Curl is not installed - please install"
return {}
options = []
data = {
"number_of_nodes": {
"label": "Total number of nodes in cluster",
"options": None,
"status": status,
"error_message": msg,
},
"number_of_data_nodes": {
"label": "Number of data nodes in cluster",
"options": None,
"status": status,
"error_message": msg,
},
"active_primary_shards": {
"label": "Number of active primary shards",
"options": None,
"status": status,
"error_message": msg,
},
"active_shards": {
"label": "Total number of shards",
"options": None,
"status": status,
"error_message": msg,
},
"relocating_shards": {
"label": "Number of shards getting relocated",
"options": None,
"status": status,
"error_message": msg,
},
"initializing_shards": {
"label": "Number of initializing shards",
"options": None,
"status": status,
"error_message": msg,
},
"unassigned_shards": {
"label": "Number of unassigned shards",
"options": None,
"status": status,
"error_message": msg,
},
}
return data
def check(self, textkey, data, config):
user_string = ""
if config.get("username") and config.get("password"):
user_string = "--user %s:%s" % (
config.get("username"),
config.get("password"),
)
cmd = "curl %s %s:%s/_cluster/health" % (
user_string,
config["hostname"],
config["port"],
)
ret, output = agent_util.execute_command(cmd)
reply = agent_util.json_loads(output)
return int(reply[textkey])