added netstat for web ports, php-fpm, testbackup
This commit is contained in:
parent
475489e680
commit
ee40b7ba30
168
netstat/mdm-netstat-connection-active.xml
Normal file
168
netstat/mdm-netstat-connection-active.xml
Normal file
@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<zabbix_export>
|
||||
<version>3.4</version>
|
||||
<date>2021-06-14T12:23:50Z</date>
|
||||
<groups>
|
||||
<group>
|
||||
<name>MDM</name>
|
||||
</group>
|
||||
<group>
|
||||
<name>Templates</name>
|
||||
</group>
|
||||
</groups>
|
||||
<templates>
|
||||
<template>
|
||||
<template>mdm netstat connections active</template>
|
||||
<name>mdm netstat connections active</name>
|
||||
<description/>
|
||||
<groups>
|
||||
<group>
|
||||
<name>MDM</name>
|
||||
</group>
|
||||
<group>
|
||||
<name>Templates</name>
|
||||
</group>
|
||||
</groups>
|
||||
<applications>
|
||||
<application>
|
||||
<name>Netstat</name>
|
||||
</application>
|
||||
</applications>
|
||||
<items>
|
||||
<item>
|
||||
<name>Http established cons on 80 and 443 ports</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>netstat-conn[established]</key>
|
||||
<delay>1m</delay>
|
||||
<history>1w</history>
|
||||
<trends>365d</trends>
|
||||
<status>0</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units>conn</units>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>Netstat</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
<item>
|
||||
<name>Http time waiting conns on 80 and 443 ports</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>netstat-conn[time_wait]</key>
|
||||
<delay>1m</delay>
|
||||
<history>1w</history>
|
||||
<trends>365d</trends>
|
||||
<status>0</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units>conn</units>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>Netstat</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
</items>
|
||||
<discovery_rules/>
|
||||
<httptests/>
|
||||
<macros/>
|
||||
<templates/>
|
||||
<screens/>
|
||||
</template>
|
||||
</templates>
|
||||
<graphs>
|
||||
<graph>
|
||||
<name>Netstat: connections on 80 and 443 ports</name>
|
||||
<width>600</width>
|
||||
<height>200</height>
|
||||
<yaxismin>0.0000</yaxismin>
|
||||
<yaxismax>100.0000</yaxismax>
|
||||
<show_work_period>0</show_work_period>
|
||||
<show_triggers>0</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>2</drawtype>
|
||||
<color>AA00AA</color>
|
||||
<yaxisside>1</yaxisside>
|
||||
<calc_fnc>2</calc_fnc>
|
||||
<type>0</type>
|
||||
<item>
|
||||
<host>mdm netstat connections active</host>
|
||||
<key>netstat-conn[established]</key>
|
||||
</item>
|
||||
</graph_item>
|
||||
<graph_item>
|
||||
<sortorder>1</sortorder>
|
||||
<drawtype>0</drawtype>
|
||||
<color>00DD00</color>
|
||||
<yaxisside>1</yaxisside>
|
||||
<calc_fnc>2</calc_fnc>
|
||||
<type>0</type>
|
||||
<item>
|
||||
<host>mdm netstat connections active</host>
|
||||
<key>netstat-conn[time_wait]</key>
|
||||
</item>
|
||||
</graph_item>
|
||||
</graph_items>
|
||||
</graph>
|
||||
</graphs>
|
||||
</zabbix_export>
|
||||
3
netstat/netstat_conn.conf
Executable file
3
netstat/netstat_conn.conf
Executable file
@ -0,0 +1,3 @@
|
||||
#netstat connections status
|
||||
# $1 METRIC
|
||||
UserParameter=netstat-conn[*],/etc/zabbix/scripts/netstat_conn.sh "$1"
|
||||
39
netstat/netstat_conn.sh
Executable file
39
netstat/netstat_conn.sh
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
#Netstat connections monitoring
|
||||
|
||||
METRIC="$1"
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Please enter metric"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CACHETTL="55" # Время действия кеша в секундах (чуть меньше чем период опроса элементов)
|
||||
CACHE="/tmp/netstat-status-`echo netstat| md5sum | cut -d" " -f1`.cache"
|
||||
|
||||
if [ -s "$CACHE" ]; then
|
||||
TIMECACHE=`stat -c"%Z" "$CACHE"`
|
||||
else
|
||||
TIMECACHE=0
|
||||
fi
|
||||
|
||||
TIMENOW=`date '+%s'`
|
||||
|
||||
if [ "$(($TIMENOW - $TIMECACHE))" -gt "$CACHETTL" ]; then
|
||||
netstat -tan|grep -e ':80\|:443' > $CACHE || exit 1
|
||||
fi
|
||||
|
||||
case $METRIC in
|
||||
'established')
|
||||
cat $CACHE | grep "ESTABLISHED" | wc -l
|
||||
;;
|
||||
'time_wait')
|
||||
cat $CACHE | grep "TIME_WAIT" | wc -l
|
||||
;;
|
||||
*)
|
||||
echo "Not selected metric"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
5
php-fpm/fpm-status.conf
Executable file
5
php-fpm/fpm-status.conf
Executable file
@ -0,0 +1,5 @@
|
||||
#php-fpm status
|
||||
# $1 METRIC
|
||||
# $2 FPM URL
|
||||
# $3 FPM PORT
|
||||
UserParameter=php-fpm[*],/etc/zabbix/scripts/fpm-status.sh "$1" "$2" "$3"
|
||||
80
php-fpm/fpm-status.sh
Executable file
80
php-fpm/fpm-status.sh
Executable file
@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
##### OPTIONS VERIFICATION #####
|
||||
if [ -z "$1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
##### PARAMETERS #####
|
||||
METRIC="$1"
|
||||
POOL_PORT="${3:-9001}"
|
||||
STATSURL="${2:-http://localhost/fpm-status?port=$POOL_PORT}"
|
||||
CURL="/usr/bin/curl"
|
||||
CACHE_TTL="55"
|
||||
CACHE_FILE="/tmp/zabbix.fpm-status.`echo $STATSURL | md5sum | cut -d" " -f1`.cache"
|
||||
EXEC_TIMEOUT="1"
|
||||
NOW_TIME=`date '+%s'`
|
||||
##### RUN #####
|
||||
if [ -s "${CACHE_FILE}" ]; then
|
||||
CACHE_TIME=`stat -c"%Y" "${CACHE_FILE}"`
|
||||
else
|
||||
CACHE_TIME=0
|
||||
fi
|
||||
DELTA_TIME=$((${NOW_TIME} - ${CACHE_TIME}))
|
||||
#
|
||||
if [ ${DELTA_TIME} -lt ${EXEC_TIMEOUT} ]; then
|
||||
sleep $((${EXEC_TIMEOUT} - ${DELTA_TIME}))
|
||||
elif [ ${DELTA_TIME} -gt ${CACHE_TTL} ]; then
|
||||
echo "" >> "${CACHE_FILE}" # !!!
|
||||
DATACACHE=`${CURL} --insecure -s "${STATSURL}" 2>&1`
|
||||
echo "${DATACACHE}" > "${CACHE_FILE}" # !!!
|
||||
chmod 640 "${CACHE_FILE}"
|
||||
fi
|
||||
|
||||
#
|
||||
case $METRIC in
|
||||
pool)
|
||||
grep "^pool:" $CACHE_FILE | cut -d ':' -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
process_manager)
|
||||
grep "^process manager:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
start_time)
|
||||
grep "^start time:" $CACHE_FILE | sed 's|^start time:\s\+||'
|
||||
;;
|
||||
start_since)
|
||||
grep "^start since:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
accepted_conn)
|
||||
grep "^accepted conn:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
listen_queue)
|
||||
grep "^listen queue:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
max_listen_queue)
|
||||
grep "^max listen queue:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
listen_queue_len)
|
||||
grep "^listen queue len:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
idle_processes)
|
||||
grep "^idle processes:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
active_processes)
|
||||
grep "^active processes:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
total_processes)
|
||||
grep "^total processes:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
max_active_processes)
|
||||
grep "^max active processes:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
max_children_reached)
|
||||
grep "^max children reached:" $CACHE_FILE | cut -d ":" -f 2 | sed 's|^\s\+||'
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported metric $METRIC"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
#
|
||||
|
||||
exit 0
|
||||
418
php-fpm/mdm-php-fpm-active.xml
Normal file
418
php-fpm/mdm-php-fpm-active.xml
Normal file
@ -0,0 +1,418 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<zabbix_export>
|
||||
<version>3.4</version>
|
||||
<date>2021-06-14T12:27:54Z</date>
|
||||
<groups>
|
||||
<group>
|
||||
<name>Templates</name>
|
||||
</group>
|
||||
</groups>
|
||||
<templates>
|
||||
<template>
|
||||
<template>mdm php-fpm active</template>
|
||||
<name>mdm php-fpm active</name>
|
||||
<description/>
|
||||
<groups>
|
||||
<group>
|
||||
<name>Templates</name>
|
||||
</group>
|
||||
</groups>
|
||||
<applications>
|
||||
<application>
|
||||
<name>php-fpm</name>
|
||||
</application>
|
||||
</applications>
|
||||
<items>
|
||||
<item>
|
||||
<name>php-fpm - ping check</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>fpm[ping,{$POOL_PORT}]</key>
|
||||
<delay>1m</delay>
|
||||
<history>1w</history>
|
||||
<trends>60d</trends>
|
||||
<status>1</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units/>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>php-fpm</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
<item>
|
||||
<name>php-fpm - number of active processes</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>php-fpm[active_processes,{$FPM_URL},{$FPM_PORT}]</key>
|
||||
<delay>1m</delay>
|
||||
<history>1w</history>
|
||||
<trends>60d</trends>
|
||||
<status>0</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units/>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>php-fpm</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
<item>
|
||||
<name>php-fpm - number of idle processes</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>php-fpm[idle_processes,{$FPM_URL},{$FPM_PORT}]</key>
|
||||
<delay>1m</delay>
|
||||
<history>1w</history>
|
||||
<trends>60d</trends>
|
||||
<status>0</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units/>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>php-fpm</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
<item>
|
||||
<name>php-fpm - number of total processes</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>php-fpm[total_processes,{$FPM_URL},{$FPM_PORT}]</key>
|
||||
<delay>1m</delay>
|
||||
<history>1w</history>
|
||||
<trends>60d</trends>
|
||||
<status>0</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units/>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>php-fpm</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
<item>
|
||||
<name>Number of running processes $1</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>proc.num[{$FPM_PROCESS_NAME}]</key>
|
||||
<delay>1m</delay>
|
||||
<history>1w</history>
|
||||
<trends>365d</trends>
|
||||
<status>0</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units/>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>php-fpm</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
</items>
|
||||
<discovery_rules/>
|
||||
<httptests/>
|
||||
<macros>
|
||||
<macro>
|
||||
<macro>{$FPM_PROCESS_IDLE_CR}</macro>
|
||||
<value>2</value>
|
||||
</macro>
|
||||
<macro>
|
||||
<macro>{$FPM_PROCESS_IDLE_TR}</macro>
|
||||
<value>10</value>
|
||||
</macro>
|
||||
<macro>
|
||||
<macro>{$FPM_PROCESS_NAME}</macro>
|
||||
<value>php-fpm</value>
|
||||
</macro>
|
||||
<macro>
|
||||
<macro>{$POOL_PORT}</macro>
|
||||
<value>9001</value>
|
||||
</macro>
|
||||
</macros>
|
||||
<templates/>
|
||||
<screens/>
|
||||
</template>
|
||||
</templates>
|
||||
<triggers>
|
||||
<trigger>
|
||||
<expression>{mdm php-fpm active:fpm[ping,{$POOL_PORT}].last(0)}<>0</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>php-fpm is not running on {HOSTNAME}</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>1</status>
|
||||
<priority>4</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<name>php-fpm process is not running on {HOSTNAME}</name>
|
||||
<expression>{mdm php-fpm active:proc.num[{$FPM_PROCESS_NAME}].last(0)}<1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm php-fpm active:php-fpm[idle_processes,{$FPM_URL},{$FPM_PORT}].last(0)}<{$FPM_PROCESS_IDLE_TR}</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>php-fpm number of idle processes is too low on {HOSTNAME}</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>1</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm php-fpm active:php-fpm[idle_processes,{$FPM_URL},{$FPM_PORT}].nodata(3m)}=1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>php-fpm number of idle processes nodata > 180s {HOSTNAME}</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>1</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm php-fpm active:php-fpm[idle_processes,{$FPM_URL},{$FPM_PORT}].last(0)}<{$FPM_PROCESS_IDLE_CR}</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>php-fpm number of idle process is critical on {HOSTNAME}</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>4</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm php-fpm active:proc.num[{$FPM_PROCESS_NAME}].last(0)}<1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>php-fpm process is not running on {HOSTNAME}</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>4</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm php-fpm active:php-fpm[total_processes,{$FPM_URL},{$FPM_PORT}].last()}>{$PHPFPM_MAXPROC}</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>php-fpm total processes is too high on {HOSTNAME}</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>3</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
</triggers>
|
||||
<graphs>
|
||||
<graph>
|
||||
<name>php-fpm proccess</name>
|
||||
<width>600</width>
|
||||
<height>200</height>
|
||||
<yaxismin>0.0000</yaxismin>
|
||||
<yaxismax>100.0000</yaxismax>
|
||||
<show_work_period>0</show_work_period>
|
||||
<show_triggers>0</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>2</drawtype>
|
||||
<color>009900</color>
|
||||
<yaxisside>0</yaxisside>
|
||||
<calc_fnc>2</calc_fnc>
|
||||
<type>0</type>
|
||||
<item>
|
||||
<host>mdm php-fpm active</host>
|
||||
<key>php-fpm[total_processes,{$FPM_URL},{$FPM_PORT}]</key>
|
||||
</item>
|
||||
</graph_item>
|
||||
<graph_item>
|
||||
<sortorder>1</sortorder>
|
||||
<drawtype>2</drawtype>
|
||||
<color>CC0000</color>
|
||||
<yaxisside>0</yaxisside>
|
||||
<calc_fnc>2</calc_fnc>
|
||||
<type>0</type>
|
||||
<item>
|
||||
<host>mdm php-fpm active</host>
|
||||
<key>php-fpm[idle_processes,{$FPM_URL},{$FPM_PORT}]</key>
|
||||
</item>
|
||||
</graph_item>
|
||||
<graph_item>
|
||||
<sortorder>2</sortorder>
|
||||
<drawtype>5</drawtype>
|
||||
<color>0000BB</color>
|
||||
<yaxisside>0</yaxisside>
|
||||
<calc_fnc>2</calc_fnc>
|
||||
<type>0</type>
|
||||
<item>
|
||||
<host>mdm php-fpm active</host>
|
||||
<key>php-fpm[active_processes,{$FPM_URL},{$FPM_PORT}]</key>
|
||||
</item>
|
||||
</graph_item>
|
||||
</graph_items>
|
||||
</graph>
|
||||
</graphs>
|
||||
</zabbix_export>
|
||||
306
test_backup/mdm_test_backup_active.xml
Normal file
306
test_backup/mdm_test_backup_active.xml
Normal file
@ -0,0 +1,306 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<zabbix_export>
|
||||
<version>3.4</version>
|
||||
<date>2021-06-14T11:56:47Z</date>
|
||||
<groups>
|
||||
<group>
|
||||
<name>MDM</name>
|
||||
</group>
|
||||
<group>
|
||||
<name>Templates</name>
|
||||
</group>
|
||||
</groups>
|
||||
<templates>
|
||||
<template>
|
||||
<template>mdm_test_backup_active</template>
|
||||
<name>mdm_test_backup_active</name>
|
||||
<description/>
|
||||
<groups>
|
||||
<group>
|
||||
<name>MDM</name>
|
||||
</group>
|
||||
<group>
|
||||
<name>Templates</name>
|
||||
</group>
|
||||
</groups>
|
||||
<applications>
|
||||
<application>
|
||||
<name>backup</name>
|
||||
</application>
|
||||
</applications>
|
||||
<items>
|
||||
<item>
|
||||
<name>test_logfile</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>test_backup[log]</key>
|
||||
<delay>30s</delay>
|
||||
<history>90d</history>
|
||||
<trends>365d</trends>
|
||||
<status>0</status>
|
||||
<value_type>3</value_type>
|
||||
<allowed_hosts/>
|
||||
<units/>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>backup</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
<item>
|
||||
<name>state</name>
|
||||
<type>7</type>
|
||||
<snmp_community/>
|
||||
<snmp_oid/>
|
||||
<key>test_backup[state]</key>
|
||||
<delay>20s</delay>
|
||||
<history>52w</history>
|
||||
<trends>0</trends>
|
||||
<status>0</status>
|
||||
<value_type>4</value_type>
|
||||
<allowed_hosts/>
|
||||
<units/>
|
||||
<snmpv3_contextname/>
|
||||
<snmpv3_securityname/>
|
||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
||||
<snmpv3_authpassphrase/>
|
||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
||||
<snmpv3_privpassphrase/>
|
||||
<params/>
|
||||
<ipmi_sensor/>
|
||||
<authtype>0</authtype>
|
||||
<username/>
|
||||
<password/>
|
||||
<publickey/>
|
||||
<privatekey/>
|
||||
<port/>
|
||||
<description/>
|
||||
<inventory_link>0</inventory_link>
|
||||
<applications>
|
||||
<application>
|
||||
<name>backup</name>
|
||||
</application>
|
||||
</applications>
|
||||
<valuemap/>
|
||||
<logtimefmt/>
|
||||
<preprocessing/>
|
||||
<jmx_endpoint/>
|
||||
<master_item/>
|
||||
</item>
|
||||
</items>
|
||||
<discovery_rules/>
|
||||
<httptests/>
|
||||
<macros/>
|
||||
<templates/>
|
||||
<screens/>
|
||||
</template>
|
||||
</templates>
|
||||
<triggers>
|
||||
<trigger>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].nodata(3m)}=1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>backup: no data</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>4</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on backup,#1)}=1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>backup: on backup</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>1</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on rotation,#1)}=1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>backup: on rotation</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>1</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on sending,#1)}=1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>backup: on sending</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>1</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(starting script,#1)}=1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>backup: starting</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>1</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(fail,#1)}=1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>backup: {ITEM.LASTVALUE1}</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>4</priority>
|
||||
<description/>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies/>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>({mdm_test_backup_active:test_backup[log].last()}<>1 and {mdm_test_backup_active:test_backup[log].time()}>{$BACKUP_ROTATION_TIME})</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>Today, after macro-time, script was not running</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>0</status>
|
||||
<priority>3</priority>
|
||||
<description>отсутствует резервная копия после времени, которое заданно в макросе
|
||||
Time format:170200 ( 17 - hours, 02 minutes, 00 seconds)
|
||||
Macros name: {$BACKUP_ROTATION_TIME}</description>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<name>backup: on backup</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on backup,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: on rotation</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on rotation,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: on sending</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on sending,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: starting</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(starting script,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: {ITEM.LASTVALUE1}</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(fail,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<tags/>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<expression>{mdm_test_backup_active:test_backup[log].last()}<>1</expression>
|
||||
<recovery_mode>0</recovery_mode>
|
||||
<recovery_expression/>
|
||||
<name>Today script was not running</name>
|
||||
<correlation_mode>0</correlation_mode>
|
||||
<correlation_tag/>
|
||||
<url/>
|
||||
<status>1</status>
|
||||
<priority>3</priority>
|
||||
<description>отсутствует резервная копия</description>
|
||||
<type>0</type>
|
||||
<manual_close>0</manual_close>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<name>backup: on backup</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on backup,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: on rotation</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on rotation,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: on sending</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(on sending,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: starting</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(starting script,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<name>backup: {ITEM.LASTVALUE1}</name>
|
||||
<expression>{mdm_test_backup_active:test_backup[state].str(fail,#1)}=1</expression>
|
||||
<recovery_expression/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<tags/>
|
||||
</trigger>
|
||||
</triggers>
|
||||
</zabbix_export>
|
||||
Loading…
x
Reference in New Issue
Block a user