├── README.md ├── zabbix-templates ├── ibm-storwize-perf │ ├── screenshots │ │ ├── Error count.png │ │ ├── mdisk - IOPS.png │ │ ├── mdisk - IO time.png │ │ └── mdisk - Throughput.png │ └── scripts │ │ ├── svc_status.awk │ │ ├── svc_status.sh │ │ ├── svc_perf_discovery_sender_zabbix │ │ ├── svc_perf_zabbix │ │ ├── svc_perf_discovery_sender_zabbix.py │ │ └── svc_perf_wbem.py ├── juniper-switches │ ├── docs-screenshots │ │ └── zbx_juniper_cpu_usage.png │ ├── README.md │ ├── docs-verification │ │ └── zbx_juniper_cpu_usage.md │ ├── Juniper_Switch_-_Generic.xml │ └── Juniper_Switch_-_Chassis_Stats.xml ├── ibm-bladecenter-chassis-amm │ ├── screenshots │ │ ├── ibm_amm_value_mapping.jpg │ │ ├── Chassis Stats - Blowers.png │ │ ├── Chassis Stats - Temperature.png │ │ ├── Power State of ALL servers.png │ │ ├── Chassis Stats - chassis main status.png │ │ └── Current Power Usage of ALL modules.png │ └── external_script │ │ └── ibm_amm_snmpget.sh ├── 3ware-raid │ ├── sudoers-zabbix-3ware │ ├── zabbix-3ware.conf │ ├── 3ware_value_mappings.xml │ └── 3ware.sh ├── redhat-yum-stats │ ├── zabbix_agentd │ │ └── zabbix-yum-stats.conf │ ├── plugins │ │ ├── rh.yum.stats.exec.sh │ │ └── rh.yum.stats.sh │ └── zbx_templates_rh_yum_stats.xml ├── rabbitmq-server │ ├── zabbix_agentd │ │ └── zabbix-rabbitmq.conf │ └── scripts │ │ ├── rabbitmq-status.sh │ │ ├── detect_rabbitmq_nodes.sh │ │ └── rabbitmqadmin.py ├── linux-disk-io-stats │ ├── zabbix_agentd │ │ └── zabbix-disk-io-stats.conf │ └── usr-local-bin │ │ ├── zbx_parse_iostat_values.sh │ │ └── discover_disk.pl ├── tsm-server-on-win │ └── zabbix-agent │ │ ├── tsms.occupancy_usage.ps1 │ │ ├── tsms.d_amount_usage.ps1 │ │ ├── tsms.global_stats.ps1 │ │ ├── tsms.stgpool_usage.ps1 │ │ ├── tsms.db_stats.ps1 │ │ └── conf │ │ └── _part_zabbix_agentd.win.conf ├── snmp_interfaces_-_Advanced │ ├── docs-verification │ │ └── example_run.md │ └── external-scripts │ │ └── snmp_iface_advanced_discovery.pl ├── mysql-server │ └── zabbix_agentd │ │ ├── zabbixmysql-new.conf │ │ └── zabbixmysql.conf ├── README.md └── check-https-cert-expire │ ├── externalscripts │ └── check-ssl-expire.py │ └── zbx_template_SSL_Cert_Expire_-_external.xml └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | Zabbix-II 2 | ========= 3 | 4 | add-ons, templates and etc for monitoring project "Zabbix" 5 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/screenshots/Error count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-storwize-perf/screenshots/Error count.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/screenshots/mdisk - IOPS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-storwize-perf/screenshots/mdisk - IOPS.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/screenshots/mdisk - IO time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-storwize-perf/screenshots/mdisk - IO time.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/screenshots/mdisk - Throughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-storwize-perf/screenshots/mdisk - Throughput.png -------------------------------------------------------------------------------- /zabbix-templates/juniper-switches/docs-screenshots/zbx_juniper_cpu_usage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/juniper-switches/docs-screenshots/zbx_juniper_cpu_usage.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/ibm_amm_value_mapping.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/ibm_amm_value_mapping.jpg -------------------------------------------------------------------------------- /zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Chassis Stats - Blowers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Chassis Stats - Blowers.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Chassis Stats - Temperature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Chassis Stats - Temperature.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Power State of ALL servers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Power State of ALL servers.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Chassis Stats - chassis main status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Chassis Stats - chassis main status.png -------------------------------------------------------------------------------- /zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Current Power Usage of ALL modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/H-Software/Zabbix-II/HEAD/zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/Current Power Usage of ALL modules.png -------------------------------------------------------------------------------- /zabbix-templates/3ware-raid/sudoers-zabbix-3ware: -------------------------------------------------------------------------------- 1 | # 2 | #zabbix ALL = NOPASSWD: /etc/zabbix/plugins/raidc_discover-3ware.sh 3 | # 4 | #zabbix ALL = NOPASSWD: /etc/zabbix/plugins/raidc_smart-3ware.sh 5 | # 6 | zabbix ALL = NOPASSWD: /etc/zabbix/plugins/3ware.sh * 7 | 8 | -------------------------------------------------------------------------------- /zabbix-templates/3ware-raid/zabbix-3ware.conf: -------------------------------------------------------------------------------- 1 | #UserParameter=raid.3ware.discovery,sudo /etc/zabbixplugins/raidc_discover-3ware.sh 2 | #UserParameter=raid.3ware.smart.status[*],sudo /etc/zabbix/plugins/raidc_smart-3ware.sh 3 | 4 | UserParameter=3ware_status[*],sudo /etc/zabbix/plugins/3ware.sh -t "$1" -m "$2" -a "$3" -d "$4" 5 | 6 | -------------------------------------------------------------------------------- /zabbix-templates/redhat-yum-stats/zabbix_agentd/zabbix-yum-stats.conf: -------------------------------------------------------------------------------- 1 | # 2 | # yum packages stats 3 | # 4 | UserParameter=rh.yum.updates.total,/etc/zabbix/plugins/rh.yum.stats.sh total 5 | UserParameter=rh.yum.updates.security,/etc/zabbix/plugins/rh.yum.stats.sh security 6 | UserParameter=rh.yum.extras,/etc/zabbix/plugins/rh.yum.stats.sh extras 7 | 8 | -------------------------------------------------------------------------------- /zabbix-templates/redhat-yum-stats/plugins/rh.yum.stats.exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=/tmp/zabbix_rh.yum.stats.log 4 | 5 | flock=/tmp/zabbix_rh.yum.stats.log.lock 6 | 7 | function erase_lockfile(){ 8 | rm -f $flock > /dev/null 2>&1 9 | } 10 | 11 | if test `find "$flock" -mmin +55 2> /dev/null`; then 12 | erase_lockfile 13 | fi 14 | 15 | if [ -f "$flock" ] ; then 16 | # sleep 60 17 | exit 1 18 | fi 19 | 20 | touch $flock > /dev/null 2>&1 21 | 22 | #refresh data 23 | echo -n "total:" > $file 24 | timeout 900 yum check-update -q --errorlevel=0 |grep -r ^[a-zA-Z0-9].* |wc -l 2> /dev/null >> $file 25 | 26 | echo -n "security:" >> $file 27 | timeout 900 yum list-security -q --errorlevel=0 |wc -l 2> /dev/null >> $file 28 | 29 | echo -n "extras:" >> $file 30 | timeout 900 yum list extras -q --errorlevel=0 |grep -v "Extra Packages" |wc -l 2> /dev/null >> $file 31 | 32 | erase_lockfile 33 | 34 | exit 0 35 | 36 | -------------------------------------------------------------------------------- /zabbix-templates/rabbitmq-server/zabbix_agentd/zabbix-rabbitmq.conf: -------------------------------------------------------------------------------- 1 | # 2 | # discovering 3 | # 4 | UserParameter=rabbitmq.discovery,/etc/zabbix/scripts/rabbitmq/detect_rabbitmq_nodes.sh 5 | UserParameter=rabbitmq.discovery_queue,/etc/zabbix/scripts/rabbitmq/detect_rabbitmq_nodes.sh queue 6 | UserParameter=rabbitmq.discovery_exchanges,/etc/zabbix/scripts/rabbitmq/detect_rabbitmq_nodes.sh exchange 7 | # 8 | UserParameter=rabbitmq[*],/etc/zabbix/scripts/rabbitmq/rabbitmq-status.sh $1 $2 $3 $4 9 | # 10 | # counts of messages 11 | # 12 | UserParameter=rabbitmq.local.messages_ready.count[*],sudo rabbitmqctl -q list_queues -p $1 messages_ready | awk '{S = S + $ 0}END{print S}' 13 | UserParameter=rabbitmq.local.messages_unacknowledged.count[*],sudo rabbitmqctl -q list_queues -p $1 messages_unacknowledged | awk '{S = S + $ 0}END{print S}' 14 | UserParameter=rabbitmq.local.messages.count[*],sudo rabbitmqctl -q list_queues -p $1 messages | awk '{S = S + $ 0}END{print S}' 15 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/scripts/svc_status.awk: -------------------------------------------------------------------------------- 1 | # Algorithm based on following lseventlog output format: 2 | # 3 | # sequence_number last_timestamp object_type object_id object_name copy_id status fixed event_id error_code description 4 | # 5 | # Column width is data depend and must be calculated on every lseventlog invocation 6 | 7 | { 8 | if (!errorcode_pos) { 9 | #first line 10 | #get position of "error_code" field from first line 11 | errorcode_pos = index($0, "error_code"); 12 | descr_pos = index($0, "description"); 13 | # calculate "error_code" field length (minus space) 14 | errorcode_len = descr_pos - errorcode_pos - 1 15 | } else { 16 | #other lines 17 | if (trim(substr($0, errorcode_pos, errorcode_len))) { 18 | print $0 19 | } 20 | } 21 | } 22 | 23 | function trim(s) { 24 | _strim = s; 25 | gsub(/ +$/,"", _strim); 26 | gsub(/^ +/,"", _strim); 27 | return _strim; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /zabbix-templates/redhat-yum-stats/plugins/rh.yum.stats.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | file=/tmp/zabbix_rh.yum.stats.log 4 | 5 | #flock=/tmp/zabbix_rh.yum.stats.log.lock 6 | 7 | function parse_results(){ 8 | 9 | result=$(cat $file | awk '/'''$input''':[0-9]+/{ print $0 }' |awk -F':' '{print $2}') 10 | 11 | if [ "$result" = "" ]; then 12 | check_values 13 | echo "-1" 14 | else 15 | echo $result 16 | fi 17 | 18 | } 19 | 20 | function check_values(){ 21 | 22 | screen -d -m /etc/zabbix/plugins/rh.yum.stats.exec.sh 23 | 24 | # /etc/zabbix/plugins/rh.yum.stats.exec.sh & 25 | # sleep 1 26 | } 27 | 28 | input=$1 29 | 30 | if [ "$input" = "" ]; then 31 | echo "ZBX_NOTSUPPORTED" 32 | exit 22 33 | fi 34 | 35 | #if [ ! -f $file ]; then 36 | # touch $file 37 | #fi 38 | 39 | #if test `find "$file" -mmin +15 > /dev/null 2>&1`; then 40 | if test `find "$file" -mmin +180 2> /dev/null`; then 41 | check_values 42 | echo "-1" 43 | elif [ ! -s $file ]; then 44 | check_values 45 | echo "-1" 46 | else 47 | #return results 48 | parse_results 49 | fi 50 | 51 | exit 0 52 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/scripts/svc_status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # IBM SVC/Storwize V7000 health status monitor 4 | # 5 | # 2013 Matvey Marinin 6 | # 7 | # Returns number of Storwize alerts or an empty string 8 | # 9 | # Parameters: 10 | # $1 = Storwize DNS name/IP 11 | # 12 | # Usage: 13 | # create external check item with key svc_status.sh["{HOST.CONN}"] 14 | # 15 | # For testing purposes script must be run as zabbix user: 16 | # sudo -u zabbix /etc/zabbix/externalscripts/svc_status.sh dev-svc1 17 | # 18 | # Key-based SSH access to Storwize CLI needs to be configured for zabbix user (see /var/lib/zabbix/.ssh) 19 | # 20 | SVC_STATUS_AWK=/etc/zabbix/externalscripts/svc_status.awk 21 | 22 | # run lseventlog command with ssh 23 | EVENTS=$(ssh -l user-zabbix -i /var/lib/zabbix/.ssh/id_rsa -o PasswordAuthentication=no $1 lseventlog -expired no -fixed no -monitoring no -message no -order severity) 24 | SSH_RES=$? 25 | 26 | # check for ssh error 27 | [[ "$SSH_RES" != 0 ]] && exit "$SSH_RES" 28 | 29 | # parse event log 30 | echo "$EVENTS" | awk -f "$SVC_STATUS_AWK" | wc -l 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/scripts/svc_perf_discovery_sender_zabbix: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # IBM Storwize V7000 autodiscovery shell script for Zabbix 4 | # 5 | # Sends volume/mdisk/pool LLD JSON data to LLD trapper items "svc.discovery." 6 | # Use with "_Special_Storwize_Perf" Zabbix template 7 | # 8 | 9 | # 'Hostname' of the host which will collect data 10 | HOSTNAME=$3 11 | # 12 | SVC_USER=$1 13 | # 14 | SVC_PWD=$2 15 | # 16 | D_TYPE=$4 17 | # 18 | #DEBUG="--debug" 19 | 20 | if [ $# -lt 4 ] 21 | then 22 | echo "ZBX_ERROR: Not enough parameters" 23 | echo " Usage: svc_perf_discovery_sender_zabbix " 24 | echo " Zabbix External Check Item ex.: svc_perf_discovery_sender_zabbix[]" 25 | exit 2 26 | fi 27 | 28 | #/usr/bin/python /etc/zabbix/externalscripts/svc_perf_discovery_sender.py "$DEBUG" --clusters "$CLUSTER" --user "$SVC_USER" --password "$SVC_PWD" >>"$ERR_LOG" 2>&1 29 | /usr/bin/python /usr/lib/zabbix/externalscripts/svc_perf_discovery_sender_zabbix.py "$DEBUG" --clusters "$HOSTNAME" --user "$SVC_USER" --password "$SVC_PWD" --discovery-types "$D_TYPE" 30 | 31 | -------------------------------------------------------------------------------- /zabbix-templates/linux-disk-io-stats/zabbix_agentd/zabbix-disk-io-stats.conf: -------------------------------------------------------------------------------- 1 | # 2 | # diskio discovery 3 | # 4 | UserParameter=custom.disks.iostats.discovery_perl,/usr/local/bin/discover_disk.pl 5 | # 6 | # io stats values 7 | # 8 | UserParameter=custom.vfs.dev.iostats.rrqm[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "rrqm/s" 9 | UserParameter=custom.vfs.dev.iostats.wrqm[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "wrqm/s" 10 | UserParameter=custom.vfs.dev.iostats.rps[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "r/s" 11 | UserParameter=custom.vfs.dev.iostats.wps[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "w/s" 12 | UserParameter=custom.vfs.dev.iostats.rsec[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "rsec/s" 13 | UserParameter=custom.vfs.dev.iostats.wsec[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "wsec/s" 14 | UserParameter=custom.vfs.dev.iostats.avgrq[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "avgrq-sz" 15 | UserParameter=custom.vfs.dev.iostats.avgqu[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "avgqu-sz" 16 | UserParameter=custom.vfs.dev.iostats.await[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "await" 17 | UserParameter=custom.vfs.dev.iostats.svctm[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "svctm" 18 | UserParameter=custom.vfs.dev.iostats.util[*],/usr/local/bin/zbx_parse_iostat_values.sh $1 "%util" 19 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-bladecenter-chassis-amm/external_script/ibm_amm_snmpget.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | snmp_community=$1 5 | # ip 6 | ip=$2 7 | #snmp oid 8 | oid=$3 9 | # version of regexp 10 | mod=$4 11 | 12 | if [ $# -lt 4 ] 13 | then 14 | echo 15 | echo " Not enough parameters" 16 | echo " Usage: ibm_amm_snmpget.sh " 17 | exit 2 18 | fi 19 | 20 | if [[ $mod == "1" ]]; 21 | then 22 | # 23 | # MODE 1 24 | # 25 | # for temp and Power Domain fuel stats 26 | # 27 | /usr/bin/snmpget -Ov -t 5 -v 1 -c $snmp_community $ip $oid | /bin/sed "s/[^0-9.]//g" 28 | 29 | elif [[ $mod == "2" ]]; 30 | then 31 | # 32 | # MODE 2 33 | # 34 | # for Power Domain Status 35 | # 36 | 37 | /usr/bin/snmpget -Ov -t 5 -v 1 -c $snmp_community $ip $oid | /bin/sed "s/[^0-9]//g" 38 | elif [[ $mod == "3" ]]; 39 | then 40 | # 41 | # MODE 3 42 | # 43 | # for Chassis Voltage 44 | # 45 | 46 | /usr/bin/snmpget -Ov -t 5 -v 1 -c $snmp_community $ip $oid | /bin/sed "s/[^-|+|0-9|.]//g" 47 | 48 | elif [[ $mod == "9" ]]; 49 | then 50 | # 51 | # MODE 9 52 | # 53 | # for debug 54 | # 55 | 56 | /usr/bin/snmpget -Ov -t 5 -v 1 -c $snmp_community $ip $oid 57 | 58 | else 59 | echo "ERR: wrong number of mode" 60 | fi 61 | 62 | exit 0 63 | 64 | -------------------------------------------------------------------------------- /zabbix-templates/linux-disk-io-stats/usr-local-bin/zbx_parse_iostat_values.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dev=$1 4 | 5 | type=$2 6 | 7 | #enable debug mode 8 | debug=0 9 | 10 | if [[ -z "$dev" ]]; then 11 | echo "error: wrong input value (device)" 12 | exit 1 13 | fi 14 | 15 | if [[ -z "$type" ]]; then 16 | echo "error: wrong input value (type)" 17 | exit 1 18 | fi 19 | 20 | columns=`iostat -xN |egrep -o "^Device.*"` 21 | 22 | columnsarray=($columns) 23 | 24 | column_id=1 25 | 26 | for i in "${columnsarray[@]}" 27 | do 28 | #echo "column: $i" 29 | 30 | if [[ "$i" = "$type" ]]; then 31 | 32 | if [[ $debug -eq 1 ]]; then 33 | echo "right column (${i}) found...column_id: $column_id " 34 | fi 35 | 36 | id="$" 37 | column_id_id=$id$column_id 38 | 39 | iostats=`iostat -xN |egrep -o "^${dev}[[:space:]]+.*" |awk "{print ${column_id_id}}"` 40 | fi 41 | column_id=$[column_id + 1] 42 | done 43 | 44 | if [ -z "$iostats" ]; then 45 | echo "error: \"device\" or \"type\" not found (${dev},${type})" 46 | exit 3 47 | fi 48 | 49 | iostats_lines=`wc -l <<< "$iostats"` 50 | 51 | if [ $iostats_lines -ne 1 ]; then 52 | echo "error: wrong output value (${iostats_lines})" 53 | exit 2 54 | fi 55 | 56 | echo $iostats 57 | 58 | if [[ $debug -eq 1 ]]; then 59 | echo "- - - - - - - - - -" 60 | echo $columns 61 | iostats_debug=`iostat -xN |egrep -o "^${dev}[[:space:]]+.*"` 62 | echo $iostats_debug 63 | echo "- - - - - - - - - -" 64 | fi 65 | 66 | exit 0 67 | 68 | 69 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/scripts/svc_perf_zabbix: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # IBM Storwize V7000 performance monitoring shell script for Zabbix 4 | # 5 | # Sends perf data from svc_perf_wbem.py to Zabbix with zabbix_sender 6 | # Handles all caching and logging, called from /etc/cron.d/svc_perf_cron every 5 min. 7 | # 8 | # 2013 Matvey Marinin 9 | # 10 | # Usage: 11 | # svc_perf 12 | # 13 | # Arguments: 14 | # cluster = Dns name or IP of Storwize V7000 block node (not Storwize V7000 Unified mgmt node!) 15 | # 16 | # 17 | # Where is your zabbix server 18 | ZBXSERVER=127.0.0.1 19 | # where is zabbix_sender tool? 20 | ZBXSENDER=/usr/bin/zabbix_sender 21 | # 'Hostname' of the host which will collect data 22 | HOSTNAME=$3 23 | # 24 | SVC_USER=$1 25 | # 26 | SVC_PWD=$2 27 | 28 | if [ $# -lt 3 ] 29 | then 30 | echo "ZBX_ERROR: Not enough parameters" 31 | echo " Usage: svc_perf_zabbix " 32 | echo " Zabbix External Check Item ex.: svc_perf_zabbix[]" 33 | exit 2 34 | fi 35 | 36 | CLUSTER=$3 37 | 38 | CACHE_FILE=/var/cache/zabbix/svc_perf.$CLUSTER.cache 39 | ERR_LOG=/var/cache/zabbix/svc_perf.$CLUSTER.errlog 40 | 41 | if [ ! -e "$ERR_LOG" ] ; then 42 | /bin/touch $ERR_LOG > /dev/null 2>&1 43 | fi 44 | 45 | if [ "$?" = "0" ]; then 46 | echo >>"$ERR_LOG" > /dev/null 2>&1 47 | else 48 | echo "ZBX_ERROR: Cannot create error log!" 1>&2 49 | exit 1 50 | fi 51 | 52 | if [ "$?" = "0" ]; then 53 | : 54 | else 55 | echo "ZBX_ERROR: Cannot write into error log!" 1>&2 56 | exit 1 57 | fi 58 | 59 | if [ ! -e "$CACHE_FILE" ] ; then 60 | touch "$CACHE_FILE" > /dev/null 2>&1 61 | fi 62 | 63 | if [ "$?" = "0" ]; then 64 | : 65 | else 66 | echo "ZBX_ERROR: Cannot create cache log!" 1>&2 67 | exit 1 68 | fi 69 | 70 | date >>"$ERR_LOG" 71 | /usr/bin/python /usr/lib/zabbix/externalscripts/svc_perf_wbem.py --cluster $CLUSTER --user "$SVC_USER" --password "$SVC_PWD" --cachefile "$CACHE_FILE" 2>>"$ERR_LOG" | zabbix_sender -z $ZBXSERVER -s $HOSTNAME -T -i - |tee "$ERR_LOG" 72 | date >>"$ERR_LOG" 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /zabbix-templates/juniper-switches/README.md: -------------------------------------------------------------------------------- 1 | juniper-switches 2 | ========= 3 | 4 | 1. Juniper Switch - Chassis Stats 5 | ===== 6 | 7 | Requirements 8 | ----- 9 | 10 | All this templates were tested with Zabbix 2.0.x and Centos 6.x x86_64. 11 | 12 | Supproted devices are: 13 | ``` 14 | Switches EX series (tested on 4200,2200) 15 | Juniper Qfabric 16 | Juniper VC (virtual chassis) with EX 3300 17 | ``` 18 | 19 | Instalation 20 | ----- 21 | 22 | 1. download "advsnmp.discovery" to your zabbix-server 23 | (from czhujer/Zabbix-Addons REPO) 24 | 25 | ``` 26 | [root@..]# cd /etc/zabbix/externalscripts 27 | [root@..]# wget https://raw.github.com/czhujer/Zabbix-Addons/master/advsnmp.discovery/advsnmp.discovery 28 | [root@..]# chmod 755 advsnmp.discovery 29 | [root@..]# chown root:root advsnmp.discovery 30 | ``` 31 | 32 | 2. create symlink for others rules 33 | 34 | ``` 35 | [root@..]# cd /etc/zabbix/externalscripts 36 | [root@..]# ln -s advsnmp.discovery advsnmp.discovery2 37 | [root@..]# ln -s advsnmp.discovery advsnmp.discovery3 38 | ``` 39 | 40 | 41 | 3. import xml file to zabbix server 42 | 43 | 4. change SNMP comunnity if you need 44 | 45 | 5. enjoy it! 46 | 47 | [OPTIONAL] check yours result of discovery with examples in docs-verification folder 48 | 49 | Monitored items 50 | ------ 51 | 52 | * Cpu usage 53 | 54 | * Memory (buffer) usage 55 | 56 | * Temperature 57 | 58 | 59 | Changes 60 | ------- 61 | 62 | v1.1 - 2014/10/07 - division of discovery rule 63 | 64 | v1.0 - 2013/08/14 - initial version 65 | 66 | 67 | License 68 | ------- 69 | 70 | This template were distributed under GNU General Public License 2. 71 | 72 | ### Copyright 73 | 74 | Copyright (c) 2013 - 2014 Patrik Majer 75 | 76 | ### Authors 77 | 78 | Patrik Majer 79 | (patrik.majer.pisek |at| gmail |dot| com) 80 | 81 | 82 | 2. Juniper Switch - Generic 83 | ===== 84 | 85 | just copy of general template :) 86 | 87 | 88 | Monitored items 89 | ------ 90 | 91 | * Host reachability using ICMP 92 | 93 | * Device uptime 94 | 95 | 96 | Triggers 97 | ------ 98 | 99 | * {HOST.NAME} has just been restarted 100 | 101 | * {HOST.NAME} is UNREACHABLE or DOWN 102 | -------------------------------------------------------------------------------- /zabbix-templates/rabbitmq-server/scripts/rabbitmq-status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #UserParameter=rabbitmq[*],<%= zabbix_script_dir %>/rabbitmq-status.sh 3 | 4 | NODE=$(echo $1| sed 's!__dog__!@!g') 5 | VHOST=$2 6 | METRIC=$3 7 | ITEM=$4 8 | 9 | #rabbitmq[rabbit,\/,list_queues,none] 10 | if [ "$METRIC" = "list_queues" ]; then 11 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_queues | grep -cv '\.\.\.' 12 | fi 13 | 14 | #rabbitmq[rabbit,\/,list_exchanges,none] 15 | if [ "$METRIC" = "list_exchanges" ]; then 16 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_exchanges | grep -cv '\.\.\.' 17 | fi 18 | 19 | #rabbitmq[rabbit,\/,queue_durable,queue-name] 20 | if [ "$METRIC" = "queue_durable" ]; then 21 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_queues name durable | grep "^$ITEM\s.*$" | awk '{ print $2 }' 22 | fi 23 | 24 | #rabbitmq[rabbit,\/,queue_msg_ready,queue-name] 25 | if [ "$METRIC" = "queue_msg_ready" ]; then 26 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_queues name messages_ready | grep "^$ITEM\s.*$" | awk '{ print $2 }' 27 | fi 28 | 29 | #rabbitmq[rabbit,\/,queue_msg_unackd,queue-name] 30 | if [ "$METRIC" = "queue_msg_unackd" ]; then 31 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_queues name messages_unacknowledged | grep "^$ITEM\s.*$" | awk '{ print $2 }' 32 | fi 33 | 34 | #rabbitmq[rabbit,\/,queue_msgs,queue-name] 35 | if [ "$METRIC" = "queue_msgs" ]; then 36 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_queues name messages | grep "^$ITEM\s.*$" | awk '{ print $2 }' 37 | fi 38 | 39 | #rabbitmq[rabbit,\/,queue_consumers,queue-name] 40 | if [ "$METRIC" = "queue_consumers" ]; then 41 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_queues name consumers | grep "^$ITEM\s.*$" | awk '{ print $2 }' 42 | fi 43 | 44 | #rabbitmq[rabbit,\/,queue_memory,queue-name] 45 | if [ "$METRIC" = "queue_memory" ]; then 46 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_queues name memory | grep "^$ITEM\s.*$" | awk '{ print $2 }' 47 | fi 48 | 49 | #rabbitmq[rabbit,\/,exchange_durable,exchange-name] 50 | if [ "$METRIC" = "exchange_durable" ]; then 51 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_exchanges name durable | grep "^$ITEM\s.*$" | awk '{ print $2 }' 52 | fi 53 | 54 | #rabbitmq[rabbit,\/,exchange_type,exchange-name] 55 | if [ "$METRIC" = "exchange_type" ]; then 56 | sudo /usr/sbin/rabbitmqctl -n $NODE -p $VHOST list_exchanges name type | grep "^$ITEM\s.*$" | awk '{ print $2 }' 57 | fi 58 | 59 | 60 | -------------------------------------------------------------------------------- /zabbix-templates/tsm-server-on-win/zabbix-agent/tsms.occupancy_usage.ps1: -------------------------------------------------------------------------------- 1 | 2 | Param( 3 | [string]$item, 4 | [string]$nodename 5 | ) 6 | 7 | if( $item -Like "tsms.occupancy_usage_discovery"){ 8 | $sql = "select node_name, sum(PHYSICAL_MB) from occupancy group by node_name" 9 | } 10 | elseif ($item -Like "tsms.occupancy_usage_node"){ 11 | $sql = "select sum(PHYSICAL_MB)*1024*1024 from occupancy where node_name = '$nodename'" 12 | } 13 | 14 | 15 | $command = "C:\Program files\Tivoli\TSM\server\tsmdiag\dsmadmc.exe" 16 | $params = "-id=monitor -pa=monpass -comma -dataonly=yes `"" + $sql + "`" " 17 | 18 | $timeout = "1000" 19 | 20 | [Environment]::SetEnvironmentVariable("DSM_CONFIG", "C:\Progra~1\Tivoli\TSM\server\tsmdiag\dsm.opt", "User") 21 | [Environment]::SetEnvironmentVariable("DSM_DIR", "C:\Progra~1\Tivoli\TSM\server\tsmdiag", "User") 22 | 23 | Set-ExecutionPolicy Unrestricted 24 | 25 | $ProcessInfo = New-Object System.Diagnostics.ProcessStartInfo 26 | $ProcessInfo.FileName = $command 27 | $ProcessInfo.RedirectStandardError = "true" 28 | $ProcessInfo.RedirectStandardOutput = "true" 29 | $ProcessInfo.UseShellExecute = $false 30 | 31 | $ProcessInfo.Arguments = $params 32 | $ProcessInfo.WorkingDirectory = $folder 33 | 34 | $Process = New-Object System.Diagnostics.Process 35 | $Process.StartInfo = $ProcessInfo 36 | $Process.Start() | Out-Null 37 | 38 | $ProcessWait = $Process.WaitForExit($timeout) 39 | 40 | $output = $Process.StandardOutput.ReadToEnd() 41 | 42 | if ( ! $ProcessWait ) { 43 | echo "Program dsmadmc did not exit after 1000ms"; 44 | echo $output 45 | $Process.kill() 46 | } 47 | else { 48 | 49 | # 50 | # parse / or print results 51 | # 52 | 53 | if($item -Like "tsms.occupancy_usage_node"){ 54 | 55 | # $output_rounded = [Math]::Round($output, 0) 56 | echo $output 57 | 58 | } 59 | else{ 60 | 61 | 62 | $rows = $output -split "\s+`n" 63 | 64 | echo "{`n`t`"data`":[" 65 | 66 | for($i=0; $i -lt $rows.length; $i++) { 67 | 68 | $items = $rows[$i] -split "," 69 | $name = $items[0] 70 | 71 | if ( $name.length -gt 0){ 72 | echo "`t`t{ " 73 | echo "`t`t`t`"{#NODENAME}`":`"$name`"}," 74 | } 75 | } 76 | 77 | echo "`t`t]`n}" 78 | 79 | # debug (all output) 80 | # echo "- - - - - -" 81 | # echo $output 82 | 83 | } 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /zabbix-templates/tsm-server-on-win/zabbix-agent/tsms.d_amount_usage.ps1: -------------------------------------------------------------------------------- 1 | 2 | Param( 3 | [string]$item, 4 | [string]$entityname 5 | ) 6 | 7 | if( $item -Like "tsms.d_amount_discovery"){ 8 | #$sql = "select node_name, sum(PHYSICAL_MB) from occupancy group by node_name" 9 | $sql = "select ENTITY from summary where activity='BACKUP' and TIMESTAMPDIFF(4,CHAR(current_timestamp-start_time)) <= 1440 group by entity" 10 | } 11 | elseif ($item -Like "tsms.d_amount_usage"){ 12 | $sql = "select sum(BYTES) from summary where activity='BACKUP' and TIMESTAMPDIFF(4,CHAR(current_timestamp-start_time)) <= 1440 and ENTITY = '$entityname'" 13 | } 14 | 15 | $command = "C:\Program files\Tivoli\TSM\server\tsmdiag\dsmadmc.exe" 16 | $params = "-id=monitor -pa=monpass -comma -dataonly=yes `"" + $sql + "`" " 17 | 18 | $timeout = "1000" 19 | 20 | [Environment]::SetEnvironmentVariable("DSM_CONFIG", "C:\Progra~1\Tivoli\TSM\server\tsmdiag\dsm.opt", "User") 21 | [Environment]::SetEnvironmentVariable("DSM_DIR", "C:\Progra~1\Tivoli\TSM\server\tsmdiag", "User") 22 | 23 | Set-ExecutionPolicy Unrestricted 24 | 25 | $ProcessInfo = New-Object System.Diagnostics.ProcessStartInfo 26 | $ProcessInfo.FileName = $command 27 | $ProcessInfo.RedirectStandardError = "true" 28 | $ProcessInfo.RedirectStandardOutput = "true" 29 | $ProcessInfo.UseShellExecute = $false 30 | 31 | $ProcessInfo.Arguments = $params 32 | $ProcessInfo.WorkingDirectory = $folder 33 | 34 | $Process = New-Object System.Diagnostics.Process 35 | $Process.StartInfo = $ProcessInfo 36 | $Process.Start() | Out-Null 37 | 38 | $ProcessWait = $Process.WaitForExit($timeout) 39 | 40 | $output = $Process.StandardOutput.ReadToEnd() 41 | 42 | if ( ! $ProcessWait ) { 43 | echo "Program dsmadmc did not exit after 1000ms"; 44 | echo $output 45 | $Process.kill() 46 | } 47 | else { 48 | 49 | # 50 | # parse / or print results 51 | # 52 | 53 | if($item -Like "tsms.d_amount_usage"){ 54 | 55 | if($output.length -le 2){ 56 | echo "0" 57 | } 58 | else{ 59 | echo $output 60 | } 61 | 62 | } 63 | else{ 64 | 65 | 66 | $rows = $output -split "\s+`n" 67 | 68 | echo "{`n`t`"data`":[" 69 | 70 | for($i=0; $i -lt $rows.length; $i++) { 71 | 72 | $items = $rows[$i] -split "," 73 | $name = $items[0] 74 | 75 | if ( $name.length -gt 0){ 76 | echo "`t`t{ " 77 | echo "`t`t`t`"{#ENTITYNAME}`":`"$name`"}," 78 | } 79 | } 80 | 81 | echo "`t`t]`n}" 82 | 83 | # debug (all output) 84 | # echo "- - - - - -" 85 | # echo $output 86 | 87 | } 88 | 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /zabbix-templates/tsm-server-on-win/zabbix-agent/tsms.global_stats.ps1: -------------------------------------------------------------------------------- 1 | 2 | Param( 3 | [string]$item, 4 | [string]$var 5 | ) 6 | 7 | if( $item -Like "tsms.count_of_completed_backups"){ 8 | $sql = "select count(*) from events where schedule_name like 'CS%' and TIMESTAMPDIFF(4,CHAR(current_timestamp-scheduled_start)) <= 1440 and status='Completed' " 9 | } 10 | elseif ($item -Like "tsms.count_of_failed_backups"){ 11 | $sql = "select count(*) from events where schedule_name like 'CS%' and TIMESTAMPDIFF(4,CHAR(current_timestamp-scheduled_start)) <= 1440 and status like 'Failed%'" 12 | } 13 | elseif ($item -Like "tsms.count_of_missed_backups"){ 14 | $sql = "select count(*) from events where schedule_name like 'CS%' and TIMESTAMPDIFF(4,CHAR(current_timestamp-scheduled_start)) <= 1440 and status='Missed'" 15 | } 16 | elseif ($item -Like "tsms.query_status"){ 17 | $sql = "query status" 18 | } 19 | 20 | $command = "C:\Program files\Tivoli\TSM\server\tsmdiag\dsmadmc.exe" 21 | if($item -Like "tsms.query_status"){ 22 | $params = "-id=monitor -pa=monpass -comma -dataonly=yes `"" + $sql + "`" " 23 | } 24 | else{ 25 | $params = "-id=monitor -pa=monpass -tab -dataonly=yes `"" + $sql + "`" " 26 | } 27 | 28 | $timeout = "1000" 29 | 30 | [Environment]::SetEnvironmentVariable("DSM_CONFIG", "C:\Progra~1\Tivoli\TSM\server\tsmdiag\dsm.opt", "User") 31 | [Environment]::SetEnvironmentVariable("DSM_DIR", "C:\Progra~1\Tivoli\TSM\server\tsmdiag", "User") 32 | 33 | Set-ExecutionPolicy Unrestricted 34 | 35 | $ProcessInfo = New-Object System.Diagnostics.ProcessStartInfo 36 | $ProcessInfo.FileName = $command 37 | $ProcessInfo.RedirectStandardError = "true" 38 | $ProcessInfo.RedirectStandardOutput = "true" 39 | $ProcessInfo.UseShellExecute = $false 40 | 41 | $ProcessInfo.Arguments = $params 42 | $ProcessInfo.WorkingDirectory = $folder 43 | 44 | $Process = New-Object System.Diagnostics.Process 45 | $Process.StartInfo = $ProcessInfo 46 | $Process.Start() | Out-Null 47 | 48 | $ProcessWait = $Process.WaitForExit($timeout) 49 | 50 | $output = $Process.StandardOutput.ReadToEnd() 51 | 52 | if ( ! $ProcessWait ) { 53 | echo "Program dsmadmc did not exit after 1000ms"; 54 | echo $output 55 | $Process.kill() 56 | } 57 | else { 58 | 59 | if($item -Like "tsms.query_status"){ 60 | 61 | $OutputArr = $output.Split(","); 62 | 63 | if($var -Like "Availability"){ 64 | $key = 16 65 | } 66 | else{ 67 | echo ZBX_NOTSUPPORTED 68 | exit 1 69 | } 70 | 71 | if($outputArr[16] -eq "Enabled"){ 72 | echo 1 73 | } 74 | else{ 75 | echo 0 76 | } 77 | 78 | } 79 | else{ 80 | echo $output 81 | } 82 | 83 | } 84 | 85 | -------------------------------------------------------------------------------- /zabbix-templates/tsm-server-on-win/zabbix-agent/tsms.stgpool_usage.ps1: -------------------------------------------------------------------------------- 1 | 2 | Param( 3 | [string]$item, 4 | [string]$poolname 5 | ) 6 | 7 | if( $item -Like "tsms.stgpool_usage_discovery"){ 8 | $sql = "select stgpool_name, EST_CAPACITY_MB, PCT_UTILIZED from stgpools" 9 | } 10 | elseif ($item -Like "tsms.stgpool_usage_cap"){ 11 | $sql = "select EST_CAPACITY_MB*1024*1024 from stgpools WHERE stgpool_name = '$poolname'" 12 | } 13 | elseif ($item -Like "tsms.stgpool_usage_ut"){ 14 | $sql = "select PCT_UTILIZED from stgpools WHERE stgpool_name = '$poolname'" 15 | } 16 | 17 | $command = "C:\Program files\Tivoli\TSM\server\tsmdiag\dsmadmc.exe" 18 | $params = "-id=monitor -pa=monpass -comma -dataonly=yes `"" + $sql + "`" " 19 | 20 | $timeout = "1000" 21 | 22 | [Environment]::SetEnvironmentVariable("DSM_CONFIG", "C:\Progra~1\Tivoli\TSM\server\tsmdiag\dsm.opt", "User") 23 | [Environment]::SetEnvironmentVariable("DSM_DIR", "C:\Progra~1\Tivoli\TSM\server\tsmdiag", "User") 24 | 25 | Set-ExecutionPolicy Unrestricted 26 | 27 | $ProcessInfo = New-Object System.Diagnostics.ProcessStartInfo 28 | $ProcessInfo.FileName = $command 29 | $ProcessInfo.RedirectStandardError = "true" 30 | $ProcessInfo.RedirectStandardOutput = "true" 31 | $ProcessInfo.UseShellExecute = $false 32 | 33 | $ProcessInfo.Arguments = $params 34 | $ProcessInfo.WorkingDirectory = $folder 35 | 36 | $Process = New-Object System.Diagnostics.Process 37 | $Process.StartInfo = $ProcessInfo 38 | $Process.Start() | Out-Null 39 | 40 | $ProcessWait = $Process.WaitForExit($timeout) 41 | 42 | $output = $Process.StandardOutput.ReadToEnd() 43 | 44 | if ( ! $ProcessWait ) { 45 | echo "Program dsmadmc did not exit after 1000ms"; 46 | echo $output 47 | $Process.kill() 48 | } 49 | else { 50 | 51 | # 52 | # parse / or print results 53 | # 54 | 55 | if($item -Like "tsms.stgpool_usage_cap"){ 56 | 57 | $output_rounded = [Math]::Round($output, 0) 58 | echo $output_rounded 59 | 60 | } 61 | elseif($item -Like "tsms.stgpool_usage_ut"){ 62 | 63 | echo $output 64 | } 65 | else{ 66 | 67 | 68 | $rows = $output -split "\s+`n" 69 | 70 | echo "{`n`t`"data`":[" 71 | 72 | for($i=0; $i -lt $rows.length; $i++) { 73 | 74 | $items = $rows[$i] -split "," 75 | $name = $items[0] 76 | 77 | if ( $name.length -gt 0){ 78 | echo "`t`t{ " 79 | echo "`t`t`t`"{#POOLNAME}`":`"$name`"}," 80 | } 81 | } 82 | 83 | echo "`t`t]`n}" 84 | 85 | # debug (all output) 86 | # echo "- - - - - -" 87 | # echo $output 88 | 89 | } 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /zabbix-templates/tsm-server-on-win/zabbix-agent/tsms.db_stats.ps1: -------------------------------------------------------------------------------- 1 | 2 | Param( 3 | [string]$item 4 | ) 5 | 6 | if( $item -Like "tsms.db_used_db_space_mb"){ 7 | $sql = "select USED_DB_SPACE_MB from db" 8 | } 9 | elseif ($item -Like "tsms.db_free_space_db"){ 10 | $sql = "select FREE_SPACE_MB from db" 11 | } 12 | elseif ($item -Like "tsms.node_sessions_count"){ 13 | $sql = "select count(*) from sessions where session_type='Node'" 14 | } 15 | elseif($item -Like "tsms.db_buffer_hit_ratio"){ 16 | $sql = "select BUFF_HIT_RATIO from db" 17 | } 18 | elseif ($item -Like "tsms.log_used_space_mb"){ 19 | $sql = "select USED_SPACE_MB from log" 20 | } 21 | elseif ($item -Like "tsms.log_free_space_mb"){ 22 | $sql = "select FREE_SPACE_MB from log" 23 | } 24 | elseif ($item -Like "tsms.db_archlog_used_space_mb"){ 25 | $sql = "select ARCHLOG_USED_FS_MB from log" 26 | } 27 | elseif ($item -Like "tsms.db_archlog_free_space_mb"){ 28 | $sql = "select ARCHLOG_FREE_FS_MB from log" 29 | } 30 | elseif ($item -Like "tsms.missed_backups"){ 31 | $sql = "q even * * ex=yes begind=-1 begint=06:00 endd=today endt=05:59" 32 | } 33 | elseif ($item -Like "tsms.performed_backups"){ 34 | $sql = "q even * * ex=no begind=-1 begint=06:00 endd=today endt=05:59" 35 | } 36 | elseif ($item -Like "tsms.success_performed_backups"){ 37 | $sql = "select count(*) from summary where activity like 'BACKUP' and TIMESTAMPDIFF(4,CHAR(current_timestamp-start_time)) <= 1440" 38 | } 39 | 40 | $command = "C:\Program files\Tivoli\TSM\server\tsmdiag\dsmadmc.exe" 41 | $params = "-id=monitor -pa=monpass -tab -dataonly=yes `"" + $sql + "`" " 42 | 43 | $timeout = "1000" 44 | 45 | [Environment]::SetEnvironmentVariable("DSM_CONFIG", "C:\Progra~1\Tivoli\TSM\server\tsmdiag\dsm.opt", "User") 46 | [Environment]::SetEnvironmentVariable("DSM_DIR", "C:\Progra~1\Tivoli\TSM\server\tsmdiag", "User") 47 | 48 | Set-ExecutionPolicy Unrestricted 49 | 50 | $ProcessInfo = New-Object System.Diagnostics.ProcessStartInfo 51 | $ProcessInfo.FileName = $command 52 | $ProcessInfo.RedirectStandardError = "true" 53 | $ProcessInfo.RedirectStandardOutput = "true" 54 | $ProcessInfo.UseShellExecute = $false 55 | 56 | $ProcessInfo.Arguments = $params 57 | $ProcessInfo.WorkingDirectory = $folder 58 | 59 | $Process = New-Object System.Diagnostics.Process 60 | $Process.StartInfo = $ProcessInfo 61 | $Process.Start() | Out-Null 62 | 63 | $ProcessWait = $Process.WaitForExit($timeout) 64 | 65 | $output = $Process.StandardOutput.ReadToEnd() 66 | 67 | if ( ! $ProcessWait ) { 68 | echo "Program dsmadmc did not exit after 1000ms"; 69 | echo $output 70 | $Process.kill() 71 | } 72 | else { 73 | echo $output 74 | } 75 | -------------------------------------------------------------------------------- /zabbix-templates/rabbitmq-server/scripts/detect_rabbitmq_nodes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #LIST_NODES=$(sudo /usr/sbin/rabbitmqctl cluster_status|sed -n '3p'| sed -n '/running_nodes,\[.*\]\},/p' | sed -r 's/\[|\]|\{|\}|running_nodes,//g') 4 | 5 | LIST_NODES=$(sudo -u root /usr/sbin/rabbitmqctl cluster_status|sed -n '2p'| grep -o 'running_nodes,\[.*\]\}' | sed -r 's/\[|\]|\{|\}|running_nodes,//g') 6 | 7 | ARRAY_LIST_NODES=$(echo $LIST_NODES | tr "," "\n"| tr "\'" "\ ") 8 | FIRST_ELEMENT=1 9 | type_detect=0 10 | 11 | function json_head { 12 | printf "{" 13 | printf "\"data\":[" 14 | } 15 | 16 | function json_end { 17 | printf "]" 18 | printf "}" 19 | } 20 | 21 | function check_first_element { 22 | if [[ $FIRST_ELEMENT -ne 1 ]]; then 23 | printf "," 24 | fi 25 | FIRST_ELEMENT=0 26 | } 27 | 28 | function nodes_detect { 29 | json_head 30 | for node in $ARRAY_LIST_NODES 31 | do 32 | local VHOST_LIST=$(sudo /usr/sbin/rabbitmqctl -n ${node} list_vhosts|sed '1d'|sed '/...done./d') 33 | for vhost in $VHOST_LIST 34 | do 35 | local vhost_t=$(echo $vhost| sed 's!/!\\/!g') 36 | local node_t=$(echo $node| sed 's!@!__dog__!g') 37 | #only nodes 38 | if [[ $type_detect -eq 0 ]]; then 39 | check_first_element 40 | printf "{" 41 | printf "\"{#NODENAME}\":\"$node_t\", \"{#VHOSTNAME}\":\"$vhost_t\"" 42 | printf "}" 43 | fi 44 | #queue 45 | if [[ $type_detect -eq 1 ]]; then 46 | local list_queue=$(sudo /usr/sbin/rabbitmqctl -n ${node} -p ${vhost} list_queues | sed '1d'|sed '/...done./d'|awk '{print $1}') 47 | for queue in $list_queue 48 | do 49 | check_first_element 50 | printf "{" 51 | printf "\"{#NODENAME}\":\"$node_t\", \"{#VHOSTNAME}\":\"$vhost_t\", \"{#QUEUENAME}\":\"$queue\" " 52 | printf "}" 53 | done 54 | fi 55 | #exchanges 56 | if [[ $type_detect -eq 2 ]]; then 57 | local list_exchange=$(sudo /usr/sbin/rabbitmqctl -n ${node} -p ${vhost} list_exchanges | sed '1d'|sed '/...done./d'|awk '{print $1}') 58 | for exchange in $list_exchange 59 | do 60 | check_first_element 61 | printf "{" 62 | printf "\"{#NODENAME}\":\"$node_t\", \"{#VHOSTNAME}\":\"$vhost_t\", \"{#EXCHANGENAME}\":\"$exchange\" " 63 | printf "}" 64 | done 65 | fi 66 | done 67 | done 68 | json_end 69 | } 70 | 71 | case $1 in 72 | queue) 73 | type_detect=1 74 | nodes_detect 75 | ;; 76 | exchange) 77 | type_detect=2 78 | nodes_detect 79 | ;; 80 | *) 81 | type_detect=0 82 | nodes_detect 83 | ;; 84 | esac -------------------------------------------------------------------------------- /zabbix-templates/snmp_interfaces_-_Advanced/docs-verification/example_run.md: -------------------------------------------------------------------------------- 1 | Example run 2 | ========= 3 | 4 | Juniper switches in VC 5 | ------- 6 | 7 | snmpwalk 8 | --------------- 9 | ``` 10 | [root@monitoring-zabbix]# snmpwalk -c public -v1 172.x.0.111 .1.3.6.1.2.1.2.2.1 11 | IF-MIB::ifIndex.4 = INTEGER: 4 12 | IF-MIB::ifIndex.5 = INTEGER: 5 13 | IF-MIB::ifIndex.6 = INTEGER: 6 14 | IF-MIB::ifIndex.7 = INTEGER: 7 15 | . 16 | . 17 | . 18 | IF-MIB::ifIndex.538 = INTEGER: 538 19 | IF-MIB::ifIndex.540 = INTEGER: 540 20 | IF-MIB::ifIndex.542 = INTEGER: 542 21 | . 22 | . 23 | . 24 | IF-MIB::ifDescr.501 = STRING: ge-0/0/0 25 | IF-MIB::ifDescr.502 = STRING: ge-0/0/0.0 26 | IF-MIB::ifDescr.503 = STRING: ge-0/0/1 27 | IF-MIB::ifDescr.505 = STRING: ge-0/0/10 28 | IF-MIB::ifDescr.506 = STRING: ge-0/0/11 29 | . 30 | . 31 | . 32 | IF-MIB::ifOperStatus.10 = INTEGER: up(1) 33 | IF-MIB::ifOperStatus.11 = INTEGER: up(1) 34 | IF-MIB::ifOperStatus.12 = INTEGER: up(1) 35 | IF-MIB::ifOperStatus.21 = INTEGER: up(1) 36 | IF-MIB::ifOperStatus.33 = INTEGER: down(2) 37 | IF-MIB::ifOperStatus.34 = INTEGER: lowerLayerDown(7) 38 | IF-MIB::ifOperStatus.35 = INTEGER: down(2) 39 | IF-MIB::ifOperStatus.37 = INTEGER: up(1) 40 | IF-MIB::ifOperStatus.38 = INTEGER: up(1) 41 | IF-MIB::ifOperStatus.39 = INTEGER: down(2) 42 | IF-MIB::ifOperStatus.40 = INTEGER: down(2) 43 | IF-MIB::ifOperStatus.41 = INTEGER: down(2) 44 | . 45 | . 46 | . 47 | ``` 48 | 49 | snmp iface advanced discovery 50 | --------------- 51 | 52 | ``` 53 | [root@monitoring-zabbix externalscripts]# ./snmp_iface_advanced_discovery.pl public 172.x.0.111 .1.3.6.1.2.1.2.2.1 54 | 55 | { 56 | "data":[ 57 | { 58 | "{#STATUS}":"1", 59 | "{#NAME}":"ipip", 60 | "{#ID}":"9", 61 | "{#ALL}":"-1--ipip--9-", 62 | } 63 | , 64 | { 65 | "{#STATUS}":"2", 66 | "{#NAME}":"ge-7/0/5", 67 | "{#ID}":"802", 68 | "{#ALL}":"-2--ge-7/0/5--802-", 69 | } 70 | , 71 | { 72 | "{#STATUS}":"1", 73 | "{#NAME}":"bme0.32768", 74 | "{#ID}":"38", 75 | "{#ALL}":"-1--bme0.32768--38-", 76 | } 77 | , 78 | { 79 | "{#STATUS}":"1", 80 | "{#NAME}":"lsi", 81 | "{#ID}":"4", 82 | "{#ALL}":"-1--lsi--4-", 83 | } 84 | , 85 | { 86 | "{#STATUS}":"7", 87 | "{#NAME}":"me0.0", 88 | "{#ID}":"34", 89 | "{#ALL}":"-7--me0.0--34-", 90 | } 91 | , 92 | { 93 | "{#STATUS}":"2", 94 | "{#NAME}":"ge-8/0/44", 95 | "{#ID}":"745", 96 | "{#ALL}":"-2--ge-8/0/44--745-", 97 | } 98 | ] 99 | } 100 | ``` 101 | 102 | License 103 | ------- 104 | 105 | This template were distributed under GNU General Public License 2. 106 | 107 | ### Copyright 108 | 109 | Copyright (c) 2014 Patrik Majer 110 | 111 | ### Authors 112 | 113 | Patrik Majer 114 | (patrik.majer.pisek |at| gmail |dot| com) 115 | 116 | -------------------------------------------------------------------------------- /zabbix-templates/linux-disk-io-stats/usr-local-bin/discover_disk.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # G. Husson - Thalos - 20120713 4 | # Zabbix 2 - disk autodiscovery for linux 5 | # all disks listed in /proc/diskstats are returned 6 | # special processing on LVMs 7 | # special processing on Proxmox VE disks (VM id and VM name are returned) 8 | # rq : in Zabbix, create a regexp filter on which disks you want to monitor on your IT System 9 | # ex : ^(hd[a-z]+|sd[a-z]+|vd[a-z]+|dm-[0-9]+|drbd[0-9]+)$ 10 | # ^(loop[0-9]+|sr[0-9]*|fd[0-9]*)$ 11 | 12 | # Custom keys : 13 | #UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$4}' 14 | #UserParameter=custom.vfs.dev.read.ms[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$7}' 15 | #UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$8}' 16 | #UserParameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$11}' 17 | #UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$12}' 18 | #UserParameter=custom.vfs.dev.io.ms[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$13}' 19 | #UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$6}' 20 | #UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep "$1" | head -1 | awk '{print $$10}' 21 | 22 | # Discovery items creation : 23 | #Disk {#VMNAME}:{#DMNAME} io spent custom.vfs.dev.io.ms[{#DISK}] 24 | #Disk {#VMNAME}:{#DMNAME} read bw custom.vfs.dev.read.sectors[{#DISK}] 25 | #Disk {#VMNAME}:{#DMNAME} read io custom.vfs.dev.read.ops[{#DEV}] 26 | #Disk {#VMNAME}:{#DMNAME} write bw custom.vfs.dev.write.sectors[{#DISK}] 27 | #Disk {#VMNAME}:{#DMNAME} write io custom.vfs.dev.write.ops[{#DEV}] 28 | 29 | # give disk dmname, returns Proxmox VM name 30 | sub get_vmname_by_id 31 | { 32 | $vmname=`cat /etc/qemu-server/$_[0].conf | grep name | cut -d \: -f 2`; 33 | $vmname =~ s/^\s+//; #remove leading spaces 34 | $vmname =~ s/\s+$//; #remove trailing spaces 35 | return $vmname 36 | } 37 | 38 | $first = 1; 39 | print "{\n"; 40 | print "\t\"data\":[\n\n"; 41 | 42 | for (`cat /proc/diskstats`) 43 | { 44 | ($major,$minor,$disk) = m/^\s*([0-9]+)\s+([0-9]+)\s+(\S+)\s.*$/; 45 | $dmnamefile = "/sys/dev/block/$major:$minor/dm/name"; 46 | $vmid= ""; 47 | $vmname = ""; 48 | $dmname = $disk; 49 | $diskdev = "/dev/$disk"; 50 | # DM name 51 | if (-e $dmnamefile) { 52 | $dmname = `cat $dmnamefile`; 53 | $dmname =~ s/\n$//; #remove trailing \n 54 | $diskdev = "/dev/mapper/$dmname"; 55 | # VM name and ID 56 | if ($dmname =~ m/^.*--([0-9]+)--.*$/) { 57 | $vmid = $1; 58 | #$vmname = get_vmname_by_id($vmid); 59 | } 60 | } 61 | #print("$major $minor $disk $diskdev $dmname $vmid $vmname \n"); 62 | 63 | print "\t,\n" if not $first; 64 | $first = 0; 65 | 66 | print "\t{\n"; 67 | print "\t\t\"{#DISK}\":\"$disk\",\n"; 68 | print "\t\t\"{#DISKDEV}\":\"$diskdev\",\n"; 69 | print "\t\t\"{#DMNAME}\":\"$dmname\",\n"; 70 | print "\t\t\"{#VMNAME}\":\"$vmname\",\n"; 71 | print "\t\t\"{#VMID}\":\"$vmid\"\n"; 72 | print "\t}\n"; 73 | } 74 | 75 | print "\n\t]\n"; 76 | print "}\n"; 77 | 78 | 79 | -------------------------------------------------------------------------------- /zabbix-templates/snmp_interfaces_-_Advanced/external-scripts/snmp_iface_advanced_discovery.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Net::SNMP v5.1.0 qw(:snmp DEBUG_ALL); 7 | use Getopt::Std; 8 | 9 | my $snmp_community = $ARGV[0]; 10 | # ip 11 | my $ip = $ARGV[1]; 12 | #snmp oid 13 | my $snmp_oid = $ARGV[2]; 14 | #timeout for snmpwalk 15 | my $timeout = 5; 16 | 17 | if ( $#ARGV != 2 ) 18 | { 19 | print " Not enough parameters\n"; 20 | print " Usage: ibm_amm_snmpget.sh \n"; 21 | exit 2; 22 | } 23 | 24 | my ($s, $e) = Net::SNMP->session( 25 | -hostname => $ip, 26 | -version => 1, 27 | -community => $snmp_community, 28 | # exists($OPTS{a}) ? (-authprotocol => $OPTS{a}) : (), 29 | # exists($OPTS{A}) ? (-authpassword => $OPTS{A}) : (), 30 | # exists($OPTS{D}) ? (-domain => $OPTS{D}) : (), 31 | # exists($OPTS{d}) ? (-debug => DEBUG_ALL) : (), 32 | # exists($OPTS{m}) ? (-maxmsgsize => $OPTS{m}) : (), 33 | # exists($OPTS{r}) ? (-retries => $OPTS{r}) : (), 34 | # exists($OPTS{t}) ? (-timeout => $OPTS{t}) : (), 35 | # exists($OPTS{u}) ? (-username => $OPTS{u}) : (), 36 | # exists($OPTS{v}) ? (-version => $OPTS{v}) : (), 37 | # exists($OPTS{x}) ? (-privprotocol => $OPTS{x}) : (), 38 | # exists($OPTS{X}) ? (-privpassword => $OPTS{X}) : () 39 | ); 40 | 41 | # Was the session created? 42 | if (!defined($s)) { 43 | _exit($e); 44 | } 45 | 46 | # 47 | # WALK 48 | # 49 | my @args = (-varbindlist => [$snmp_oid.".1"] ); 50 | 51 | my $oid; 52 | 53 | my %arr; 54 | 55 | while (defined($s->get_next_request(@args))) 56 | { 57 | $oid = ($s->var_bind_names())[0]; 58 | 59 | if (!oid_base_match($snmp_oid.".1", $oid)) { last; } 60 | 61 | # INDEX 62 | my $id1 = $s->var_bind_list()->{$oid}; 63 | $arr{$id1}{"id"} = $id1; 64 | 65 | # NAME 66 | my $oid_name = $snmp_oid.".2.".$id1; 67 | my $rs = $s->get_request(-varbindlist => [$oid_name],); 68 | 69 | $arr{$id1}{"name"} = $rs->{$oid_name}; 70 | 71 | # print "DEBUG:\n oid: ". $oid . " \n oid_name: " .$oid_name . "\n name: " . $rs->{$oid_name} . "\n"; 72 | 73 | #OperStatus 74 | my $oid_status = $snmp_oid.".8.".$id1; 75 | my $rs2 = $s->get_request(-varbindlist => [$oid_status],); 76 | 77 | $arr{$id1}{"status"} = $rs2->{$oid_status}; 78 | 79 | # print "DEBUG:\n oid: ". $oid . " \n oid_status: " .$oid_name . "\n status: " . $rs2->{$oid_status} . "\n"; 80 | 81 | 82 | @args = (-varbindlist => [$oid]); 83 | } 84 | 85 | # 86 | # PRINT RESULT 87 | # 88 | 89 | my $id; 90 | my $role; 91 | 92 | my $firstline = 1; 93 | print "{\n"; 94 | print "\t\"data\":[\n"; 95 | 96 | for $id ( keys %arr) { 97 | 98 | print "\t,\n" if not $firstline; 99 | $firstline = 0; 100 | 101 | print "\t{\n"; 102 | 103 | my $all = ""; 104 | 105 | for $role ( keys %{ $arr{$id} } ) { 106 | print "\t\t\"{#".uc($role)."}\":\"" . $arr{$id}{$role} ."\",\n"; 107 | $all .= "-".$arr{$id}{$role}."-"; 108 | } 109 | print "\t\t\"{#".uc("all")."}\":\"" . $all ."\"\n"; 110 | 111 | print "\t}\n"; 112 | } 113 | 114 | print "\n\t]\n"; 115 | print "}\n"; 116 | 117 | # 118 | # END 119 | # 120 | $s->close(); 121 | 122 | exit 0; 123 | 124 | # 125 | # [private functions] 126 | # 127 | sub _exit 128 | { 129 | printf join('', sprintf("%s: ", "snmp_advaced_discovery.pl"), shift(@_), ".\n"), @_; 130 | exit 1; 131 | } 132 | 133 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/scripts/svc_perf_discovery_sender_zabbix.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- # coding: utf-8 3 | # 4 | # IBM Storwize V7000 autodiscovery script for Zabbix 5 | # 6 | # 2013 Matvey Marinin 7 | # 8 | # Sends volume/mdisk/pool LLD JSON data to LLD trapper items "svc.discovery." 9 | # Use with "_Special_Storwize_Perf" Zabbix template 10 | # 11 | # See also http://www.zabbix.com/documentation/2.0/manual/discovery/low_level_discovery 12 | # 13 | # Usage: 14 | # svc_perf_discovery_sender.py [--debug] --clusters [,...] --user --password 15 | # 16 | # --debug = Enable debug output 17 | # --clusters = Comma-separated Storwize node list 18 | # --user = Storwize V7000 user account with Administrator role (it seems that Monitor role is not enough) 19 | # --password = User password 20 | # 21 | import pywbem 22 | import getopt, sys 23 | from zbxsend import Metric, send_to_zabbix 24 | import logging 25 | 26 | def usage(): 27 | print >> sys.stderr, "Usage: svc_perf_discovery_sender_zabbix.py [--debug] --clusters [,...] --user --password --discovery-types ,[type2]" 28 | print >> sys.stderr, "Discovery types: 'volume-mdisk','volume','mdisk','pool'" 29 | 30 | 31 | try: 32 | opts, args = getopt.gnu_getopt(sys.argv[1:], "-h", ["help", "clusters=", "user=", "password=", "debug", "discovery-types="]) 33 | except getopt.GetoptError, err: 34 | print >> sys.stderr, str(err) 35 | usage() 36 | sys.exit(2) 37 | 38 | debug = False 39 | clusters = [] 40 | DISCOVERY_TYPES = [] 41 | user = None 42 | password = None 43 | for o, a in opts: 44 | if o == "--clusters" and not a.startswith('--'): 45 | clusters.extend( a.split(',')) 46 | elif o == "--user" and not a.startswith('--'): 47 | user = a 48 | elif o == "--password" and not a.startswith('--'): 49 | password = a 50 | elif o == "--debug": 51 | debug = True 52 | elif o == "--discovery-types": 53 | DISCOVERY_TYPES.extend( a.split(',')) 54 | elif o in ("-h", "--help"): 55 | usage() 56 | sys.exit() 57 | 58 | if not clusters: 59 | print >> sys.stderr, '--clusters option must be set' 60 | usage() 61 | sys.exit(2) 62 | 63 | if not DISCOVERY_TYPES: 64 | print >> sys.stderr, '--discovery-types option must be set' 65 | usage() 66 | sys.exit(2) 67 | 68 | if not user or not password: 69 | print >> sys.stderr, '--user and --password options must be set' 70 | usage() 71 | sys.exit(2) 72 | 73 | def debug_print(message): 74 | if debug: 75 | print message 76 | 77 | for cluster in clusters: 78 | debug_print('Connecting to: %s' % cluster) 79 | conn = pywbem.WBEMConnection('https://'+cluster, (user, password), 'root/ibm') 80 | conn.debug = True 81 | 82 | for discovery in DISCOVERY_TYPES: 83 | output = [] 84 | 85 | if discovery == 'volume-mdisk' or discovery == 'volume': 86 | for vol in conn.ExecQuery('WQL', 'select DeviceID, ElementName from IBMTSSVC_StorageVolume'): 87 | output.append( '{"{#TYPE}":"%s", "{#NAME}":"%s", "{#ID}":"%s"}' % ('volume', vol.properties['ElementName'].value, vol.properties['DeviceID'].value) ) 88 | 89 | if discovery == 'volume-mdisk' or discovery == 'mdisk': 90 | for mdisk in conn.ExecQuery('WQL', 'select DeviceID, ElementName from IBMTSSVC_BackendVolume'): 91 | output.append( '{"{#TYPE}":"%s", "{#NAME}":"%s", "{#ID}":"%s"}' % ('mdisk', mdisk.properties['ElementName'].value, mdisk.properties['DeviceID'].value) ) 92 | 93 | if discovery == 'pool': 94 | for pool in conn.ExecQuery('WQL', 'select PoolID, ElementName from IBMTSSVC_ConcreteStoragePool'): 95 | output.append( '{"{#TYPE}":"%s","{#NAME}":"%s","{#ID}":"%s"}' % ('pool', pool.properties['ElementName'].value, pool.properties['PoolID'].value) ) 96 | 97 | json = [] 98 | json.append('{"data":[') 99 | 100 | for i, v in enumerate( output ): 101 | if i < len(output)-1: 102 | json.append(v+',') 103 | else: 104 | json.append(v) 105 | json.append(']}') 106 | 107 | json_string = ''.join(json) 108 | print(json_string) 109 | 110 | trapper_key = 'svc.discovery.%s' % discovery 111 | debug_print('Sending to host=%s, key=%s' % (cluster, trapper_key)) 112 | 113 | #send json to LLD trapper item with zbxsend module 114 | if debug: 115 | logging.basicConfig(level=logging.INFO) 116 | else: 117 | logging.basicConfig(level=logging.WARNING) 118 | send_to_zabbix([Metric(cluster, trapper_key, json_string)], 'localhost', 10051) 119 | debug_print('') 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /zabbix-templates/juniper-switches/docs-verification/zbx_juniper_cpu_usage.md: -------------------------------------------------------------------------------- 1 | Verification of "CPU Usage" 2 | ========= 3 | 4 | EX4500 5 | ------- 6 | -with virtual routing instances .. 7 | 8 | snmpwalk 9 | --------------- 10 | ``` 11 | [root@monitoring-zabbix]# snmpwalk -v 2c -c TETS-VR@public 10.0.0.10 .1.3.6.1.4.1.2636.3.1.13.1.5 12 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.1.1.0.0 = "" 13 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.2.1.2.0 = STRING: "Power Supply 1" 14 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.4.1.1.1 = STRING: "Fan 1" 15 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.4.1.1.2 = STRING: "Fan 2" 16 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.4.1.1.3 = STRING: "Fan 3" 17 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.4.1.1.4 = STRING: "Fan 4" 18 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.4.1.1.5 = STRING: "Fan 5" 19 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.7.1.0.0 = STRING: "FPC: EX4500-40F @ 0/*/*" 20 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.8.1.1.0 = STRING: "PIC: 40x 1/10GE @ 0/0/*" 21 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.8.1.4.0 = STRING: "PIC: 2x 32GE Virtual Chassis Module @ 0/3/*" 22 | SNMPv2-SMI::enterprises.2636.3.1.13.1.5.9.1.0.0 = STRING: "Routing Engine 0" 23 | ``` 24 | 25 | advsnmp.discovery 26 | --------------- 27 | 28 | ``` 29 | [root@monitoring-zabbix externalscripts]# ./advsnmp.discovery.old 10.0.0.10 "-v2c -c TEST-VR@public" .1.3.6.1.4.1.2636.3.1.13.1.5 1.1 2.1 3.2 30 | { 31 | "data":[ 32 | { 33 | "{#ADVSNMPINDEX1}": "", 34 | "{#ADVSNMPINDEX2}": "1", 35 | "{#ADVSNMPINDEX3}": "1", 36 | "{#ADVSNMPINDEX4}": "0.0", 37 | "{#ADVSNMPVALUE}":"" 38 | } , 39 | { 40 | "{#ADVSNMPINDEX1}": "", 41 | "{#ADVSNMPINDEX2}": "2", 42 | "{#ADVSNMPINDEX3}": "1", 43 | "{#ADVSNMPINDEX4}": "2.0", 44 | "{#ADVSNMPVALUE}":"Power Supply 1" 45 | } , 46 | { 47 | "{#ADVSNMPINDEX1}": "", 48 | "{#ADVSNMPINDEX2}": "4", 49 | "{#ADVSNMPINDEX3}": "1", 50 | "{#ADVSNMPINDEX4}": "1.1", 51 | "{#ADVSNMPVALUE}":"Fan 1" 52 | } , 53 | { 54 | "{#ADVSNMPINDEX1}": "", 55 | "{#ADVSNMPINDEX2}": "4", 56 | "{#ADVSNMPINDEX3}": "1", 57 | "{#ADVSNMPINDEX4}": "1.2", 58 | "{#ADVSNMPVALUE}":"Fan 2" 59 | } , 60 | { 61 | "{#ADVSNMPINDEX1}": "", 62 | "{#ADVSNMPINDEX2}": "4", 63 | "{#ADVSNMPINDEX3}": "1", 64 | "{#ADVSNMPINDEX4}": "1.3", 65 | "{#ADVSNMPVALUE}":"Fan 3" 66 | } , 67 | { 68 | "{#ADVSNMPINDEX1}": "", 69 | "{#ADVSNMPINDEX2}": "4", 70 | "{#ADVSNMPINDEX3}": "1", 71 | "{#ADVSNMPINDEX4}": "1.4", 72 | "{#ADVSNMPVALUE}":"Fan 4" 73 | } , 74 | { 75 | "{#ADVSNMPINDEX1}": "", 76 | "{#ADVSNMPINDEX2}": "4", 77 | "{#ADVSNMPINDEX3}": "1", 78 | "{#ADVSNMPINDEX4}": "1.5", 79 | "{#ADVSNMPVALUE}":"Fan 5" 80 | } , 81 | { 82 | "{#ADVSNMPINDEX1}": "", 83 | "{#ADVSNMPINDEX2}": "7", 84 | "{#ADVSNMPINDEX3}": "1", 85 | "{#ADVSNMPINDEX4}": "0.0", 86 | "{#ADVSNMPVALUE}":"FPC: EX4500-40F @ 0/*/*" 87 | } , 88 | { 89 | "{#ADVSNMPINDEX1}": "", 90 | "{#ADVSNMPINDEX2}": "8", 91 | "{#ADVSNMPINDEX3}": "1", 92 | "{#ADVSNMPINDEX4}": "1.0", 93 | "{#ADVSNMPVALUE}":"PIC: 40x 1/10GE @ 0/0/*" 94 | } , 95 | { 96 | "{#ADVSNMPINDEX1}": "", 97 | "{#ADVSNMPINDEX2}": "8", 98 | "{#ADVSNMPINDEX3}": "1", 99 | "{#ADVSNMPINDEX4}": "4.0", 100 | "{#ADVSNMPVALUE}":"PIC: 2x 32GE Virtual Chassis Module @ 0/3/*" 101 | } , 102 | { 103 | "{#ADVSNMPINDEX1}": "", 104 | "{#ADVSNMPINDEX2}": "9", 105 | "{#ADVSNMPINDEX3}": "1", 106 | "{#ADVSNMPINDEX4}": "0.0", 107 | "{#ADVSNMPVALUE}":"Routing Engine 0" 108 | } 109 | ] 110 | } 111 | ``` 112 | 113 | License 114 | ------- 115 | 116 | This template were distributed under GNU General Public License 2. 117 | 118 | ### Copyright 119 | 120 | Copyright (c) 2013 Patrik Majer 121 | 122 | ### Authors 123 | 124 | Patrik Majer 125 | (patrik.majer.pisek |at| gmail |dot| com) 126 | 127 | -------------------------------------------------------------------------------- /zabbix-templates/3ware-raid/3ware_value_mappings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 3.0 6 | 7 | 2016-03-07T07:54:45Z 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 3ware BBU statuses 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 0 24 | 25 | Not Present 26 | 27 | 28 | 29 | 30 | 31 | 32 | 1 33 | 34 | Testing 35 | 36 | 37 | 38 | 39 | 40 | 41 | 2 42 | 43 | Charging 44 | 45 | 46 | 47 | 48 | 49 | 50 | 3 51 | 52 | OK 53 | 54 | 55 | 56 | 57 | 58 | 59 | 4 60 | 61 | WeakBat 62 | 63 | 64 | 65 | 66 | 67 | 68 | 5 69 | 70 | Failed 71 | 72 | 73 | 74 | 75 | 76 | 77 | 6 78 | 79 | Error 80 | 81 | 82 | 83 | 84 | 85 | 86 | 7 87 | 88 | Fault 89 | 90 | 91 | 92 | 93 | 94 | 95 | 8 96 | 97 | Unknown 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 3ware opts statuses 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 1 117 | 118 | OK 119 | 120 | 121 | 122 | 123 | 124 | 125 | 2 126 | 127 | HIGH 128 | 129 | 130 | 131 | 132 | 133 | 134 | 3 135 | 136 | LOW 137 | 138 | 139 | 140 | 141 | 142 | 143 | 4 144 | 145 | TOO-HIGH 146 | 147 | 148 | 149 | 150 | 151 | 152 | 5 153 | 154 | TOO-LOW 155 | 156 | 157 | 158 | 159 | 160 | 161 | 6 162 | 163 | UNKNOWN 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 3ware statuses 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 1 183 | 184 | OK 185 | 186 | 187 | 188 | 189 | 190 | 191 | 2 192 | 193 | VERIFYING 194 | 195 | 196 | 197 | 198 | 199 | 200 | 3 201 | 202 | INITIALIZING 203 | 204 | 205 | 206 | 207 | 208 | 209 | 4 210 | 211 | INIT-PAUSED 212 | 213 | 214 | 215 | 216 | 217 | 218 | 5 219 | 220 | REBUILDING 221 | 222 | 223 | 224 | 225 | 226 | 227 | 6 228 | 229 | REBUILD-PAUSED 230 | 231 | 232 | 233 | 234 | 235 | 236 | 7 237 | 238 | DEGRADED 239 | 240 | 241 | 242 | 243 | 244 | 245 | 8 246 | 247 | MIGRATING 248 | 249 | 250 | 251 | 252 | 253 | 254 | 9 255 | 256 | MIGRATE-PAUSED 257 | 258 | 259 | 260 | 261 | 262 | 263 | 10 264 | 265 | RECOVERY 266 | 267 | 268 | 269 | 270 | 271 | 272 | 11 273 | 274 | INOPERABLE 275 | 276 | 277 | 278 | 279 | 280 | 281 | 255 282 | 283 | UNKNOWN 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | Storage Device Type 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 1 303 | 304 | SAS 305 | 306 | 307 | 308 | 309 | 310 | 311 | 2 312 | 313 | SSD 314 | 315 | 316 | 317 | 318 | 319 | 320 | 255 321 | 322 | Unknown 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | Storage Device Status 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 1 343 | 344 | OK 345 | 346 | 347 | 348 | 349 | 350 | 351 | 0 352 | 353 | Error 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | -------------------------------------------------------------------------------- /zabbix-templates/tsm-server-on-win/zabbix-agent/conf/_part_zabbix_agentd.win.conf: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # template tsm server 4 | # 5 | #UserParameter = tsms.db_used_db_space_mb,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_used_db_space_mb.ps1" 6 | UserParameter = tsms.db_used_db_space_mb,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.db_used_db_space_mb 7 | UserParameter = tsms.db_free_space_mb,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.db_free_space_db 8 | 9 | UserParameter = tsms.node_sessions_count,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.node_sessions_count 10 | UserParameter = tsms.db_buffer_hit_ratio,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.db_buffer_hit_ratio 11 | 12 | UserParameter = tsms.log_used_space_mb,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.log_used_space_mb 13 | UserParameter = tsms.log_free_space_mb,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.log_free_space_mb 14 | 15 | UserParameter = tsms.db_archlog_used_space_mb,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.db_archlog_used_space_mb 16 | UserParameter = tsms.db_archlog_free_space_mb,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.db_archlog_free_space_mb 17 | 18 | UserParameter = tsms.stgpool_usage_discovery,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.stgpool_usage.ps1" -item tsms.stgpool_usage_discovery 19 | UserParameter = tsms.stgpool_usage_cap[*],%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.stgpool_usage.ps1" -item tsms.stgpool_usage_cap -poolname $1 20 | UserParameter = tsms.stgpool_usage_ut[*],%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.stgpool_usage.ps1" -item tsms.stgpool_usage_ut -poolname $1 21 | 22 | UserParameter = tsms.missed_backups,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.missed_backups 23 | UserParameter = tsms.performed_backups,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.performed_backups 24 | UserParameter = tsms.success_performed_backups,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.db_stats.ps1" -item tsms.success_performed_backups 25 | 26 | UserParameter = tsms.occupancy_usage_discovery,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.occupancy_usage.ps1" -item tsms.occupancy_usage_discovery 27 | UserParameter = tsms.occupancy_usage_node[*],%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.occupancy_usage.ps1" -item tsms.occupancy_usage_node -nodename $1 28 | 29 | UserParameter = tsms.count_of_completed_backups,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.global_stats.ps1" -item tsms.count_of_completed_backups 30 | UserParameter = tsms.count_of_failed_backups,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.global_stats.ps1" -item tsms.count_of_failed_backups 31 | UserParameter = tsms.count_of_missed_backups,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.global_stats.ps1" -item tsms.count_of_missed_backups 32 | UserParameter = tsms.query_status[*],%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.global_stats.ps1" -item tsms.query_status -var $1 33 | 34 | UserParameter = tsms.d_amount_discovery,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.d_amount_usage.ps1" -item tsms.d_amount_discovery 35 | UserParameter = tsms.d_amount_usage[*],%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -file "C:\Program Files\zabbix_agents_2.0.6.win\tsms.d_amount_usage.ps1" -item tsms.d_amount_usage -entityname $1 36 | -------------------------------------------------------------------------------- /zabbix-templates/juniper-switches/Juniper_Switch_-_Generic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2014-10-07T12:35:30Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 109 | 110 | 111 | 112 | {Template SNMP_Juniper Switch - Generic:sysUpTime.change(0)}<0 113 | {HOST.NAME} has just been restarted 114 | 115 | 0 116 | 1 117 | 118 | 0 119 | 120 | 121 | 122 | {Template SNMP_Juniper Switch - Generic:icmpping.last(0)}=0 123 | {HOST.NAME} is UNREACHABLE or DOWN 124 | 125 | 0 126 | 5 127 | 128 | 0 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /zabbix-templates/mysql-server/zabbix_agentd/zabbixmysql-new.conf: -------------------------------------------------------------------------------- 1 | # Add ss_get_mysql_stats.php to /etc/zabbix/scripts, make sure 'php -v' returns php version (i.e. php works) 2 | # 3 | # Run also SQL query: 4 | # 5 | # CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password'; 6 | # GRANT REPLICATION CLIENT, SELECT, PROCESS, SHOW DATABASES ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY 'password'; 7 | # FLUSH PRIVILEGES; 8 | 9 | UserParameter=mysql.setting.pool_size,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gq | awk -F: '{ print $2 }' 10 | # 11 | UserParameter=mysql.database_pages,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gs | awk -F: '{ print $2 }' 12 | UserParameter=mysql.free_pages,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gr | awk -F: '{ print $2 }' 13 | UserParameter=mysql.modified_pages,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gt | awk -F: '{ print $2 }' 14 | UserParameter=mysql.pages_read,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gu | awk -F: '{ print $2 }' 15 | UserParameter=mysql.pages_created,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gv | awk -F: '{ print $2 }' 16 | UserParameter=mysql.pages_written,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gw | awk -F: '{ print $2 }' 17 | # 18 | UserParameter=mysql.total_mem_alloc,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items nl | awk -F: '{ print $2 }' 19 | UserParameter=mysql.additional_pool_alloc,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items nm | awk -F: '{ print $2 }' 20 | # 21 | UserParameter=mysql.hash_index_cells_total,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items nj | awk -F: '{ print $2 }' 22 | UserParameter=mysql.hash_index_cells_used,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items nk | awk -F: '{ print $2 }' 23 | # 24 | UserParameter=mysql.ibuf_inserts,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hq | awk -F: '{ print $2 }' 25 | UserParameter=mysql.ibuf_merged,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hr | awk -F: '{ print $2 }' 26 | UserParameter=mysql.ibuf_merges,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hs | awk -F: '{ print $2 }' 27 | # 28 | UserParameter=mysql.ibuf_used_cells,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items no | awk -F: '{ print $2 }' 29 | UserParameter=mysql.ibuf_free_cells,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items np | awk -F: '{ print $2 }' 30 | UserParameter=mysql.ibuf_cell_count,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items nq | awk -F: '{ print $2 }' 31 | # 32 | UserParameter=mysql.spin_waits,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items ht | awk -F: '{ print $2 }' 33 | UserParameter=mysql.spin_rounds,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hu | awk -F: '{ print $2 }' 34 | UserParameter=mysql.os_waits,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hv | awk -F: '{ print $2 }' 35 | # 36 | UserParameter=mysql.rows_inserted,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hw | awk -F: '{ print $2 }' 37 | UserParameter=mysql.rows_updated,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hx | awk -F: '{ print $2 }' 38 | UserParameter=mysql.rows_deleted,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hy | awk -F: '{ print $2 }' 39 | UserParameter=mysql.rows_read,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hz | awk -F: '{ print $2 }' 40 | # 41 | UserParameter=mysql.pool_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items qo | awk -F: '{ print $2 }' 42 | UserParameter=mysql.pool_read_requests,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items qp | awk -F: '{ print $2 }' 43 | # 44 | UserParameter=mysql.unflushed_log,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items lg | awk -F: '{ print $2 }' 45 | UserParameter=mysql.log_bytes_flushed,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items lh | awk -F: '{ print $2 }' 46 | UserParameter=mysql.log_bytes_written,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items li | awk -F: '{ print $2 }' 47 | # 48 | UserParameter=mysql.file_fsyncs,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gx | awk -F: '{ print $2 }' 49 | UserParameter=mysql.file_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gy | awk -F: '{ print $2 }' 50 | UserParameter=mysql.file_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items gz | awk -F: '{ print $2 }' 51 | UserParameter=mysql.log_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hg | awk -F: '{ print $2 }' 52 | # 53 | UserParameter=mysql.pending_aio_log_ios,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hh | awk -F: '{ print $2 }' 54 | UserParameter=mysql.pending_aio_sync_ios,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hi | awk -F: '{ print $2 }' 55 | UserParameter=mysql.pending_buf_pool_flushes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hj | awk -F: '{ print $2 }' 56 | UserParameter=mysql.pending_chkp_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hk | awk -F: '{ print $2 }' 57 | UserParameter=mysql.pending_ibuf_aio_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hl | awk -F: '{ print $2 }' 58 | UserParameter=mysql.pending_log_flushes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hm | awk -F: '{ print $2 }' 59 | UserParameter=mysql.pending_log_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hn | awk -F: '{ print $2 }' 60 | UserParameter=mysql.pending_normal_aio_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items ho | awk -F: '{ print $2 }' 61 | UserParameter=mysql.pending_normal_aio_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats_new.php --host localhost --items hp | awk -F: '{ print $2 }' 62 | -------------------------------------------------------------------------------- /zabbix-templates/README.md: -------------------------------------------------------------------------------- 1 | Zabbix-templates 2 | ========= 3 | 4 | A collection of Zabbix templates 5 | 6 | 7 | A. Templates 8 | - 9 | 10 | 1. IBM Tivoli Storage Server - On Windows 11 | ----- 12 | 13 | - for IBM TSM Server on Windows 14 | - with DB2 15 | - tested on Windows 2008 R2, IBM TSM 6.3, IBM DB2 16 | 17 | 1.1 Monitored items 18 | ------ 19 | 20 | TDB 21 | 22 | 1.2 installation 23 | ------- 24 | set powershell policy: 25 | Set-ExecutionPolicy Unrestricted 26 | 27 | create user/admin in TSM: 28 | register admin monitor monpass (or something like that) 29 | grant auth monitor cl=operator 30 | 31 | copy scripts into zabbix-agent directory 32 | 33 | insert userparameters into your config file 34 | 35 | import template (xml file) into your zabbix server 36 | 37 | 38 | 2. Juniper switches - Chassis Stats, Generic 39 | ------ 40 | 41 | need "advsnmp.discovery" external script, https://github.com/czhujer/Zabbix-Addons/tree/master/advsnmp.discovery 42 | 43 | NETX INFO in Juniper-switches folder... 44 | 45 | 3. mysql-server 46 | ------ 47 | 48 | * tested on Centos 6.x and Zabbix 2.2 49 | 50 | * files with suffix "_new" is based/copied from this repo https://github.com/percona/percona-monitoring-plugins 51 | 52 | * others files in from mysql templates from https://github.com/zabbix/zabbix-community-repos 53 | 54 | ~~* from http://www.alexanderjohn.co.uk/2013/02/01/monitoring-mysql-with-zabbix-using-the-appaloosa-zabbix-templates/ ~~ 55 | ~~* and https://www.zabbix.com/forum/showthread.php?t=26503~~ 56 | 57 | 3.1 Monitored items / Docs 58 | ------ 59 | 60 | * https://www.percona.com/doc/percona-monitoring-plugins/1.1/cacti/mysql-templates.html 61 | 62 | 3.2 automatic instalation 63 | ------ 64 | 65 | * use puppet module - https://github.com/H-Software/puppet-zabbixagent#usage---plugins 66 | 67 | 3.3 manual installation 68 | ------- 69 | 70 | On monitored host: 71 | 72 | * copy files from scripts folder into /etc/zabbix/plugins 73 | 74 | * copy files from zabbix_agent into /etc/zabbix/zabbix_agentd 75 | 76 | on zabbix server: 77 | 78 | * import xml as template 79 | 80 | 4. rabbitmq-server 81 | ------ 82 | 83 | 4.1 installation 84 | ------- 85 | 86 | :: on monitored host 87 | 88 | 1. copy files from folder "scripts" to /etc/zabbix/scripts/rabbitmq 89 | 2. copy config file into your zabbix-agent config folder, or add co zabbix-agent config file 90 | 3. create sudo record for command: "/usr/sbin/rabbitmqctl *" for user: zabbix, NOPASSWD 91 | 92 | OR 93 | 94 | use puppet manifest from my Repo: puppet-zabbixagent :) 95 | https://github.com/czhujer/puppet-zabbixagent 96 | 97 | 98 | :: on server 99 | 100 | import xml file (zbx_templates_rabbitmq-server.xml) as zabbix template 101 | 102 | 103 | 5. Linux disk io stats 104 | ------ 105 | 106 | tested on: 107 | 108 | Centos 6.x x86_64 109 | Ubuntu LTS 12.04 x86_64 110 | 111 | Zabbix 2.0.x and 2.2 (appliance) 112 | 113 | 5.1 automatic instalation 114 | 115 | * use puppet module - https://github.com/H-Software/puppet-zabbixagent#usage---plugins 116 | 117 | 5.2 manual instalation 118 | ------- 119 | 120 | :: on monitored host 121 | 122 | 1. copy files from folder "usr-local-bin" to /usr/local/bin 123 | 2. copy config file (from zabbix_agentd folder) into your zabbix-agent config folder, or add co zabbix-agent config file 124 | 125 | OR 126 | 127 | use puppet manifest from my Repo: puppet-zabbixagent :) 128 | https://github.com/czhujer/puppet-zabbixagent 129 | 130 | 131 | :: on server 132 | 133 | import xml file (zbx_templates_linux_disk_io_stats.xml) as zabbix template 134 | 135 | 5.2 Changelog 136 | ------- 137 | 138 | v.1.1.1 - 2014/10/11 139 | 140 | update discovery time (1x per day) 141 | small fix discovery script for valid JSON (Zabbix 2.2 compat) 142 | 143 | v1.1 - 2013/10/30 144 | 145 | updated parse script and zabbix userparameters 146 | -- Now, the parameters and their sequence are looking directly (iostat in Ubuntu writes more information/parameters) 147 | 148 | added debug mode for zbx_parse_iostat_values.sh scripts 149 | 150 | 151 | 6. IBM BladeCenter Chassis Stats 152 | ----- 153 | For IBM BladeCenter H/S Chassis 154 | 155 | - Both Chassis tested with AMM (Advanced Mangement Module) 156 | 157 | - S chassis has one power domain (items "Power domain 2.." will be unsupported) 158 | 159 | 6.1 Monitored items 160 | ------ 161 | 162 | TDB 163 | 164 | 6.2 instalation 165 | ------- 166 | 167 | :: on zabbix server 168 | 169 | * import xml file as zabbix template 170 | 171 | * copy script "ibm_amm_snmpget.sh" into external script folder 172 | 173 | * create "value mapping" ("administration" - general - value mapping) 174 | 175 | Name: IBM BC_AMM - Health Status 176 | 177 | Mappings: 178 | 179 | | Value | Mapped to | 180 | | ----- | ------------:| 181 | | 0 | unkown | 182 | | 1 | good | 183 | | 2 | warning | 184 | | 3 | bad | 185 | 186 | or look at [example picture](https://github.com/czhujer/Zabbix-II/tree/master/zabbix-templates/ibm-bladecenter-chassis-amm/screenshots/ibm_amm_value_mapping.jpg) 187 | 188 | 189 | 7. Template IBM Storwize Perf 190 | ----- 191 | 192 | worse quality (dont works items/graphs with pool capacity etc) 193 | 194 | tested with IBM Storwise SVC V7000 195 | 196 | "acknowledged" errors are handled by Macro "{$ERROR_COUNTER_ACK_POS}" 197 | 198 | DOCS: 199 | 200 | http://ma-tty.blogspot.cz/2013/01/ibm-storwize-v7000-performance.html 201 | 202 | https://github.com/ma-tty/zabbix 203 | 204 | 7.1 instalation 205 | ------- 206 | 207 | copy all files from scripts folder to your zabbix server 208 | 209 | change paths in all scripts 210 | 211 | generate ssh key for login into storwize (controller) 212 | 213 | if it's neccessery download python modules 214 | 215 | import xml as template 216 | 217 | create host 218 | 219 | link template to host 220 | 221 | create Macros: {$ERROR_COUNTER_ACK_POS}, {$SVC_PWD}, {$SVC_USER} 222 | 223 | 7.2 Monitored items 224 | ------- 225 | 226 | * Error count 227 | 228 | * mdisk - IOPS 229 | 230 | * mdisk - IO time 231 | 232 | * mdisk - Throughput 233 | 234 | * volume - IOPS 235 | 236 | * volume - IO time 237 | 238 | * volume - Throughput 239 | 240 | 7.3 Triggers 241 | ------- 242 | 243 | * New Error(s) 244 | 245 | TDB 246 | 247 | 7.4 Authors 248 | ------- 249 | 250 | * Matvey Marinin 251 | 252 | 8. Template SNMP Interfaces - Advanced 253 | ----- 254 | 255 | based on standart SNMP Interfaces, but discovery rule results return more infos 256 | 257 | currently: If-Index, IF-Descr, If-OperStatus and !!! ALL these items !!!, so you can a complex expression for "filter" 258 | 259 | 260 | 8.1 instalation 261 | ------- 262 | 263 | copy script to externalscripts folder to your zabbix server 264 | 265 | install python NET::SNMP module (http://search.cpan.org/~dtown/Net-SNMP-v6.0.1/lib/Net/SNMP.pm) 266 | 267 | import xml file as template 268 | 269 | 270 | 8.2 Monitored items 271 | ------- 272 | 273 | Same as in SNMP Interface 274 | 275 | 276 | B. Requirements 277 | -- 278 | 279 | All this templates were tested for Zabbix 2.0.6 and higher (2.0.x). 280 | 281 | C. License 282 | -- 283 | 284 | This template were distributed under GNU General Public License 2. 285 | 286 | D. Copyright 287 | -- 288 | 289 | Copyright (c) 2013-2014 Patrik Majer 290 | 291 | E. Authors 292 | -- 293 | 294 | Patrik Majer 295 | (patrik.majer.pisek |at| gmail |dot| com) 296 | -------------------------------------------------------------------------------- /zabbix-templates/check-https-cert-expire/externalscripts/check-ssl-expire.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Adrien Pujol - http://www.crashdump.fr/" 5 | __copyright__ = "Copyright 2013, Adrien Pujol" 6 | __license__ = "Mozilla Public License" 7 | __version__ = "0.3" 8 | __email__ = "adrien.pujol@crashdump.fr" 9 | __status__ = "Development" 10 | __doc__ = "Check a TLS certificate validity." 11 | 12 | import argparse 13 | import socket 14 | from datetime import datetime 15 | import time 16 | try: 17 | # Try to load pyOpenSSL first 18 | # aptitude install python-dev && pip install pyopenssl 19 | from OpenSSL import SSL 20 | from pyasn1.codec.der import decoder as der_decoder 21 | from ndg.httpsclient.subj_alt_name import SubjectAltName 22 | PYOPENSSL = True 23 | except ImportError: 24 | # Else, fallback on standard ssl lib (doesn't support SNI) 25 | import ssl 26 | PYOPENSSL = False 27 | 28 | #CA_CERTS = "/etc/ssl/certs/ca-certificates.crt" 29 | CA_CERTS = "/etc/ssl/certs/ca-bundle.trust.crt" 30 | #CA_CERTS = "/etc/ssl/certs/ca-bundle.crt" 31 | 32 | def exit_error(errcode, errtext): 33 | print errtext 34 | exit(errcode) 35 | 36 | def pyopenssl_check_callback(connection, x509, errnum, errdepth, ok): 37 | ''' callback for pyopenssl ssl check''' 38 | #if x509.get_subject().commonName: 39 | if pyopenssl_check_hostname(x509, HOST): 40 | if x509.has_expired(): 41 | #exit_error(1, 'Error: Certificate has expired!') 42 | exit_error(1, '-0.909') 43 | else: 44 | print pyopenssl_check_expiration(x509.get_notAfter()) 45 | 46 | if not ok: 47 | return False 48 | return ok 49 | 50 | 51 | def pyopenssl_check_expiration(asn1): 52 | ''' Return the numbers of day before expiration. False if expired.''' 53 | try: 54 | expire_date = datetime.strptime(asn1, "%Y%m%d%H%M%SZ") 55 | except: 56 | #exit_error(1, 'Certificate date format unknow.') 57 | exit_error(1, '-0.988') 58 | 59 | expire_in = expire_date - datetime.now() 60 | if expire_in.days > 0: 61 | return expire_in.days 62 | else: 63 | return False 64 | 65 | 66 | def pyssl_check_hostname(cert, hostname): 67 | ''' Return True if valid. False is invalid ''' 68 | if 'subjectAltName' in cert: 69 | for typ, val in cert['subjectAltName']: 70 | # Wilcard 71 | if typ == 'DNS' and val.startswith('*'): 72 | if val[2:] == hostname.split('.', 1)[1]: 73 | return True 74 | # Normal hostnames 75 | elif typ == 'DNS' and val == hostname: 76 | return True 77 | else: 78 | return False 79 | 80 | def pyopenssl_check_hostname(cert, hostname): 81 | ''' Return True if valid. False is invalid ''' 82 | general_names = SubjectAltName() 83 | if cert.get_subject().commonName: 84 | for idx in range(0, cert.get_extension_count()): 85 | ext = cert.get_extension(idx) 86 | if ext.get_short_name() == "subjectAltName": 87 | san = ext.get_data() 88 | decoded_san = der_decoder.decode(san,asn1Spec=general_names) 89 | 90 | for name in decoded_san: 91 | if isinstance(name, SubjectAltName): 92 | for entry in range(len(name)): 93 | component = name.getComponentByPosition(entry) 94 | val = str(component.getComponent()) 95 | if component.getName() == 'dNSName' and val.startswith('*'): 96 | # Wilcard 97 | if val[2:] == hostname.split('.', 1)[1]: 98 | # print 'OK - wilcard' 99 | return True 100 | # Normal hostnames 101 | elif component.getName() == 'dNSName' and val == hostname: 102 | # print 'OK - normal' 103 | return True 104 | else: 105 | return False 106 | 107 | def pyssl_check_expiration(cert): 108 | ''' Return the numbers of day before expiration. False if expired. ''' 109 | if 'notAfter' in cert: 110 | try: 111 | expire_date = datetime.strptime(cert['notAfter'], 112 | "%b %d %H:%M:%S %Y %Z") 113 | except: 114 | #exit_error(1, 'Certificate date format unknow.') 115 | exit_error(1, '-0.982') 116 | 117 | expire_in = expire_date - datetime.now() 118 | if expire_in.days > 0: 119 | return expire_in.days 120 | else: 121 | return False 122 | 123 | 124 | def main(): 125 | parser = argparse.ArgumentParser() 126 | parser.add_argument('host', help='specify an host to connect to') 127 | parser.add_argument('-p', '--port', help='specify a port to connect to', 128 | type=int, default=443) 129 | args = parser.parse_args() 130 | 131 | global HOST, PORT 132 | HOST = args.host 133 | PORT = args.port 134 | 135 | # Check the DNS name 136 | try: 137 | socket.getaddrinfo(HOST, PORT)[0][4][0] 138 | except socket.gaierror as e: 139 | exit_error(1, e) 140 | 141 | # Connect to the host and get the certificate 142 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 143 | sock.connect((HOST, PORT)) 144 | 145 | # If handled by python SSL library 146 | if not PYOPENSSL: 147 | try: 148 | ssl_sock = ssl.wrap_socket(sock, cert_reqs=ssl.CERT_REQUIRED, 149 | ca_certs=CA_CERTS, 150 | ciphers=("HIGH:-aNULL:-eNULL:" 151 | "-PSK:RC4-SHA:RC4-MD5")) 152 | 153 | cert = ssl_sock.getpeercert() 154 | if not pyssl_check_hostname(cert, HOST): 155 | #print 'Error: Hostname does not match!' 156 | print '-0.923' 157 | 158 | print pyssl_check_expiration(cert) 159 | 160 | sock = ssl_sock.unwrap() 161 | 162 | except ssl.SSLError as e: 163 | exit_error(1, e) 164 | 165 | # If handled by pyOpenSSL module 166 | else: 167 | try: 168 | ctx = SSL.Context(SSL.TLSv1_METHOD) 169 | ctx.set_verify(SSL.VERIFY_PEER | SSL.VERIFY_FAIL_IF_NO_PEER_CERT, 170 | pyopenssl_check_callback) 171 | ctx.load_verify_locations(CA_CERTS) 172 | 173 | ssl_sock = SSL.Connection(ctx, sock) 174 | ssl_sock.set_connect_state() 175 | ssl_sock.set_tlsext_host_name(HOST) 176 | ssl_sock.do_handshake() 177 | 178 | x509 = ssl_sock.get_peer_certificate() 179 | # x509name = x509.get_subject() 180 | # if x509name.commonName != HOST: 181 | # print 'Error: Hostname does not match!' 182 | # print '-0.923' 183 | if not pyopenssl_check_hostname(x509, HOST): 184 | exit_error(1,'-0.923') 185 | 186 | ssl_sock.shutdown() 187 | 188 | except SSL.Error as e: 189 | exit_error(1, '-0.800') 190 | 191 | sock.close() 192 | 193 | 194 | if __name__ == "__main__": 195 | main() 196 | 197 | -------------------------------------------------------------------------------- /zabbix-templates/check-https-cert-expire/zbx_template_SSL_Cert_Expire_-_external.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2016-10-31T21:55:57Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 79 | 80 | 81 | 82 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<1 83 | SSL certificate on {HOSTNAME} expired 84 | 85 | 0 86 | 4 87 | 88 | 0 89 | 90 | 91 | 92 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<7 93 | SSL certificate on {HOSTNAME} expires in less than 7 days ({ITEM.VALUE} days remaining) 94 | 95 | 0 96 | 4 97 | 98 | 0 99 | 100 | 101 | SSL certificate on {HOSTNAME} expired 102 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<1 103 | 104 | 105 | 106 | 107 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<15 108 | SSL certificate on {HOSTNAME} expires in less than 15 days ({ITEM.VALUE} days remaining) 109 | 110 | 0 111 | 3 112 | 113 | 0 114 | 115 | 116 | SSL certificate on {HOSTNAME} expires in less than 7 days ({ITEM.VALUE} days remaining) 117 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<7 118 | 119 | 120 | 121 | 122 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<30 123 | SSL certificate on {HOSTNAME} expires in less than 30 days ({ITEM.VALUE} days remaining) 124 | 125 | 0 126 | 2 127 | 128 | 0 129 | 130 | 131 | SSL certificate on {HOSTNAME} expires in less than 15 days ({ITEM.VALUE} days remaining) 132 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<15 133 | 134 | 135 | 136 | 137 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<60 138 | SSL certificate on {HOSTNAME} expires in less than 60 days ({ITEM.VALUE} days remaining) 139 | 140 | 0 141 | 1 142 | 143 | 0 144 | 145 | 146 | SSL certificate on {HOSTNAME} expires in less than 30 days ({ITEM.VALUE} days remaining) 147 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<30 148 | 149 | 150 | 151 | 152 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<90 153 | SSL certificate on {HOSTNAME} expires in less than 90 days ({ITEM.VALUE} days remaining) 154 | 155 | 0 156 | 0 157 | 158 | 0 159 | 160 | 161 | SSL certificate on {HOSTNAME} expires in less than 60 days ({ITEM.VALUE} days remaining) 162 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].last(0)}<60 163 | 164 | 165 | 166 | 167 | {Template SSL Cert Expire - external:check-ssl-expire.py["{HOST.HOST}"].nodata(86500)}=1 168 | SSL certificate on {HOSTNAME} No new data in the last 24h 169 | 170 | 0 171 | 2 172 | No data received for > 24h. Check the script. 173 | 0 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /zabbix-templates/ibm-storwize-perf/scripts/svc_perf_wbem.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- # coding: utf-8 3 | # 4 | # IBM Storwize V7000 performance monitoring script for Zabbix 5 | # 6 | # v4.1 7 | # 2013 Matvey Marinin 8 | # 9 | # Returns statistics in zabbix_sender format (http://www.zabbix.com/documentation/2.2/manpages/zabbix_sender): 10 | # 11 | # svc1-blk svc.ReadRateKB[mdisk,40] 1356526942 14470.7333333 12 | # svc1-blk svc.WriteRateKB[mdisk,40] 1356526942 11102.84 13 | # svc1-blk svc.TotalRateKB[mdisk,40] 1356526942 25573.5733333 14 | # svc1-blk svc.ReadIORate[mdisk,40] 1356526942 609.356666667 15 | # svc1-blk svc.WriteIORate[mdisk,40] 1356526942 121.946666667 16 | # svc1-blk svc.TotalIORate[mdisk,40] 1356526942 731.303333333 17 | # svc1-blk svc.ReadIOTime[mdisk,40] 1356526942 5.29899839722 18 | # svc1-blk svc.WriteIOTime[mdisk,40] 1356526942 9.65088563306 19 | # svc1-blk svc.ReadIOPct[mdisk,40] 1356526942 83.3247489642 20 | # 21 | # Use with template _Special_Storwize_Perf 22 | # 23 | # Performance stats is collected with SVC CIM provider (WBEM): 24 | # http://pic.dhe.ibm.com/infocenter/storwize/unified_ic/index.jsp?topic=%2Fcom.ibm.storwize.v7000.unified.doc%2Fsvc_umlblockprofile.html 25 | # http://pic.dhe.ibm.com/infocenter/storwize/unified_ic/index.jsp?topic=%2Fcom.ibm.storwize.v7000.unified.doc%2Fsvc_cim_main.html 26 | # 27 | # Usage: 28 | # svc_perf_wbem.py --cluster [--cluster ...] --user --password --cachefile |none 29 | # 30 | # --cluster = Dns name or IP of Storwize V7000 block node (not Storwize V7000 Unified mgmt node!). May be used several times to monitor some clusters. 31 | # --user = Storwize V7000 user account with Administrator role (it seems that Monitor role is not enough) 32 | # --password = User password 33 | # --cachefile = Path to timestamp cache file or "none" to not use cache. Used to prevent submitting duplicate values to Zabbix. 34 | # Duplicates detected by statistics timestamp supplied by Storwize. 35 | # 36 | # 37 | import pywbem 38 | import getopt, sys, datetime, time, calendar, json 39 | 40 | def usage(): 41 | print >> sys.stderr, "Usage: svc_perf_wbem.py --cluster [--cluster ...] --user --password --cachefile |none" 42 | 43 | ############################################################## 44 | 45 | RAW_COUNTERS = ['timestamp', 'KBytesRead', 'KBytesWritten', 'KBytesTransferred', 'ReadIOs', 'WriteIOs', 'TotalIOs', 'IOTimeCounter', 'ReadIOTimeCounter', 'WriteIOTimeCounter'] 46 | MDISK_COUNTERS = ['ReadRateKB', 'WriteRateKB', 'TotalRateKB', 'ReadIORate', 'WriteIORate', 'TotalIORate', 'ReadIOTime', 'WriteIOTime', 'ReadIOPct'] 47 | VOLUME_COUNTERS = ['ReadRateKB', 'WriteRateKB', 'TotalRateKB', 'ReadIORate', 'WriteIORate', 'TotalIORate', 'ReadIOTime', 'WriteIOTime', 'ReadIOPct'] 48 | 49 | ############################################################## 50 | def enumNames(cimClass): 51 | ''' Enum storage objects and return dict{id:name} ''' 52 | names = {} 53 | for obj in conn.ExecQuery( 'WQL', 'SELECT DeviceID, ElementName FROM %s' % (cimClass) ): 54 | deviceID = obj.properties['DeviceID'].value 55 | if deviceID: 56 | names[str(deviceID)] = obj.properties['ElementName'].value 57 | return names 58 | 59 | ############################################################## 60 | def calculateStats(old_counters, new_counters): 61 | ''' Calculate perf statistic values from raw counters ''' 62 | stats = {} 63 | 64 | ''' check that we have timestamp in cached sample ''' 65 | if 'timestamp' in old_counters: 66 | timespan = new_counters['timestamp'] - old_counters['timestamp'] 67 | 68 | if timespan: 69 | deltaReadKB = float(new_counters['KBytesRead'] - old_counters['KBytesRead']) 70 | deltaWriteKB = float(new_counters['KBytesWritten'] - old_counters['KBytesWritten']) 71 | deltaTotalKB = float(new_counters['KBytesTransferred'] - old_counters['KBytesTransferred']) 72 | deltaReadIO = float(new_counters['ReadIOs'] - old_counters['ReadIOs']) 73 | deltaWriteIO = float(new_counters['WriteIOs'] - old_counters['WriteIOs']) 74 | deltaTotalIO = float(new_counters['TotalIOs'] - old_counters['TotalIOs']) 75 | deltaReadIOTimeCounter = float(new_counters['ReadIOTimeCounter'] - old_counters['ReadIOTimeCounter']) 76 | deltaWriteIOTimeCounter = float(new_counters['WriteIOTimeCounter'] - old_counters['WriteIOTimeCounter']) 77 | 78 | stats['ReadRateKB'] = deltaReadKB / timespan 79 | stats['WriteRateKB'] = deltaWriteKB / timespan 80 | stats['TotalRateKB'] = deltaTotalKB / timespan 81 | stats['ReadIORate'] = deltaReadIO / timespan 82 | stats['WriteIORate'] = deltaWriteIO / timespan 83 | stats['TotalIORate'] = deltaTotalIO / timespan 84 | 85 | if (deltaReadIO > 0) and (deltaReadIOTimeCounter > 0): 86 | stats['ReadIOTime'] = deltaReadIOTimeCounter / deltaReadIO 87 | 88 | if (deltaWriteIO > 0) and (deltaWriteIOTimeCounter > 0): 89 | stats['WriteIOTime'] = deltaWriteIOTimeCounter / deltaWriteIO 90 | 91 | if (deltaTotalIO > 0) and (deltaReadIO > 0): 92 | stats['ReadIOPct'] = deltaReadIO / deltaTotalIO * 100 93 | 94 | else: 95 | print >> sys.stderr, 'timespan between samples is 0, skipping' 96 | 97 | else: 98 | print >> sys.stderr, 'no timestamp in previous sample, skipping' 99 | 100 | return stats 101 | 102 | ############################################################## 103 | def collectStats(connection, elementType, elementClass, statisticsClass, elementCounters): 104 | 105 | ##enumerate element names 106 | names = enumNames(elementClass) 107 | 108 | ##get volume stats 109 | stats = conn.EnumerateInstances(statisticsClass) 110 | for stat in stats: 111 | ''' parse property InstanceID = "StorageVolumeStats 46" to get element ID ''' 112 | elementID = stat.properties['InstanceID'].value.split()[1] 113 | elementName = names[elementID] 114 | ps = stat.properties 115 | 116 | 117 | timestamp = calendar.timegm(ps['StatisticTime'].value.datetime.timetuple()) 118 | 119 | ''' get previous samples ''' 120 | cached_raw_counters = {} 121 | cache_key = '%s.%s.%s' % (cluster, elementType, elementName) 122 | if (cache_key in cache): 123 | cached_raw_counters = cache[cache_key] 124 | if cached_raw_counters is None: 125 | cached_raw_counters = {} 126 | 127 | ''' don't proceed samples with same timestamp to prevent speed calculation errors ''' 128 | if ('timestamp' in cached_raw_counters) and (timestamp == cached_raw_counters['timestamp']): 129 | print >> sys.stderr, 'same sample: %s = %s, skipping' % (cache_key, ps['StatisticTime'].value.datetime) 130 | continue 131 | 132 | ''' get current samples ''' 133 | new_raw_counters = {} 134 | new_raw_counters['timestamp'] = timestamp 135 | for k in RAW_COUNTERS: 136 | if k in ps and ps[k].value is not None: 137 | new_raw_counters[k] = ps[k].value 138 | 139 | ''' save current samples to cache ''' 140 | cache[cache_key] = new_raw_counters 141 | 142 | ''' calculate statistics for Zabbix ''' 143 | stat_values = calculateStats(cached_raw_counters, new_raw_counters) 144 | 145 | for s in elementCounters: 146 | if s in stat_values: 147 | print '%s svc.%s[%s,%s] %d %s' % (cluster, s, elementType, elementID, timestamp, stat_values[s]) 148 | 149 | ############################################################## 150 | 151 | ''' main script body ''' 152 | try: 153 | opts, args = getopt.gnu_getopt(sys.argv[1:], "-h", ["help", "cluster=", "user=", "password=", "cachefile="]) 154 | except getopt.GetoptError, err: 155 | print >> sys.stderr, str(err) # will print something like "option -a not recognized" 156 | usage() 157 | sys.exit(2) 158 | 159 | cluster = [] 160 | user = None 161 | password = None 162 | cachefile = None 163 | for o, a in opts: 164 | if o == "--cluster": 165 | cluster.append(a) 166 | elif o == "--user": 167 | user = a; 168 | elif o == "--password": 169 | password = a; 170 | elif o == "--cachefile": 171 | cachefile = a; 172 | elif o in ("-h", "--help"): 173 | usage() 174 | sys.exit() 175 | 176 | if not cluster or not user or not password or not cachefile: 177 | print >> sys.stderr, 'Required argument is not set' 178 | usage() 179 | sys.exit(2) 180 | 181 | ## Loading stats cache from file 182 | cache = None 183 | try: 184 | if 'none' != cachefile: 185 | cache = json.load( open(cachefile, 'r') ) 186 | except Exception, err: 187 | print >> sys.stderr, "Can't load cache:", str(err) 188 | 189 | ''' Initialize cache if neccesary ''' 190 | if cache is None: 191 | cache = {} 192 | 193 | ''' main loop ''' 194 | for cluster in cluster: 195 | print >> sys.stderr, 'Connecting to', cluster 196 | 197 | conn = pywbem.WBEMConnection('https://'+cluster, (user, password), 'root/ibm') 198 | conn.debug = True 199 | 200 | collectStats(conn, 'volume', 'IBMTSSVC_StorageVolume', 'IBMTSSVC_StorageVolumeStatistics', VOLUME_COUNTERS) 201 | collectStats(conn, 'mdisk', 'IBMTSSVC_BackendVolume', 'IBMTSSVC_BackendVolumeStatistics', MDISK_COUNTERS) 202 | 203 | 204 | ''' finally save cache to disk if permitted by command line argument ''' 205 | try: 206 | if 'none' != cachefile: 207 | json.dump( cache, open(cachefile, 'w') ) 208 | except Exception, err: 209 | print >> sys.stderr, "Can't save cache:", str(err) 210 | 211 | -------------------------------------------------------------------------------- /zabbix-templates/redhat-yum-stats/zbx_templates_rh_yum_stats.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-05-13T14:28:11Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 173 | 174 | 175 | 176 | {Template_RHEL-yum-stats:rh.yum.extras.last(0)}>{$RH_YUM_EXTRAS_MAX} 177 | YUM - available extras pkgs ({ITEM.LASTVALUE}) on {HOST.NAME} 178 | 179 | 0 180 | 3 181 | 182 | 0 183 | 184 | 185 | 186 | {Template_RHEL-yum-stats:rh.yum.updates.security.last(0)}>{$RH_YUM_SECURITY_MAX} 187 | YUM - available security issue(s) ({ITEM.LASTVALUE}) on {HOST.NAME} 188 | 189 | 0 190 | 4 191 | 192 | 0 193 | 194 | 195 | 196 | {Template_RHEL-yum-stats:rh.yum.updates.total.last(0)}>{$RH_YUM_UPDATES_TOTAL_MAX} 197 | YUM - available updates ({ITEM.LASTVALUE}) on {HOST.NAME} 198 | 199 | 0 200 | 2 201 | 202 | 0 203 | 204 | 205 | 206 | 207 | 208 | RH Yum Packages 209 | 900 210 | 200 211 | 0.0000 212 | 100.0000 213 | 0 214 | 0 215 | 0 216 | 1 217 | 0 218 | 0.0000 219 | 0.0000 220 | 1 221 | 0 222 | 0 223 | 0 224 | 225 | 226 | 0 227 | 0 228 | BB0000 229 | 0 230 | 2 231 | 0 232 | 233 | Template_RHEL-yum-stats 234 | rh.yum.updates.security 235 | 236 | 237 | 238 | 1 239 | 0 240 | 0000C8 241 | 0 242 | 2 243 | 0 244 | 245 | Template_RHEL-yum-stats 246 | rh.yum.extras 247 | 248 | 249 | 250 | 2 251 | 0 252 | 00EEEE 253 | 0 254 | 2 255 | 0 256 | 257 | Template_RHEL-yum-stats 258 | rh.yum.updates.total 259 | 260 | 261 | 262 | 263 | 264 | 265 | -------------------------------------------------------------------------------- /zabbix-templates/3ware-raid/3ware.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # discovery status for devices by tw_cli and smartctl utilities 3 | # usage in template via zabbix agent 4 | # additional info: 5 | # http://www.cyberciti.biz/files/tw_cli.8.html 6 | # https://www.marxen.cc/index.php?id=zabbix 7 | # http://lab4.org/wiki/Zabbix_3ware_raidcontroller_ueberwachen 8 | # ex 9 | export LC_ALL="" 10 | export LANG="en_US.UTF-8" 11 | export PATH=$PATH:/sbin:/usr/sbin:$HOME/bin:/opt/MegaRAID/MegaCli 12 | 13 | PROGNAME=$(basename $0) 14 | PROGPATH=$(dirname $0) 15 | VERBOSE=0 16 | TEST=$(echo $PROGNAME| sed -e 's/\.sh$//') 17 | CACHESEC=55 18 | DATE_TM=$(date +%s) 19 | 20 | TMPDIR=/dev/shm 21 | [[ ! -d $TMPDIR ]] && TMPDIR=/tmp 22 | 23 | WORKDIR=/home/zabbix 24 | [[ ! -d $WORKDIR ]] && WORKDIR=/var/lib/zabbix/local 25 | 26 | LOGDIR=$WORKDIR/log 27 | [[ ! -d $LOGDIR ]] && mkdir $LOGDIR 28 | LOGFILE=$LOGDIR/$TEST.log 29 | TMPFILE=$TMPDIR/${TEST} 30 | 31 | . $PROGPATH/zabbix_utils.sh || exit 22 32 | 33 | # smartctl utility 34 | [[ -f /usr/sbin/smartctl ]] || exit 33 35 | SMARTCLI="sudo /usr/sbin/smartctl" 36 | 37 | # MegaCli utility 38 | ARCH_TYPE=$(uname -p) 39 | TWCLI=/usr/sbin/tw_cli 40 | [[ -f $TWCLI ]] || exit 1 41 | TWCLI="sudo $TWCLI" 42 | 43 | print_usage(){ 44 | code=$1 45 | echo "Usage: $PROGNAME [-hv] -t ad|ld|pd|smart -m metric -a adapter_id -d device_id" 46 | echo "Discovery 3ware adapater/controller IDs:" 47 | echo " $PROGNAME -t ad -m discovery" 48 | echo "Get metrics for the adapter:" 49 | echo " $PROGNAME -t ad -m bbu_state|bbu_temp_state|bbu_temp|bbu_volt -a adapter_id]" 50 | echo 51 | echo "Discovery 3ware logical device/utits IDs:" 52 | echo " $PROGNAME -t ld -m discovery" 53 | echo "Get metrics for the LD:" 54 | echo " $PROGNAME -t ld -m status -a adapter_id -d ld_id" 55 | echo 56 | echo "Discovery 3ware physical device IDs:" 57 | echo " $PROGNAME -t pd -m discovery" 58 | echo "Get metrics for the PD:" 59 | echo " $PROGNAME -t pd -m status|temperature -a adapter_id -d pd_id" 60 | echo 61 | echo "Discovery SMART physical device IDs and device names:" 62 | echo " $PROGNAME -t smart -m discovery" 63 | echo "Get SMART metrics for the PD:" 64 | echo " $PROGNAME -t smart -m health|type|Raw_Read_Error_Rate.. -a device_name -d device_id" 65 | 66 | exit $code 67 | } 68 | 69 | # discovery installed adapters IDs 70 | adapters_discovery(){ 71 | print=$1 # if not defined zabbix discovery usage, else fill out variable adapters_list 72 | 73 | adapters_list=$($TWCLI info | egrep -o '^c[0-9]+') 74 | 75 | print_debug "$adapters_list" 76 | 77 | if [[ -z $print ]]; then 78 | echo_simple_json "$adapters_list" "ADAPTER_ID" 79 | exit 0 80 | fi 81 | } 82 | 83 | # discovery installed/configured logical devices 84 | # get adapter+ld list 85 | # ex. { "data":[{"{#LD_ADAPTER_ID}":"0","{#LD_ID}":"0"}]} 86 | ld_discovery(){ 87 | print_ld=$1 # if not defined zabbix discovery usage, else fill out variable ld_list 88 | adapters_discovery "not_print" 89 | [[ -z $adapters_list ]] && exit 1 90 | 91 | ld_list= 92 | 93 | for adapter in $adapters_list; do 94 | lds_list=$($TWCLI info $adapter | egrep -o '^u[0-9]+') 95 | if [[ -n $lds_list ]]; then 96 | for ld in $lds_list; do 97 | ld_list=$ld_list"LD_ADAPTER_ID=$adapter;LD_ID=$ld " 98 | done 99 | ld_list=$(echo "$ld_list" | sed -e 's/\s\+$//') 100 | fi 101 | done 102 | 103 | if [[ -z $print_ld ]]; then 104 | echo_multi_json "$ld_list" 105 | exit 0 106 | fi 107 | } 108 | 109 | # discovery installed physical devices 110 | pd_discovery(){ 111 | adapters_discovery "not_print" 112 | [[ -z $adapters_list ]] && exit 1 113 | 114 | pd_list= 115 | for adapter in $adapters_list; do 116 | pds_list=$($TWCLI info $adapter | egrep -o '^p[0-9]+') 117 | if [[ -n $pds_list ]]; then 118 | for pd in $pds_list; do 119 | pd_list=$pd_list"PD_ADAPTER_ID=$adapter;PD_ID=$pd " 120 | done 121 | fi 122 | done 123 | pd_list=$(echo "$pd_list" | sed -e 's/\s\+$//') 124 | 125 | echo_multi_json "$pd_list" 126 | exit 0 127 | } 128 | 129 | # discovery installed physical devices and linux drive for them 130 | # ex. 131 | # TW_DEV = logical device name (aka /dev/twaN) 132 | # TW_CTRL = controller id 133 | # TW_UNIT - logical device id 134 | # TW_PH_ID - physical device id 135 | # function usage smartctl util: 136 | # smartctl -a /dev/sda -d 3ware,10 137 | smart_discovery(){ 138 | smart_list= 139 | 140 | ld_discovery "not_print" 141 | [[ -z $ld_list ]] && exit 1 142 | 143 | smart_list= 144 | 145 | # test if cache file is valid 146 | use_cache=$(test_cache $metric_cache $metric_ttl) 147 | 148 | # LD_ADAPTER_ID=$adapter;LD_ID=$ld 149 | for ld_info in $ld_list; do 150 | tw_ctrl=$(echo "$ld_info" | awk -F';' '{print $1}' | awk -F'=' '{print $2}') 151 | tw_unit=$(echo "$ld_info" | awk -F';' '{print $2}' | awk -F'=' '{print $2}') 152 | tw_dev="/dev/twa"$(echo "$tw_ctrl" | sed -e's/^c//;' ) 153 | #print_debug "tw_ctrl=$tw_ctrl tw_unit=$tw_unit tw_dev=$tw_dev" 154 | 155 | pd_ids=$($TWCLI info $tw_ctrl | grep '^p[0-9]\+ ' | \ 156 | grep -w "$tw_unit" | awk '{print $7}') 157 | if [[ -n "$pd_ids" ]] ; then 158 | for pd_id in $pd_ids; do 159 | smart_list=$smart_list"TW_DEV=$tw_dev;TW_CTRL=$tw_ctrl;TW_UNIT=$tw_unit;TW_PH_ID=$pd_id " 160 | done 161 | fi 162 | done 163 | 164 | smart_list=$(echo "$smart_list" | sed -e 's/\s\+$//') 165 | 166 | echo_multi_json "$smart_list" 167 | exit 0 168 | 169 | } 170 | 171 | # get metric about adapter 172 | # bbu_state|bbu_temp_state|bbu_temp|bbu_volt_state 173 | ametric(){ 174 | metric=$1 175 | adapter=$2 176 | 177 | [[ "$metric" == "discovery" ]] && adapters_discovery 178 | [[ -z $adapter ]] && exit 1 179 | 180 | metric_cache=${TMPFILE}_${adapter}_ad 181 | metric_ttl=299 182 | metric_keys='\(BBU Status\|Battery Voltage status\|Battery Temperature Status\|Battery Temperature Value\)' 183 | 184 | # test if cache file is valid 185 | use_cache=$(test_cache $metric_cache $metric_ttl) 186 | bbu_statuses='-=0 Testing=1 Charging=2 OK=3 WeakBat=4 Failed=5 Error=6 Fault=7' 187 | bbu_opt_statuses="OK=1 HIGH=2 LOW=3 TOO-HIGH=4 TOO-LOW=5" 188 | 189 | if [[ $use_cache -eq 1 ]]; then 190 | BBU_INFO=$($TWCLI /$adapter/bbu show all | \ 191 | grep "$metric_keys") 192 | [[ -z $BBU_INFO ]] && exit 1 193 | 194 | # current temperature 195 | echo "bbu_temp:"$(echo "$BBU_INFO" | \ 196 | awk -F'=' '/Battery Temperature Value/{print $2}' | \ 197 | sed -e 's/\s\+//g') > $metric_cache 198 | 199 | # bbu status 200 | bbu_state=$(echo "$BBU_INFO" | \ 201 | awk -F'=' '/BBU Status/{print $2}' | \ 202 | sed -e 's/\s\+//g') 203 | if [[ -z $bbu_state ]]; then 204 | bbu_state_code=255 205 | else 206 | bbu_state_code=$(echo "$bbu_statuses" | \ 207 | egrep -o "$bbu_state=[0-9]+" | awk -F'=' '{print $2}') 208 | fi 209 | echo "bbu_state:"$bbu_state_code >> $metric_cache 210 | 211 | # volt status 212 | bbu_volt_state=$(echo "$BBU_INFO" | \ 213 | awk -F'=' '/Battery Voltage status/{print $2}' | \ 214 | sed -e 's/\s\+//g') 215 | if [[ -z $bbu_volt_state ]]; then 216 | bbu_volt_state_code=255 217 | else 218 | bbu_volt_state_code=$(echo "$bbu_opt_statuses" | \ 219 | egrep -o "$bbu_volt_state=[0-9]+" | awk -F'=' '{print $2}') 220 | fi 221 | echo "bbu_volt_state:"$bbu_volt_state_code >> $metric_cache 222 | 223 | # temp status 224 | bbu_temp_state=$(echo "$BBU_INFO" | \ 225 | awk -F'=' '/Battery Temperature Status/{print $2}' | \ 226 | sed -e 's/\s\+//g') 227 | if [[ -z "$bbu_temp_state" ]]; then 228 | bbu_temp_state_code=255 229 | else 230 | bbu_temp_state_code=$(echo "$bbu_opt_statuses" | \ 231 | egrep -o "$bbu_temp_state=[0-9]+" | awk -F'=' '{print $2}') 232 | fi 233 | echo "bbu_temp_state:"$bbu_temp_state_code >> $metric_cache 234 | fi 235 | egrep -o "^$metric:[0-9]+" $metric_cache | awk -F':' '{print $2}' 236 | } 237 | 238 | # get metric about logical device 239 | # status 240 | lmetric(){ 241 | metric=$1 242 | adapter=$2 243 | device=$3 244 | 245 | [[ "$metric" == "discovery" ]] && ld_discovery 246 | [[ ( -z $adapter ) || ( -z $device ) ]] && exit 1 247 | 248 | metric_cache=${TMPFILE}_${adapter}_ld_${device} 249 | metric_ttl=299 250 | metric_keys='\(status\)' 251 | unit_status="OK=1 VERIFYING=2 INITIALIZING=3 INIT-PAUSED=4 REBUILDING=5 252 | REBUILD-PAUSED=6 DEGRADED=7 MIGRATING=8 MIGRATE-PAUSED=9 253 | RECOVERY=10 INOPERABLE=11 UNKNOWN=255" 254 | 255 | # test if cache file is valid 256 | use_cache=$(test_cache $metric_cache $metric_ttl) 257 | if [[ $use_cache -eq 1 ]]; then 258 | LD_INFO=$($TWCLI /$adapter/$device show all | \ 259 | grep "/$adapter/$device $metric_keys") 260 | [[ -z $LD_INFO ]] && exit 1 261 | 262 | # get status 263 | lb_status=$(echo "$LD_INFO" | \ 264 | awk -F'=' '/status/{print $2}' | \ 265 | sed -e 's/\s\+//g') 266 | if [[ -z $lb_status ]]; then 267 | lb_status_code=255 268 | else 269 | lb_status_code=$(echo "$unit_status" | \ 270 | egrep -o "$lb_status=[0-9]+" | awk -F'=' '{print $2}') 271 | fi 272 | echo "status:"$lb_status_code > $metric_cache 273 | fi 274 | 275 | egrep -o "^$metric:\S+" $metric_cache | awk -F':' '{print $2}' 276 | } 277 | 278 | # get metric about physical device 279 | # status 280 | pmetric(){ 281 | metric=$1 282 | adapter=$2 283 | device=$3 284 | 285 | [[ "$metric" == "discovery" ]] && pd_discovery 286 | [[ ( -z $adapter ) || ( -z $device ) ]] && exit 1 287 | 288 | metric_device=$(echo "$device" | sed -e 's/:/-/g') 289 | metric_cache=${TMPFILE}_${adapter}_pd_${metric_device} 290 | metric_ttl=55 291 | metric_keys='\(Status\)' 292 | unit_status="OK=1 VERIFYING=2 INITIALIZING=3 INIT-PAUSED=4 REBUILDING=5 293 | REBUILD-PAUSED=6 DEGRADED=7 MIGRATING=8 MIGRATE-PAUSED=9 294 | RECOVERY=10 INOPERABLE=11 UNKNOWN=255" 295 | 296 | 297 | # test if cache file is valid 298 | use_cache=$(test_cache $metric_cache $metric_ttl) 299 | if [[ $use_cache -eq 1 ]]; then 300 | PD_INFO=$($TWCLI /$adapter/$device show all | \ 301 | grep "/$adapter/$device $metric_keys") 302 | [[ -z $PD_INFO ]] && exit 1 303 | 304 | # get status 305 | pd_status=$(echo "$PD_INFO" | \ 306 | awk -F'=' '/Status/{print $2}' | \ 307 | sed -e 's/\s\+//g') 308 | if [[ -z $pd_status ]]; then 309 | pd_status_code=255 310 | else 311 | pd_status_code=$(echo "$unit_status" | \ 312 | egrep -o "$pd_status=[0-9]+" | awk -F'=' '{print $2}') 313 | fi 314 | echo "status:"$pd_status_code > $metric_cache 315 | 316 | fi 317 | egrep -o "^$metric:[0-9\+]+" $metric_cache | awk -F':' '{print $2}' 318 | } 319 | 320 | # smartctl metrics 321 | smetric(){ 322 | metric=$1 323 | device_name=$2 324 | device_id=$3 325 | 326 | [[ "$metric" == "discovery" ]] && smart_discovery 327 | [[ ( -z $device_name ) || ( -z $device_id ) ]] && exit 1 328 | 329 | metric_cache=${TMPFILE}_$(basename ${device_name})_smart_${device_id} 330 | metric_ttl=55 331 | metric_keys="Raw_Read_Error_Rate Seek_Error_Rate Temperature_Celsius Reallocated_Sector_Ct 332 | Reported_Uncorrect Command_Timeout Current_Pending_Sector Offline_Uncorrectable Power_On_Hours" 333 | 334 | # test if cache file is valid 335 | use_cache=$(test_cache $metric_cache $metric_ttl) 336 | if [[ $use_cache -eq 1 ]]; then 337 | smart_attributes=$(${SMARTCLI} --all ${device_name} -d 3ware,${device_id}) 338 | [[ -z $smart_attributes ]] && exit 1 339 | [[ $VERBOSE -gt 0 ]] && echo "$smart_attributes" 340 | 341 | # device type: SAS => 1, SSD => 2 342 | smart_type=255 343 | [[ -n $(echo "$smart_attributes" | \ 344 | grep '^SMART Health Status:') ]] && smart_type=1 345 | [[ -n $(echo "$smart_attributes" | \ 346 | grep '^SMART overall-health self-assessment test result:') ]] && smart_type=2 347 | echo "type:$smart_type" > $metric_cache 348 | 349 | # smart health 350 | smart_health_code=0 351 | if [[ $smart_type -eq 2 ]]; then 352 | smart_health_code=$(echo "$smart_attributes" | \ 353 | awk -F':' '/SMART overall-health self-assessment test result:/{print $2}' | \ 354 | sed -e 's/\s\+//g' | grep -wc 'PASSED') 355 | elif [[ $smart_type -eq 1 ]]; then 356 | smart_health_code=$(echo "$smart_attributes" | \ 357 | awk -F':' '/SMART Health Status:/{print $2}' | \ 358 | sed -e 's/\s\+//g' | grep -wc 'OK') 359 | fi 360 | echo "health:$smart_health_code" >> $metric_cache 361 | 362 | for key in $metric_keys; do 363 | val=$(echo "$smart_attributes" | \ 364 | grep -w "$key" | awk '{print $10}') 365 | [[ -z $val ]] && val=0 366 | echo "$key:$val" >> $metric_cache 367 | done 368 | fi 369 | egrep -o "^$metric:[0-9\.]+" $metric_cache | awk -F':' '{print $2}' 370 | } 371 | 372 | # get command line options 373 | # PROGNAME [-hv] -t ad|ld|pd -m metric -a adapter_id -d device_id" 374 | while getopts ":t:m:a:d:n:vh" opt; do 375 | case $opt in 376 | "t") 377 | TYPE=$OPTARG #device type: ad, ld or pd 378 | ;; 379 | "m") 380 | METRIC=$OPTARG # requested metric 381 | ;; 382 | "a") 383 | ADAPTER=$OPTARG # adapter id 384 | ;; 385 | "d") 386 | DEVICE=$OPTARG # device id 387 | ;; 388 | "n") 389 | DEVICE_NAME=$OPTARG # device_name 390 | ;; 391 | h) 392 | print_usage 0 393 | ;; 394 | v) 395 | VERBOSE=1 396 | ;; 397 | \?) 398 | print_usage 1 399 | ;; 400 | esac 401 | done 402 | 403 | # 404 | case $TYPE in 405 | 'ad') 406 | ametric "$METRIC" "$ADAPTER" 407 | ;; 408 | 'ld') 409 | lmetric "$METRIC" "$ADAPTER" "$DEVICE" 410 | ;; 411 | 'pd') 412 | pmetric "$METRIC" "$ADAPTER" "$DEVICE" 413 | ;; 414 | 'smart') 415 | smetric "$METRIC" "$ADAPTER" "$DEVICE" 416 | ;; 417 | *) 418 | print_usage 1 419 | ;; 420 | esac 421 | 422 | -------------------------------------------------------------------------------- /zabbix-templates/juniper-switches/Juniper_Switch_-_Chassis_Stats.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2014-10-07T12:24:44Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 343 | 344 | 345 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | add-ons, templates and etc for monitoring project "Zabbix" 294 | Copyright (C) 2013 Patrik Majer 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /zabbix-templates/rabbitmq-server/scripts/rabbitmqadmin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # The contents of this file are subject to the Mozilla Public License 4 | # Version 1.1 (the "License"); you may not use this file except in 5 | # compliance with the License. You may obtain a copy of the License at 6 | # http://www.mozilla.org/MPL/ 7 | # 8 | # Software distributed under the License is distributed on an "AS IS" 9 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing rights and limitations 11 | # under the License. 12 | # 13 | # The Original Code is RabbitMQ Management Plugin. 14 | # 15 | # The Initial Developer of the Original Code is VMware, Inc. 16 | # Copyright (c) 2010-2011 VMware, Inc. All rights reserved. 17 | 18 | from optparse import OptionParser 19 | import sys 20 | import httplib 21 | import urllib 22 | import base64 23 | import json 24 | import os 25 | import socket 26 | 27 | LISTABLE = ['connections', 'channels', 'exchanges', 'queues', 'bindings', 28 | 'users', 'vhosts', 'permissions', 'nodes'] 29 | 30 | SHOWABLE = ['overview'] 31 | 32 | PROMOTE_COLUMNS = ['vhost', 'name', 'type', 33 | 'source', 'destination', 'destination_type', 'routing_key'] 34 | 35 | URIS = { 36 | 'exchange': '/exchanges/{vhost}/{name}', 37 | 'queue': '/queues/{vhost}/{name}', 38 | 'binding': '/bindings/{vhost}/e/{source}/{destination_char}/{destination}', 39 | 'binding_del':'/bindings/{vhost}/e/{source}/{destination_char}/{destination}/{properties_key}', 40 | 'vhost': '/vhosts/{name}', 41 | 'user': '/users/{name}', 42 | 'permission': '/permissions/{vhost}/{user}' 43 | } 44 | 45 | DECLARABLE = { 46 | 'exchange': {'mandatory': ['name', 'type'], 47 | 'optional': {'auto_delete': 'false', 'durable': 'true', 48 | 'internal': 'false'}}, 49 | 'queue': {'mandatory': ['name'], 50 | 'optional': {'auto_delete': 'false', 'durable': 'true'}}, 51 | 'binding': {'mandatory': ['source', 'destination_type', 'destination', 52 | 'routing_key'], 53 | 'optional': {}}, 54 | 'vhost': {'mandatory': ['name'], 55 | 'optional': {}}, 56 | 'user': {'mandatory': ['name', 'password', 'tags'], 57 | 'optional': {}}, 58 | 'permission': {'mandatory': ['vhost', 'user', 'configure', 'write', 'read'], 59 | 'optional': {}} 60 | } 61 | 62 | DELETABLE = { 63 | 'exchange': {'mandatory': ['name']}, 64 | 'queue': {'mandatory': ['name']}, 65 | 'binding': {'mandatory': ['source', 'destination_type', 'destination', 66 | 'properties_key']}, 67 | 'vhost': {'mandatory': ['name']}, 68 | 'user': {'mandatory': ['name']}, 69 | 'permission': {'mandatory': ['vhost', 'user']} 70 | } 71 | 72 | CLOSABLE = { 73 | 'connection': {'mandatory': ['name'], 74 | 'optional': {}, 75 | 'uri': '/connections/{name}'} 76 | } 77 | 78 | PURGABLE = { 79 | 'queue': {'mandatory': ['name'], 80 | 'optional': {}, 81 | 'uri': '/queues/{vhost}/{name}/contents'} 82 | } 83 | 84 | EXTRA_VERBS = { 85 | 'publish': {'mandatory': ['routing_key'], 86 | 'optional': {'payload': None, 87 | 'exchange': 'amq.default', 88 | 'payload_encoding': 'string'}, 89 | 'uri': '/exchanges/{vhost}/{exchange}/publish'}, 90 | 'get': {'mandatory': ['queue'], 91 | 'optional': {'count': '1', 'requeue': 'true', 92 | 'payload_file': None}, 93 | 'uri': '/queues/{vhost}/{queue}/get'} 94 | } 95 | 96 | for k in DECLARABLE: 97 | DECLARABLE[k]['uri'] = URIS[k] 98 | 99 | for k in DELETABLE: 100 | DELETABLE[k]['uri'] = URIS[k] 101 | DELETABLE[k]['optional'] = {} 102 | DELETABLE['binding']['uri'] = URIS['binding_del'] 103 | 104 | def make_usage(): 105 | usage = """usage: %prog [options] cmd 106 | where cmd is one of: 107 | 108 | """ 109 | for l in LISTABLE: 110 | usage += " list {0} [...]\n".format(l) 111 | for s in SHOWABLE: 112 | usage += " show {0} [...]\n".format(s) 113 | usage += fmt_usage_stanza(DECLARABLE, 'declare') 114 | usage += fmt_usage_stanza(DELETABLE, 'delete') 115 | usage += fmt_usage_stanza(CLOSABLE, 'close') 116 | usage += fmt_usage_stanza(PURGABLE, 'purge') 117 | usage += fmt_usage_stanza(EXTRA_VERBS, '') 118 | usage += """ 119 | export 120 | import 121 | 122 | * If payload is not specified on publish, standard input is used 123 | 124 | * If payload_file is not specified on get, the payload will be shown on 125 | standard output along with the message metadata 126 | 127 | * If payload_file is specified on get, count must not be set""" 128 | return usage 129 | 130 | def fmt_usage_stanza(root, verb): 131 | def fmt_args(args): 132 | res = " ".join(["{0}=...".format(a) for a in args['mandatory']]) 133 | opts = " ".join("{0}=...".format(o) for o in args['optional'].keys()) 134 | if opts != "": 135 | res += " [{0}]".format(opts) 136 | return res 137 | 138 | text = "\n" 139 | if verb != "": 140 | verb = " " + verb 141 | for k in root.keys(): 142 | text += " {0} {1} {2}\n".format(verb, k, fmt_args(root[k])) 143 | return text 144 | 145 | parser = OptionParser(usage=make_usage()) 146 | 147 | def make_parser(): 148 | parser.add_option("-H", "--host", dest="hostname", default="localhost", 149 | help="connect to host HOST [default: %default]", 150 | metavar="HOST") 151 | parser.add_option("-P", "--port", dest="port", default="55672", 152 | help="connect to port PORT [default: %default]", 153 | metavar="PORT") 154 | parser.add_option("-V", "--vhost", dest="vhost", 155 | help="connect to vhost VHOST [default: all vhosts for list, '/' for declare]", 156 | metavar="VHOST") 157 | parser.add_option("-u", "--username", dest="username", default="guest", 158 | help="connect using username USERNAME [default: %default]", 159 | metavar="USERNAME") 160 | parser.add_option("-p", "--password", dest="password", default="guest", 161 | help="connect using password PASSWORD [default: %default]", 162 | metavar="PASSWORD") 163 | parser.add_option("-q", "--quiet", action="store_false", dest="verbose", 164 | default=True, help="suppress status messages") 165 | parser.add_option("-s", "--ssl", action="store_true", dest="ssl", 166 | default=False, help="connect with ssl") 167 | parser.add_option("--ssl-key-file", dest="ssl_key_file", default=None, 168 | help="PEM format key file for SSL [default: none]") 169 | parser.add_option("--ssl-cert-file", dest="ssl_cert_file", default=None, 170 | help="PEM format certificate file for SSL [default: none]") 171 | parser.add_option("-f", "--format", dest="format", default="table", 172 | help="format for listing commands - one of [" + ", ".join(FORMATS.keys()) + "] [default: %default]") 173 | parser.add_option("-d", "--depth", dest="depth", default="1", 174 | help="maximum depth to recurse for listing tables [default: %default]") 175 | parser.add_option("--bash-completion", action="store_true", 176 | dest="bash_completion", default=False, 177 | help="Print bash completion script") 178 | 179 | def assert_usage(expr, error): 180 | if not expr: 181 | output("\nERROR: {0}\n".format(error)) 182 | output("{0} --help for help\n".format(os.path.basename(sys.argv[0]))) 183 | sys.exit(1) 184 | 185 | def column_sort_key(col): 186 | if col in PROMOTE_COLUMNS: 187 | return (1, PROMOTE_COLUMNS.index(col)) 188 | else: 189 | return (2, col) 190 | 191 | def main(): 192 | make_parser() 193 | (options, args) = parser.parse_args() 194 | if options.bash_completion: 195 | print_bash_completion() 196 | exit(0) 197 | assert_usage(len(args) > 0, 'Action not specified') 198 | mgmt = Management(options, args[1:]) 199 | mode = "invoke_" + args[0] 200 | assert_usage(hasattr(mgmt, mode), 201 | 'Action {0} not understood'.format(args[0])) 202 | method = getattr(mgmt, "invoke_%s" % args[0]) 203 | method() 204 | 205 | def output(s): 206 | print maybe_utf8(s, sys.stdout) 207 | 208 | def die(s): 209 | sys.stderr.write(maybe_utf8("*** {0}".format(s), sys.stderr)) 210 | exit(1) 211 | 212 | def maybe_utf8(s, stream): 213 | if stream.isatty(): 214 | # It will have an encoding, which Python will respect 215 | return s 216 | else: 217 | # It won't have an encoding, and Python will pick ASCII by default 218 | return s.encode('utf-8') 219 | 220 | class Management: 221 | def __init__(self, options, args): 222 | self.options = options 223 | self.args = args 224 | 225 | def get(self, path): 226 | return self.http("GET", path, "") 227 | 228 | def put(self, path, body): 229 | return self.http("PUT", path, body) 230 | 231 | def post(self, path, body): 232 | return self.http("POST", path, body) 233 | 234 | def delete(self, path): 235 | return self.http("DELETE", path, "") 236 | 237 | def http(self, method, path, body): 238 | if self.options.ssl: 239 | conn = httplib.HTTPSConnection(self.options.hostname, 240 | self.options.port, 241 | self.options.ssl_key_file, 242 | self.options.ssl_cert_file) 243 | else: 244 | conn = httplib.HTTPConnection(self.options.hostname, 245 | self.options.port) 246 | headers = {"Authorization": 247 | "Basic " + base64.b64encode(self.options.username + ":" + 248 | self.options.password)} 249 | if body != "": 250 | headers["Content-Type"] = "application/json" 251 | try: 252 | conn.request(method, "/api%s" % path, body, headers) 253 | except socket.error as e: 254 | die("Could not connect: {0}".format(e)) 255 | resp = conn.getresponse() 256 | if resp.status == 400: 257 | die(json.loads(resp.read())['reason']) 258 | if resp.status == 401: 259 | die("Access refused: {0}".format(path)) 260 | if resp.status == 404: 261 | die("Not found: {0}".format(path)) 262 | if resp.status < 200 or resp.status > 400: 263 | raise Exception("Received %d %s for path %s\n%s" 264 | % (resp.status, resp.reason, path, resp.read())) 265 | return resp.read() 266 | 267 | def verbose(self, string): 268 | if self.options.verbose: 269 | output(string) 270 | 271 | def get_arg(self): 272 | assert_usage(len(self.args) == 1, 'Exactly one argument required') 273 | return self.args[0] 274 | 275 | def invoke_publish(self): 276 | (uri, upload) = self.parse_args(self.args, EXTRA_VERBS['publish']) 277 | upload['properties'] = {} # TODO do we care here? 278 | if not upload['payload']: 279 | data = sys.stdin.read() 280 | upload['payload'] = base64.b64encode(data) 281 | upload['payload_encoding'] = 'base64' 282 | resp = json.loads(self.post(uri, json.dumps(upload))) 283 | if resp['routed']: 284 | self.verbose("Message published") 285 | else: 286 | self.verbose("Message published but NOT routed") 287 | 288 | def invoke_get(self): 289 | (uri, upload) = self.parse_args(self.args, EXTRA_VERBS['get']) 290 | payload_file = upload['payload_file'] 291 | assert_usage(not payload_file or upload['count'] == '1', 292 | 'Cannot get multiple messages using payload_file') 293 | result = self.post(uri, json.dumps(upload)) 294 | if payload_file: 295 | write_payload_file(payload_file, result) 296 | columns = ['routing_key', 'exchange', 'message_count', 297 | 'payload_bytes', 'redelivered'] 298 | format_list(result, columns, self.options) 299 | else: 300 | format_list(result, [], self.options) 301 | 302 | def invoke_export(self): 303 | path = self.get_arg() 304 | definitions = self.get("/definitions") 305 | with open(path, 'w') as f: 306 | f.write(definitions) 307 | self.verbose("Exported definitions for %s to \"%s\"" 308 | % (self.options.hostname, path)) 309 | 310 | def invoke_import(self): 311 | path = self.get_arg() 312 | with open(path, 'r') as f: 313 | definitions = f.read() 314 | self.post("/definitions", definitions) 315 | self.verbose("Imported definitions for %s from \"%s\"" 316 | % (self.options.hostname, path)) 317 | 318 | def invoke_list(self): 319 | cols = self.args[1:] 320 | uri = self.list_show_uri(LISTABLE, 'list', cols) 321 | format_list(self.get(uri), cols, self.options) 322 | 323 | def invoke_show(self): 324 | cols = self.args[1:] 325 | uri = self.list_show_uri(SHOWABLE, 'show', cols) 326 | format_list('[{0}]'.format(self.get(uri)), cols, self.options) 327 | 328 | def list_show_uri(self, obj_types, verb, cols): 329 | obj_type = self.args[0] 330 | assert_usage(obj_type in obj_types, 331 | "Don't know how to {0} {1}".format(verb, obj_type)) 332 | uri = "/%s" % obj_type 333 | if self.options.vhost: 334 | uri += "/%s" % urllib.quote_plus(self.options.vhost) 335 | if cols != []: 336 | uri += "?columns=" + ",".join(cols) 337 | return uri 338 | 339 | def invoke_declare(self): 340 | (obj_type, uri, upload) = self.declare_delete_parse(DECLARABLE) 341 | if obj_type == 'binding': 342 | self.post(uri, json.dumps(upload)) 343 | else: 344 | self.put(uri, json.dumps(upload)) 345 | self.verbose("{0} declared".format(obj_type)) 346 | 347 | def invoke_delete(self): 348 | (obj_type, uri, upload) = self.declare_delete_parse(DELETABLE) 349 | self.delete(uri) 350 | self.verbose("{0} deleted".format(obj_type)) 351 | 352 | def invoke_close(self): 353 | (obj_type, uri, upload) = self.declare_delete_parse(CLOSABLE) 354 | self.delete(uri) 355 | self.verbose("{0} closed".format(obj_type)) 356 | 357 | def invoke_purge(self): 358 | (obj_type, uri, upload) = self.declare_delete_parse(PURGABLE) 359 | self.delete(uri) 360 | self.verbose("{0} purged".format(obj_type)) 361 | 362 | def declare_delete_parse(self, root): 363 | assert_usage(len(self.args) > 0, 'Type not specified') 364 | obj_type = self.args[0] 365 | assert_usage(obj_type in root, 366 | 'Type {0} not recognised'.format(obj_type)) 367 | obj = root[obj_type] 368 | (uri, upload) = self.parse_args(self.args[1:], obj) 369 | return (obj_type, uri, upload) 370 | 371 | def parse_args(self, args, obj): 372 | mandatory = obj['mandatory'] 373 | optional = obj['optional'] 374 | uri_template = obj['uri'] 375 | upload = {} 376 | for k in optional.keys(): 377 | upload[k] = optional[k] 378 | for arg in args: 379 | assert_usage("=" in arg, 380 | 'Argument "{0}" not in format name=value'.format(arg)) 381 | (name, value) = arg.split("=", 1) 382 | assert_usage(name in mandatory or name in optional.keys(), 383 | 'Argument "{0}" not recognised'.format(name)) 384 | upload[name] = value 385 | for m in mandatory: 386 | assert_usage(m in upload.keys(), 387 | 'mandatory argument "{0}" required'.format(m)) 388 | upload['arguments'] = {} 389 | upload['vhost'] = self.options.vhost or '/' 390 | uri_args = {} 391 | for k in upload: 392 | v = upload[k] 393 | if v: 394 | uri_args[k] = urllib.quote_plus(v) 395 | if k == 'destination_type': 396 | uri_args['destination_char'] = v[0] 397 | uri = uri_template.format(**uri_args) 398 | return (uri, upload) 399 | 400 | def format_list(json_list, columns, options): 401 | format = options.format 402 | formatter = None 403 | if format == "raw_json": 404 | output(json_list) 405 | return 406 | elif format == "pretty_json": 407 | enc = json.JSONEncoder(False, False, True, True, True, 2) 408 | output(enc.encode(json.loads(json_list))) 409 | return 410 | else: 411 | formatter = FORMATS[format] 412 | assert_usage(formatter != None, 413 | "Format {0} not recognised".format(format)) 414 | formatter_instance = formatter(columns, options) 415 | formatter_instance.display(json_list) 416 | 417 | class Lister: 418 | def verbose(self, string): 419 | if self.options.verbose: 420 | output(string) 421 | 422 | def display(self, json_list): 423 | depth = sys.maxint 424 | if len(self.columns) == 0: 425 | depth = int(self.options.depth) 426 | (columns, table) = self.list_to_table(json.loads(json_list), depth) 427 | if len(table) > 0: 428 | self.display_list(columns, table) 429 | else: 430 | self.verbose("No items") 431 | 432 | def list_to_table(self, items, max_depth): 433 | columns = {} 434 | column_ix = {} 435 | row = None 436 | table = [] 437 | 438 | def add(prefix, depth, item, fun): 439 | for key in item: 440 | column = prefix == '' and key or (prefix + '.' + key) 441 | if type(item[key]) == dict: 442 | if depth < max_depth: 443 | add(column, depth + 1, item[key], fun) 444 | elif type(item[key]) == list: 445 | # TODO - ATM this is only applications inside nodes. Not 446 | # sure how to handle this sensibly. 447 | pass 448 | else: 449 | fun(column, item[key]) 450 | 451 | def add_to_columns(col, val): 452 | columns[col] = True 453 | 454 | def add_to_row(col, val): 455 | if col in column_ix: 456 | row[column_ix[col]] = unicode(val) 457 | 458 | if len(self.columns) == 0: 459 | for item in items: 460 | add('', 1, item, add_to_columns) 461 | columns = columns.keys() 462 | columns.sort(key=column_sort_key) 463 | else: 464 | columns = self.columns 465 | 466 | for i in xrange(0, len(columns)): 467 | column_ix[columns[i]] = i 468 | for item in items: 469 | row = len(columns) * [''] 470 | add('', 1, item, add_to_row) 471 | table.append(row) 472 | 473 | return (columns, table) 474 | 475 | class TSVList(Lister): 476 | def __init__(self, columns, options): 477 | self.columns = columns 478 | self.options = options 479 | 480 | def display_list(self, columns, table): 481 | head = "" 482 | for col in columns: 483 | head += col + "\t" 484 | self.verbose(head) 485 | 486 | for row in table: 487 | line = "" 488 | for cell in row: 489 | line += cell + "\t" 490 | output(line) 491 | 492 | class LongList(Lister): 493 | def __init__(self, columns, options): 494 | self.columns = columns 495 | self.options = options 496 | 497 | def display_list(self, columns, table): 498 | sep = "\n" + "-" * 80 + "\n" 499 | max_width = 0 500 | for col in columns: 501 | max_width = max(max_width, len(col)) 502 | fmt = "{0:>" + unicode(max_width) + "}: {1}" 503 | output(sep) 504 | for i in xrange(0, len(table)): 505 | for j in xrange(0, len(columns)): 506 | output(fmt.format(columns[j], table[i][j])) 507 | output(sep) 508 | 509 | class TableList(Lister): 510 | def __init__(self, columns, options): 511 | self.columns = columns 512 | self.options = options 513 | 514 | def display_list(self, columns, table): 515 | total = [columns] 516 | total.extend(table) 517 | self.ascii_table(total) 518 | 519 | def ascii_table(self, rows): 520 | table = "" 521 | col_widths = [0] * len(rows[0]) 522 | for i in xrange(0, len(rows[0])): 523 | for j in xrange(0, len(rows)): 524 | col_widths[i] = max(col_widths[i], len(rows[j][i])) 525 | self.ascii_bar(col_widths) 526 | self.ascii_row(col_widths, rows[0], "^") 527 | self.ascii_bar(col_widths) 528 | for row in rows[1:]: 529 | self.ascii_row(col_widths, row, "<") 530 | self.ascii_bar(col_widths) 531 | 532 | def ascii_row(self, col_widths, row, align): 533 | txt = "|" 534 | for i in xrange(0, len(col_widths)): 535 | fmt = " {0:" + align + unicode(col_widths[i]) + "} " 536 | txt += fmt.format(row[i]) + "|" 537 | output(txt) 538 | 539 | def ascii_bar(self, col_widths): 540 | txt = "+" 541 | for w in col_widths: 542 | txt += ("-" * (w + 2)) + "+" 543 | output(txt) 544 | 545 | class KeyValueList(Lister): 546 | def __init__(self, columns, options): 547 | self.columns = columns 548 | self.options = options 549 | 550 | def display_list(self, columns, table): 551 | for i in xrange(0, len(table)): 552 | row = [] 553 | for j in xrange(0, len(columns)): 554 | row.append("{0}=\"{1}\"".format(columns[j], table[i][j])) 555 | output(" ".join(row)) 556 | 557 | # TODO handle spaces etc in completable names 558 | class BashList(Lister): 559 | def __init__(self, columns, options): 560 | self.columns = columns 561 | self.options = options 562 | 563 | def display_list(self, columns, table): 564 | ix = None 565 | for i in xrange(0, len(columns)): 566 | if columns[i] == 'name': 567 | ix = i 568 | if ix is not None: 569 | res = [] 570 | for row in table: 571 | res.append(row[ix]) 572 | output(" ".join(res)) 573 | 574 | FORMATS = { 575 | 'raw_json' : None, # Special cased 576 | 'pretty_json' : None, # Ditto 577 | 'tsv' : TSVList, 578 | 'long' : LongList, 579 | 'table' : TableList, 580 | 'kvp' : KeyValueList, 581 | 'bash' : BashList 582 | } 583 | 584 | def write_payload_file(payload_file, json_list): 585 | result = json.loads(json_list)[0] 586 | payload = result['payload'] 587 | payload_encoding = result['payload_encoding'] 588 | with open(payload_file, 'w') as f: 589 | if payload_encoding == 'base64': 590 | data = base64.b64decode(payload) 591 | else: 592 | data = payload 593 | f.write(data) 594 | 595 | def print_bash_completion(): 596 | script = """# This is a bash completion script for rabbitmqadmin. 597 | # Redirect it to a file, then source it or copy it to /etc/bash_completion.d 598 | # to get tab completion. rabbitmqadmin must be on your PATH for this to work. 599 | _rabbitmqadmin() 600 | { 601 | local cur prev opts base 602 | COMPREPLY=() 603 | cur="${COMP_WORDS[COMP_CWORD]}" 604 | prev="${COMP_WORDS[COMP_CWORD-1]}" 605 | 606 | opts="list show declare delete close purge import export get publish" 607 | fargs="--help --host --port --vhost --username --password --format --depth" 608 | 609 | case "${prev}" in 610 | list) 611 | COMPREPLY=( $(compgen -W '""" + " ".join(LISTABLE) + """' -- ${cur}) ) 612 | return 0 613 | ;; 614 | show) 615 | COMPREPLY=( $(compgen -W '""" + " ".join(SHOWABLE) + """' -- ${cur}) ) 616 | return 0 617 | ;; 618 | declare) 619 | COMPREPLY=( $(compgen -W '""" + " ".join(DECLARABLE.keys()) + """' -- ${cur}) ) 620 | return 0 621 | ;; 622 | delete) 623 | COMPREPLY=( $(compgen -W '""" + " ".join(DELETABLE.keys()) + """' -- ${cur}) ) 624 | return 0 625 | ;; 626 | close) 627 | COMPREPLY=( $(compgen -W '""" + " ".join(CLOSABLE.keys()) + """' -- ${cur}) ) 628 | return 0 629 | ;; 630 | purge) 631 | COMPREPLY=( $(compgen -W '""" + " ".join(PURGABLE.keys()) + """' -- ${cur}) ) 632 | return 0 633 | ;; 634 | export) 635 | COMPREPLY=( $(compgen -f ${cur}) ) 636 | return 0 637 | ;; 638 | import) 639 | COMPREPLY=( $(compgen -f ${cur}) ) 640 | return 0 641 | ;; 642 | -@(H|-host)) 643 | COMPREPLY=( $(compgen -A hostname ${cur}) ) 644 | return 0 645 | ;; 646 | -@(V|-vhost)) 647 | opts="$(rabbitmqadmin -q -f bash list vhosts)" 648 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) 649 | return 0 650 | ;; 651 | -@(u|-username)) 652 | opts="$(rabbitmqadmin -q -f bash list users)" 653 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) 654 | return 0 655 | ;; 656 | -@(f|-format)) 657 | COMPREPLY=( $(compgen -W \"""" + " ".join(FORMATS.keys()) + """\" -- ${cur}) ) 658 | return 0 659 | ;; 660 | 661 | """ 662 | for l in LISTABLE: 663 | key = l[0:len(l) - 1] 664 | script += " " + key + """) 665 | opts="$(rabbitmqadmin -q -f bash list """ + l + """)" 666 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) 667 | return 0 668 | ;; 669 | """ 670 | script += """ *) 671 | ;; 672 | esac 673 | 674 | COMPREPLY=($(compgen -W "${opts} ${fargs}" -- ${cur})) 675 | return 0 676 | } 677 | complete -F _rabbitmqadmin rabbitmqadmin 678 | """ 679 | output(script) 680 | 681 | if __name__ == "__main__": 682 | main() 683 | 684 | -------------------------------------------------------------------------------- /zabbix-templates/mysql-server/zabbix_agentd/zabbixmysql.conf: -------------------------------------------------------------------------------- 1 | # Add ss_get_mysql_stats.php to /etc/zabbix/scripts, make sure 'php -v' returns php version (i.e. php works) 2 | # 3 | # Run also SQL query: 4 | # 5 | # CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password'; 6 | # GRANT REPLICATION CLIENT, SELECT, PROCESS, SHOW DATABASES ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY 'password'; 7 | # FLUSH PRIVILEGES; 8 | 9 | UserParameter=mysqlnetstat[*], ss -nat | grep 3306 | grep -c $1 10 | UserParameter=mysql.version, HOME=/etc/zabbix mysqladmin version -u mysql_zabbix_user --password="mysql_zabbix_pass" | grep "Server version" | awk '{ print $ 3 }' 11 | UserParameter=mysql.ping,HOME=/etc/zabbix mysqladmin ping -u mysql_zabbix_user --password="mysql_zabbix_pass" | grep alive | wc -l 12 | UserParameter=mysql.threads,HOME=/etc/zabbix mysqladmin status -u mysql_zabbix_user --password="mysql_zabbix_pass" | cut -f3 -d":" | cut -f1 -d"Q" | tr -d ' ' 13 | UserParameter=mysql.questions,HOME=/etc/zabbix mysqladmin status -u mysql_zabbix_user --password="mysql_zabbix_pass" | cut -f4 -d":" | cut -f1 -d"S" | tr -d ' ' 14 | UserParameter=mysql.slowqueries,HOME=/etc/zabbix mysqladmin status -u mysql_zabbix_user --password="mysql_zabbix_pass" | cut -f5 -d":" | cut -f1 -d"O" | tr -d ' ' 15 | UserParameter=mysql.qps,HOME=/etc/zabbix mysqladmin status -u mysql_zabbix_user --password="mysql_zabbix_pass" | cut -f9 -d":" | tr -d ' ' 16 | UserParameter=mysql.connection,echo "show status like 'Max_used_connections'"| HOME=/etc/zabbix mysql -N -u mysql_zabbix_user --password="mysql_zabbix_pass" | tail -1 | awk '{print $2}' 17 | UserParameter=mysql.Key_read_requests,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a0 | awk -F: '{ print $2 }' 18 | UserParameter=mysql.Key_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a1 | awk -F: '{ print $2 }' 19 | UserParameter=mysql.Key_write_requests,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a2 | awk -F: '{ print $2 }' 20 | UserParameter=mysql.Key_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a3 | awk -F: '{ print $2 }' 21 | UserParameter=mysql.history_list,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a4 | awk -F: '{ print $2 }' 22 | UserParameter=mysql.innodb_transactions,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a5 | awk -F: '{ print $2 }' 23 | UserParameter=mysql.read_views,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a6 | awk -F: '{ print $2 }' 24 | UserParameter=mysql.current_transactions,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a7 | awk -F: '{ print $2 }' 25 | UserParameter=mysql.locked_transactions,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a8 | awk -F: '{ print $2 }' 26 | UserParameter=mysql.active_transactions,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items a9 | awk -F: '{ print $2 }' 27 | #UserParameter=mysql.setting.pool_size,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items aa | awk -F: '{ print $2 }' 28 | #UserParameter=mysql.free_pages,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ab | awk -F: '{ print $2 }' 29 | #UserParameter=mysql.database_pages,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ac | awk -F: '{ print $2 }' 30 | #UserParameter=mysql.modified_pages,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ad | awk -F: '{ print $2 }' 31 | #UserParameter=mysql.pages_read,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ae | awk -F: '{ print $2 }' 32 | #UserParameter=mysql.pages_created,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items af | awk -F: '{ print $2 }' 33 | #UserParameter=mysql.pages_written,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ag | awk -F: '{ print $2 }' 34 | #UserParameter=mysql.file_fsyncs,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ah | awk -F: '{ print $2 }' 35 | #UserParameter=mysql.file_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ai | awk -F: '{ print $2 }' 36 | #UserParameter=mysql.file_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items aj | awk -F: '{ print $2 }' 37 | #UserParameter=mysql.log_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ak | awk -F: '{ print $2 }' 38 | #UserParameter=mysql.pending_aio_log_ios,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items al | awk -F: '{ print $2 }' 39 | #UserParameter=mysql.pending_aio_sync_ios,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items am | awk -F: '{ print $2 }' 40 | #UserParameter=mysql.pending_buf_pool_flushes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items an | awk -F: '{ print $2 }' 41 | #UserParameter=mysql.pending_chkp_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ao | awk -F: '{ print $2 }' 42 | #UserParameter=mysql.pending_ibuf_aio_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ap | awk -F: '{ print $2 }' 43 | #UserParameter=mysql.pending_log_flushes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items aq | awk -F: '{ print $2 }' 44 | #UserParameter=mysql.pending_log_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ar | awk -F: '{ print $2 }' 45 | #UserParameter=mysql.pending_normal_aio_reads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items as | awk -F: '{ print $2 }' 46 | #UserParameter=mysql.pending_normal_aio_writes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items at | awk -F: '{ print $2 }' 47 | #UserParameter=mysql.ibuf_inserts,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items au | awk -F: '{ print $2 }' 48 | #UserParameter=mysql.ibuf_merged,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items av | awk -F: '{ print $2 }' 49 | #UserParameter=mysql.ibuf_merges,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items aw | awk -F: '{ print $2 }' 50 | #UserParameter=mysql.spin_waits,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ax | awk -F: '{ print $2 }' 51 | #UserParameter=mysql.spin_rounds,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ay | awk -F: '{ print $2 }' 52 | #UserParameter=mysql.os_waits,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items az | awk -F: '{ print $2 }' 53 | #UserParameter=mysql.rows_inserted,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b0 | awk -F: '{ print $2 }' 54 | #UserParameter=mysql.rows_updated,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b1 | awk -F: '{ print $2 }' 55 | #UserParameter=mysql.rows_deleted,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b2 | awk -F: '{ print $2 }' 56 | #UserParameter=mysql.rows_read,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b3 | awk -F: '{ print $2 }' 57 | UserParameter=mysql.Table_locks_waited,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b4 | awk -F: '{ print $2 }' 58 | UserParameter=mysql.Table_locks_immediate,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b5 | awk -F: '{ print $2 }' 59 | UserParameter=mysql.Slow_queries,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b6 | awk -F: '{ print $2 }' 60 | UserParameter=mysql.Open_files,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b7 | awk -F: '{ print $2 }' 61 | UserParameter=mysql.Open_tables,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b8 | awk -F: '{ print $2 }' 62 | UserParameter=mysql.Opened_tables,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items b9 | awk -F: '{ print $2 }' 63 | UserParameter=mysql.innodb_open_files,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ba | awk -F: '{ print $2 }' 64 | UserParameter=mysql.setting.open_files_limit,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bb | awk -F: '{ print $2 }' 65 | UserParameter=mysql.setting.table_cache,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bc | awk -F: '{ print $2 }' 66 | UserParameter=mysql.Aborted_clients,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bd | awk -F: '{ print $2 }' 67 | UserParameter=mysql.Aborted_connects,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items be | awk -F: '{ print $2 }' 68 | UserParameter=mysql.Max_used_connections,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bf | awk -F: '{ print $2 }' 69 | UserParameter=mysql.Slow_launch_threads,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bg | awk -F: '{ print $2 }' 70 | UserParameter=mysql.Threads_cached,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bh | awk -F: '{ print $2 }' 71 | UserParameter=mysql.Threads_connected,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bi | awk -F: '{ print $2 }' 72 | UserParameter=mysql.Threads_created,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bj | awk -F: '{ print $2 }' 73 | UserParameter=mysql.Threads_running,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bk | awk -F: '{ print $2 }' 74 | UserParameter=mysql.setting.max_connections,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bl | awk -F: '{ print $2 }' 75 | UserParameter=mysql.setting.thread_cache_size,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bm | awk -F: '{ print $2 }' 76 | UserParameter=mysql.Connections,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bn | awk -F: '{ print $2 }' 77 | UserParameter=mysql.slave_running,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bo | awk -F: '{ print $2 }' 78 | UserParameter=mysql.slave_stopped,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bp | awk -F: '{ print $2 }' 79 | UserParameter=mysql.Slave_retried_transactions,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bq | awk -F: '{ print $2 }' 80 | UserParameter=mysql.slave_lag,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items br | awk -F: '{ print $2 }' 81 | UserParameter=mysql.Slave_open_temp_tables,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bs | awk -F: '{ print $2 }' 82 | UserParameter=mysql.Qcache_free_blocks,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bt | awk -F: '{ print $2 }' 83 | UserParameter=mysql.Qcache_free_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bu | awk -F: '{ print $2 }' 84 | UserParameter=mysql.Qcache_hits,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bv | awk -F: '{ print $2 }' 85 | UserParameter=mysql.Qcache_inserts,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bw | awk -F: '{ print $2 }' 86 | UserParameter=mysql.Qcache_lowmem_prunes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bx | awk -F: '{ print $2 }' 87 | UserParameter=mysql.Qcache_not_cached,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items by | awk -F: '{ print $2 }' 88 | UserParameter=mysql.Qcache_queries_in_cache,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items bz | awk -F: '{ print $2 }' 89 | UserParameter=mysql.Qcache_total_blocks,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c0 | awk -F: '{ print $2 }' 90 | UserParameter=mysql.setting.query_cache_size,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c1 | awk -F: '{ print $2 }' 91 | UserParameter=mysql.Questions,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c2 | awk -F: '{ print $2 }' 92 | UserParameter=mysql.Com_update,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c3 | awk -F: '{ print $2 }' 93 | UserParameter=mysql.Com_insert,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c4 | awk -F: '{ print $2 }' 94 | UserParameter=mysql.Com_select,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c5 | awk -F: '{ print $2 }' 95 | UserParameter=mysql.Com_delete,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c6 | awk -F: '{ print $2 }' 96 | UserParameter=mysql.Com_replace,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c7 | awk -F: '{ print $2 }' 97 | UserParameter=mysql.Com_load,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c8 | awk -F: '{ print $2 }' 98 | UserParameter=mysql.Com_update_multi,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items c9 | awk -F: '{ print $2 }' 99 | UserParameter=mysql.Com_insert_select,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ca | awk -F: '{ print $2 }' 100 | UserParameter=mysql.Com_delete_multi,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cb | awk -F: '{ print $2 }' 101 | UserParameter=mysql.Com_replace_select,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cc | awk -F: '{ print $2 }' 102 | UserParameter=mysql.Select_full_join,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cd | awk -F: '{ print $2 }' 103 | UserParameter=mysql.Select_full_range_join,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ce | awk -F: '{ print $2 }' 104 | UserParameter=mysql.Select_range,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cf | awk -F: '{ print $2 }' 105 | UserParameter=mysql.Select_range_check,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cg | awk -F: '{ print $2 }' 106 | UserParameter=mysql.Select_scan,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ch | awk -F: '{ print $2 }' 107 | UserParameter=mysql.Sort_merge_passes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ci | awk -F: '{ print $2 }' 108 | UserParameter=mysql.Sort_range,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cj | awk -F: '{ print $2 }' 109 | UserParameter=mysql.Sort_rows,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ck | awk -F: '{ print $2 }' 110 | UserParameter=mysql.Sort_scan,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cl | awk -F: '{ print $2 }' 111 | UserParameter=mysql.Created_tmp_tables,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cm | awk -F: '{ print $2 }' 112 | UserParameter=mysql.Created_tmp_disk_tables,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cn | awk -F: '{ print $2 }' 113 | UserParameter=mysql.Created_tmp_files,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items co | awk -F: '{ print $2 }' 114 | UserParameter=mysql.Bytes_sent,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cp | awk -F: '{ print $2 }' 115 | UserParameter=mysql.Bytes_received,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cq | awk -F: '{ print $2 }' 116 | UserParameter=mysql.innodb_log_buffer_size,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cr | awk -F: '{ print $2 }' 117 | #UserParameter=mysql.unflushed_log,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cs | awk -F: '{ print $2 }' 118 | #UserParameter=mysql.log_bytes_flushed,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ct | awk -F: '{ print $2 }' 119 | #UserParameter=mysql.log_bytes_written,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cu | awk -F: '{ print $2 }' 120 | UserParameter=mysql.relay_log_space,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cv | awk -F: '{ print $2 }' 121 | UserParameter=mysql.setting.binlog_cache_size,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cw | awk -F: '{ print $2 }' 122 | UserParameter=mysql.Binlog_cache_disk_use,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cx | awk -F: '{ print $2 }' 123 | UserParameter=mysql.Binlog_cache_use,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cy | awk -F: '{ print $2 }' 124 | UserParameter=mysql.binary_log_space,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items cz | awk -F: '{ print $2 }' 125 | UserParameter=mysql.innodb_locked_tables,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d0 | awk -F: '{ print $2 }' 126 | UserParameter=mysql.innodb_lock_structs,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d1 | awk -F: '{ print $2 }' 127 | UserParameter=mysql.State_closing_tables,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d2 | awk -F: '{ print $2 }' 128 | UserParameter=mysql.State_copying_to_tmp_table,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d3 | awk -F: '{ print $2 }' 129 | UserParameter=mysql.State_end,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d4 | awk -F: '{ print $2 }' 130 | UserParameter=mysql.State_freeing_items,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d5 | awk -F: '{ print $2 }' 131 | UserParameter=mysql.State_init,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d6 | awk -F: '{ print $2 }' 132 | UserParameter=mysql.State_locked,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d7 | awk -F: '{ print $2 }' 133 | UserParameter=mysql.State_login,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d8 | awk -F: '{ print $2 }' 134 | UserParameter=mysql.State_preparing,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items d9 | awk -F: '{ print $2 }' 135 | UserParameter=mysql.State_reading_from_net,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items da | awk -F: '{ print $2 }' 136 | UserParameter=mysql.State_sending_data,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items db | awk -F: '{ print $2 }' 137 | UserParameter=mysql.State_sorting_result,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dc | awk -F: '{ print $2 }' 138 | UserParameter=mysql.State_statistics,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dd | awk -F: '{ print $2 }' 139 | UserParameter=mysql.State_updating,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items de | awk -F: '{ print $2 }' 140 | UserParameter=mysql.State_writing_to_net,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items df | awk -F: '{ print $2 }' 141 | UserParameter=mysql.State_none,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dg | awk -F: '{ print $2 }' 142 | UserParameter=mysql.State_other,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dh | awk -F: '{ print $2 }' 143 | UserParameter=mysql.Handler_commit,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items di | awk -F: '{ print $2 }' 144 | UserParameter=mysql.Handler_delete,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dj | awk -F: '{ print $2 }' 145 | UserParameter=mysql.Handler_discover,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dk | awk -F: '{ print $2 }' 146 | UserParameter=mysql.Handler_prepare,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dl | awk -F: '{ print $2 }' 147 | UserParameter=mysql.Handler_read_first,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dm | awk -F: '{ print $2 }' 148 | UserParameter=mysql.Handler_read_key,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dn | awk -F: '{ print $2 }' 149 | UserParameter=mysql.Handler_read_next,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items do | awk -F: '{ print $2 }' 150 | UserParameter=mysql.Handler_read_prev,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dp | awk -F: '{ print $2 }' 151 | UserParameter=mysql.Handler_read_rnd,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dq | awk -F: '{ print $2 }' 152 | UserParameter=mysql.Handler_read_rnd_next,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dr | awk -F: '{ print $2 }' 153 | UserParameter=mysql.Handler_rollback,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ds | awk -F: '{ print $2 }' 154 | UserParameter=mysql.Handler_savepoint,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dt | awk -F: '{ print $2 }' 155 | UserParameter=mysql.Handler_savepoint_rollback,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items du | awk -F: '{ print $2 }' 156 | UserParameter=mysql.Handler_update,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dv | awk -F: '{ print $2 }' 157 | UserParameter=mysql.Handler_write,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dw | awk -F: '{ print $2 }' 158 | UserParameter=mysql.innodb_tables_in_use,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dx | awk -F: '{ print $2 }' 159 | UserParameter=mysql.innodb_lock_wait_secs,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dy | awk -F: '{ print $2 }' 160 | #UserParameter=mysql.hash_index_cells_total,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items dz | awk -F: '{ print $2 }' 161 | #UserParameter=mysql.hash_index_cells_used,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e0 | awk -F: '{ print $2 }' 162 | #UserParameter=mysql.total_mem_alloc,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e1 | awk -F: '{ print $2 }' 163 | #UserParameter=mysql.additional_pool_alloc,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e2 | awk -F: '{ print $2 }' 164 | UserParameter=mysql.uncheckpointed_bytes,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e3 | awk -F: '{ print $2 }' 165 | #UserParameter=mysql.ibuf_used_cells,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e4 | awk -F: '{ print $2 }' 166 | #UserParameter=mysql.ibuf_free_cells,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e5 | awk -F: '{ print $2 }' 167 | #UserParameter=mysql.ibuf_cell_count,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e6 | awk -F: '{ print $2 }' 168 | UserParameter=mysql.adaptive_hash_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e7 | awk -F: '{ print $2 }' 169 | UserParameter=mysql.page_hash_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e8 | awk -F: '{ print $2 }' 170 | UserParameter=mysql.dictionary_cache_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items e9 | awk -F: '{ print $2 }' 171 | UserParameter=mysql.file_system_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ea | awk -F: '{ print $2 }' 172 | UserParameter=mysql.lock_system_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items eb | awk -F: '{ print $2 }' 173 | UserParameter=mysql.recovery_system_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ec | awk -F: '{ print $2 }' 174 | UserParameter=mysql.thread_hash_memory,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ed | awk -F: '{ print $2 }' 175 | UserParameter=mysql.innodb_sem_waits,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ee | awk -F: '{ print $2 }' 176 | UserParameter=mysql.innodb_sem_wait_time_ms,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ef | awk -F: '{ print $2 }' 177 | UserParameter=mysql.Key_buf_bytes_unflushed,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items eg | awk -F: '{ print $2 }' 178 | UserParameter=mysql.Key_buf_bytes_used,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items eh | awk -F: '{ print $2 }' 179 | UserParameter=mysql.setting.key_buffer_size,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ei | awk -F: '{ print $2 }' 180 | UserParameter=mysql.Innodb_row_lock_time,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ej | awk -F: '{ print $2 }' 181 | UserParameter=mysql.Innodb_row_lock_waits,php -qc /etc/zabbix/php.ini /etc/zabbix/plugins/ss_get_mysql_stats.php --host localhost --items ek | awk -F: '{ print $2 }' 182 | --------------------------------------------------------------------------------