zabbix 监控ElasticSearch

使用elasticsearch的健康检查命令来监控其集群状态:

 curl -s -XGET 192.168.1.22:9200/_cluster/health?pretty
{
  "cluster_name" : "elastic",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 5,
  "active_shards" : 10,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

配置键值参数

在zabbix存放自定义参数模板路径下创建如下文件:

cat /etc/zabbix/zabbix_agentd.d/userparameter_elastic.conf
 
UserParameter=estic.status,/bin/sh /scripts/elastic_zabbix.sh status
UserParameter=estic.timed_out,/bin/sh /scripts/elastic_zabbix.sh timed_out
UserParameter=estic.number_of_nodes,/bin/sh /scripts/elastic_zabbix.sh number_of_nodes
UserParameter=estic.number_of_data_nodes,/bin/sh /scripts/elastic_zabbix.sh number_of_data_nodes
UserParameter=estic.active_primary_shards,/bin/sh /scripts/elastic_zabbix.sh active_primary_shards
UserParameter=estic.active_shards,/bin/sh /scripts/elastic_zabbix.sh active_shards
UserParameter=estic.relocating_shards,/bin/sh /scripts/elastic_zabbix.sh relocating_shards
UserParameter=estic.initializing_shards,/bin/sh /scripts/elastic_zabbix.sh initializing_shards
UserParameter=estic.unassigned_shards,/bin/sh /scripts/elastic_zabbix.sh unassigned_shards
UserParameter=estic.delayed_unassigned_shards,/bin/sh /scripts/elastic_zabbix.sh delayed_unassigned_shards
UserParameter=estic.number_of_pending_tasks,/bin/sh /scripts/elastic_zabbix.sh number_of_pending_tasks
UserParameter=estic.number_of_in_flight_fetch,/bin/sh /scripts/elastic_zabbix.sh number_of_in_flight_fetch
UserParameter=estic.task_max_waiting_in_queue_millis,/bin/sh /scripts/elastic_zabbix.sh task_max_waiting_in_queue_millis
UserParameter=estic.active_shards_percent_as_number,/bin/sh /scripts/elastic_zabbix.sh active_shards_percent_as_number

执行脚本可以放在自定义的目录中,和上面定义的参数对应:

cat /scripts/elastic_zabbix.sh 

#!/bin/bash
URL="192.168.1.22:9200/_cluster/health"
ESstatus="`curl -s -XGET $URL`"
#echo $ESstatus
status=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $4}‘`
timed_out=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $6}‘`
number_of_nodes=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $8}‘`
number_of_data_nodes=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $10}‘`
active_primary_shards=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $12}‘`
active_shards=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $14}‘`
relocating_shards=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $16}‘`
initializing_shards=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $18}‘`
unassigned_shards=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $20}‘`
delayed_unassigned_shards=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $22}‘`
number_of_pending_tasks=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $24}‘`
number_of_in_flight_fetch=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $26}‘`
task_max_waiting_in_queue_millis=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $28}‘`
active_shards_percent_as_number=`echo $ESstatus|awk -F ‘[:,}]‘ ‘{print $30}‘`
get_values(){
case $1 in
  status) echo $status
  ;;
  timed_out) echo $timed_out
  ;;
  number_of_nodes) echo $number_of_nodes
  ;;
  number_of_data_nodes) echo $number_of_data_nodes
  ;;
  active_primary_shards) echo $active_primary_shards
  ;;
  active_shards) echo $active_shards
  ;;
  relocating_shards) echo $relocating_shards
  ;;
  initializing_shards) echo $initializing_shards
  ;;
  unassigned_shards) echo $unassigned_shards
  ;;
  delayed_unassigned_shards) echo $delayed_unassigned_shards
  ;;
  number_of_pending_tasks) echo $number_of_pending_tasks
  ;;
  number_of_in_flight_fetch) echo $number_of_in_flight_fetch
  ;;
  task_max_waiting_in_queue_millis) echo $task_max_waiting_in_queue_millis
  ;;
  active_shards_percent_as_number) echo $active_shards_percent_as_number
  ;;
   *)
     echo error
  esac
}
main (){
get_values $1
}
main $1

这里是三个节点的Elastic组成的集群,在每个节点上配置以上的参数和脚本。

导入配置模板

附件是对应自定义的zabbix监控模板,可以根据自己的需要进行修改:

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>3.2</version>
    <date>2017-05-10T07:40:20Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Template Elastic Search</template>
            <name>Template Elastic Search</name>
            <description/>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Elasticsearch healthcheck</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>estic.active_primary_shards</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.active_primary_shards</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.active_shards</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.active_shards</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.active_shards_percent_as_number</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.active_shards_percent_as_number</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>0</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.delayed_unassigned_shards</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.delayed_unassigned_shards</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.initializing_shards</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.initializing_shards</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.number_of_data_nodes</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.number_of_data_nodes</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.number_of_in_flight_fetch</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.number_of_in_flight_fetch</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.number_of_nodes</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.number_of_nodes</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.number_of_pending_tasks</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>estic.number_of_pending_tasks</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.relocating_shards</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.relocating_shards</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.status</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>estic.status</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>0</trends>
                    <status>0</status>
                    <value_type>1</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.task_max_waiting_in_queue_millis</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.task_max_waiting_in_queue_millis</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.timed_out</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>estic.timed_out</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>0</trends>
                    <status>0</status>
                    <value_type>1</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>estic.unassigned_shards</name>
                    <type>0</type>
                    <snmp_community/>
                    <multiplier>1</multiplier>
                    <snmp_oid/>
                    <key>estic.unassigned_shards</key>
                    <delay>300</delay>
                    <history>30</history>
                    <trends>30</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units/>
                    <delta>0</delta>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <formula>1</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Elasticsearch healthcheck</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
            </items>
            <discovery_rules/>
            <httptests/>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
    <triggers>
        <trigger>
            <expression>{Template Elastic Search:estic.status.str(&quot;\&quot;green\&quot;&quot;)}=0</expression>
            <recovery_mode>0</recovery_mode>
            <recovery_expression/>
            <name>elastic is down</name>
            <correlation_mode>0</correlation_mode>
            <correlation_tag/>
            <url/>
            <status>0</status>
            <priority>3</priority>
            <description/>
            <type>0</type>
            <manual_close>1</manual_close>
            <dependencies/>
            <tags/>
        </trigger>
    </triggers>
    <graphs>
        <graph>
            <name>estic.number_of_pending_tasks</name>
            <width>900</width>
            <height>200</height>
            <yaxismin>0.0000</yaxismin>
            <yaxismax>100.0000</yaxismax>
            <show_work_period>1</show_work_period>
            <show_triggers>1</show_triggers>
            <type>0</type>
            <show_legend>1</show_legend>
            <show_3d>0</show_3d>
            <percent_left>0.0000</percent_left>
            <percent_right>0.0000</percent_right>
            <ymin_type_1>0</ymin_type_1>
            <ymax_type_1>0</ymax_type_1>
            <ymin_item_1>0</ymin_item_1>
            <ymax_item_1>0</ymax_item_1>
            <graph_items>
                <graph_item>
                    <sortorder>0</sortorder>
                    <drawtype>0</drawtype>
                    <color>1A7C11</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>Template Elastic Search</host>
                        <key>estic.active_primary_shards</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>1</sortorder>
                    <drawtype>0</drawtype>
                    <color>F63100</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>Template Elastic Search</host>
                        <key>estic.active_shards</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>2</sortorder>
                    <drawtype>0</drawtype>
                    <color>2774A4</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>Template Elastic Search</host>
                        <key>estic.number_of_data_nodes</key>
                    </item>
                </graph_item>
                <graph_item>
                    <sortorder>3</sortorder>
                    <drawtype>0</drawtype>
                    <color>A54F10</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>Template Elastic Search</host>
                        <key>estic.number_of_nodes</key>
                    </item>
                </graph_item>
            </graph_items>
        </graph>
    </graphs>
</zabbix_export>
时间: 2024-10-25 19:58:32

zabbix 监控ElasticSearch的相关文章

zabbix 监控 ElasticSearch

ElasticSearch  可以直接使用zabbix官方的模板 模板地址: https://github.com/mkhpalm/elastizabbix 通过zabbix server 直接监控 1.下载模板文件导入模板 2.把模板关联到zabbix server 3.添加自定义KEY vim /etc/zabbix/scripts/elastizabbix.py #!/usr/bin/python import os import sys import json import urllib

zabbix监控实例

zabbix web添加主机 1. 进入zabbix web界面,点击配置->主机->创建主机. 2. 填入下图中的信息,点击添加. 定义Items 要真正实现数据采集,需要定义监控项(Items).多个Items可以归为一个组,称为Applications.定义好Items之后,还应该为Items定义Triggers(触发器).我这里演示下创建监控网卡进入和出去的流量. 一.创建item监控网卡出去流量 登录zabbix web管控台,点击配置->主机->监控项. 点击右上角的&

zabbix监控模板修改及调优(不完整版)

简介监控一直在不同的层面为我们的运维工作发挥着重要的作用:网络层监控,及时发现网络间的访问质量(如我们之前介绍的全国maps网络监控):服务器监控,了解服务器各项性能参数(如常见的zabbix.cacti.nagios.ganglia等):应用性能监控,深入监测具体业务的性能情况(如我们之前提到的APM监控系统)其中,服务器监控作为一种传统的监控类型,我们结合不同场景中也用到了多种方案.而在众多方案中,zabbix由于其强大的功能和灵活的自动化特性,尤其得到我们的广泛使用.为了打造出适合自己的z

Zabbix监控搭建

系统环境:Centos 6.6 软件环境:Zabbix-2.4.4 1.Server端安装基础软件包 在Server端安装基础软件包,这里使用的是系统自带的网络Yum源(本地Yum源会出现部分软件包安装不上,也可以使用源码包安装) yum -y install wget vim tree gcc gcc-c++ autoconf httpd php mysqlmysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql p

zabbix监控环境搭建错误(1)

我们在搭建zabbix监控时由于自己的操作错误会出现下图的错误: 我们在组态中创建动作时:要是在动作那栏把配置写好后直接点存档后就会出现如图上的错误,具体解决方法如下 点到操作选项并添加新的动作操作后将配置填好后先点添加最后点存档,要不然就会报图1的错误!

资源汇集:跟着ttlsa学习zabbix监控

从2009年开始接触zabbix,当时版本在1.8,经过差不多5年的时间,zabbix历经2.0,2.1,2.2数个版本,虽然大多数功能保持不变,但是还是有非常明显的改变. Zabbix VS Nagios指数 我们来看看zabbix的发展趋势,打开http://index.baidu.com/?tpl=trend&word=zabbix,可以看到这个月的日平均指数在258,整体同比增长928%,环比增长10%.nagios月平均指数在308,同比增长13%,环比24%,可以看出zabbix虽然

zabbix监控LINUX下CPU,硬盘,流量,内存

1.LINUX下zabbix客户端安装 [[email protected] ~]# mkdir /usr/local/zabbix [[email protected] ~]# mv zabbix_agents_2.0.3.linux2_6.amd64.tar.gz /usr/local/zabbix/ [[email protected] ~]# cd /usr/local/zabbix/ [[email protected] zabbix]# tar zxvf zabbix_agents_

部署zabbix监控mysql (一) 安装zabbix

部署zabbix监控mysql (1)安装LAMP环境 [[email protected] ~]# yum -y installmysql-server http php (2)安装zabbix web所需要的依赖包 [[email protected] ~]# yum -y installmysql-dev gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmathphp-mbstring php-xml 安装Fpin

zabbix监控MySQL(windows和linux环境)

一.linux环境下监控MySQL Zabbix Server自带了MySQL插件来监控mysql数据库的模板,只需要配置好agent客户端,然后在web端给主机增加模板就行了 监控项目: Com_update:     mysql执行的更新个数 Com_select:     mysql执行的查询个数 Com_insert:     mysql执行插入的个数 Com_delete:     执行删除的个数 Com_rollback:   执行回滚的操作个数 Bytes_received:  接