# Path: es_stats_zabbix/defaults/settings.py
# NODETYPES = ['cluster', 'coordinating', 'master', 'data', 'ml', 'ingest']
# 
# Path: es_stats_zabbix/exceptions.py
# class FailedExecution(ESZException):
#     """
#     Exception raised when a function fails to execute for some reason.
#     """
# 
# class NotFound(ESZException):
#     """
#     Exception raised when expected information is not found.
#     """


import socket
import logging
import requests
from es_stats_zabbix.defaults.settings import NODETYPES
from es_stats_zabbix.exceptions import FailedExecution, NotFound
    entries = {
        '{#CLUSTERNAME}': cluster_name,
        '{#NODEID}':nodeid,
        '{#NODENAME}':nodename
    }
    return entries

def get_node_macros(statobj, nodeid):
    """Get the nodetype LLD macros"""
    macros = []
    def macgen(nodetype, boolish):
        """Add the uppercase value of valuetype to the LLD Macros"""
        return {
            '{#NODETYPE}':nodetype,
            '{#PRESENT}':boolish
        }
    present_nodetypes = true_nodetypes(statobj, nodeid)
    for nodetype in NODETYPES:
        if nodetype in present_nodetypes:
            macros.append(macgen(nodetype, 1))
        else:
            macros.append(macgen(nodetype, 0))
    return macros

def get_nodeid(statobjs, node):
    """Get the nodeid from the node name"""
    nodeinfo = statobjs['nodeinfo'].cached_read('nodeinfo')['nodes']
    found = False
    if not node:
        msg = 'No node name provided.'

# Path: es_stats_zabbix/defaults/settings.py
# NODETYPES = ['cluster', 'coordinating', 'master', 'data', 'ml', 'ingest']
# 
# Path: es_stats_zabbix/exceptions.py
# class FailedExecution(ESZException):
#     """
#     Exception raised when a function fails to execute for some reason.
#     """
# 
# class NotFound(ESZException):
#     """
#     Exception raised when expected information is not found.
#     """


# Path: es_stats_zabbix/helpers/utils.py
import socket
import logging
import requests
from es_stats_zabbix.defaults.settings import NODETYPES
from es_stats_zabbix.exceptions import FailedExecution, NotFound

    entries = {
        '{#CLUSTERNAME}': cluster_name,
        '{#NODEID}':nodeid,
        '{#NODENAME}':nodename
    }
    return entries

def get_node_macros(statobj, nodeid):
    """Get the nodetype LLD macros"""
    macros = []
    def macgen(nodetype, boolish):
        """Add the uppercase value of valuetype to the LLD Macros"""
        return {
            '{#NODETYPE}':nodetype,
            '{#PRESENT}':boolish
        }
    present_nodetypes = true_nodetypes(statobj, nodeid)
    for nodetype in NODETYPES:
        if nodetype in present_nodetypes:
            macros.append(macgen(nodetype, 1))
        else:
            macros.append(macgen(nodetype, 0))
    return macros

def get_nodeid(statobjs, node):
    """Get the nodeid from the node name"""
    nodeinfo = statobjs['nodeinfo'].cached_read('nodeinfo')['nodes']
    found = False
    if not node:
        msg = 'No node name provided.'

        raise NotFound(msg)