├── playbook ├── hosts ├── site.yml └── README.md ├── .gitignore ├── iostat ├── iostat-cron.conf ├── iostat-params.conf ├── dev-discovery.sh ├── iostat-cron.sh ├── README.md └── iostat-check.sh ├── mysql ├── mysql-params.conf ├── mysql-check.sh ├── README.md └── mysql-template.xml ├── nginx ├── nginx-params.conf ├── README.md ├── nginx-check.sh └── nginx-template.xml ├── php-fpm ├── php-fpm-params.conf ├── README.md ├── php-fpm-check.sh └── php-fpm-template.xml ├── jvm ├── jvm-params.conf ├── README.md ├── jvm-check.pl └── jvm-service.pl ├── mysql-v2 ├── mysql-params-v2.conf ├── README.md └── mysql-check-v2.sh ├── README.md └── hadoop ├── hadoop-params.conf ├── README.md ├── create-aggr-item.py ├── hadoop-collector.py ├── hadoop-datanode-template.xml ├── hadoop-tasktracker-template.xml ├── hadoop-basic-template.xml └── hadoop-namenode-template.xml /playbook/hosts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playbook/site.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .pydevproject 3 | .settings 4 | 5 | playbook/venv 6 | 7 | -------------------------------------------------------------------------------- /iostat/iostat-cron.conf: -------------------------------------------------------------------------------- 1 | * * * * * root /usr/local/zabbix-agent-ops/bin/iostat-cron.sh 2 | -------------------------------------------------------------------------------- /mysql/mysql-params.conf: -------------------------------------------------------------------------------- 1 | UserParameter=mysql[*],/usr/local/zabbix-2.0.3/bin/mysql-check.sh $1 $2 2 | -------------------------------------------------------------------------------- /nginx/nginx-params.conf: -------------------------------------------------------------------------------- 1 | UserParameter=nginx[*],/usr/local/zabbix-agent-ops/bin/nginx-check.sh "$1" "$2" 2 | -------------------------------------------------------------------------------- /php-fpm/php-fpm-params.conf: -------------------------------------------------------------------------------- 1 | UserParameter=php-fpm[*],/usr/local/zabbix-agent-ops/bin/php-fpm-check.sh "$1" "$2" 2 | -------------------------------------------------------------------------------- /jvm/jvm-params.conf: -------------------------------------------------------------------------------- 1 | UserParameter=jvm.collector[*],/usr/local/zabbix-agent-ops/bin/jvm-check.pl -host "$1" -jvmport "$2" 2 | -------------------------------------------------------------------------------- /iostat/iostat-params.conf: -------------------------------------------------------------------------------- 1 | UserParameter=custom.vfs.dev.discovery,/usr/local/zabbix-agent-ops/bin/dev-discovery.sh 2 | UserParameter=iostat[*],/usr/local/zabbix-agent-ops/bin/iostat-check.sh $1 $2 3 | -------------------------------------------------------------------------------- /mysql-v2/mysql-params-v2.conf: -------------------------------------------------------------------------------- 1 | UserParameter=mysql-v2.discovery,/usr/local/zabbix-agent-ops/bin/mysql-check-v2.sh discovery 2 | UserParameter=mysql-v2.collector[*],/usr/local/zabbix-agent-ops/bin/mysql-check-v2.sh collector "$1" $2 3 | -------------------------------------------------------------------------------- /playbook/README.md: -------------------------------------------------------------------------------- 1 | Ansible Playbook 2 | ================ 3 | 4 | [Ansible][1] provisioning tool. 5 | 6 | Install 7 | ------- 8 | 9 | ```bash 10 | $ virtualenv venv --distribute 11 | $ source venv/bin/activate 12 | $ pip install ansible 13 | ``` 14 | 15 | [1]: http://www.ansibleworks.com/ 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | zabbix-templates 2 | ================ 3 | 4 | Zabbix templates for various services and applications. 5 | 6 | Currently there are: 7 | 8 | * iostat 9 | * Nginx 10 | * php-fpm 11 | * MySQL 12 | * JVM 13 | 14 | There're READMEs for every templates. 15 | 16 | ## TODO 17 | 18 | * Low-level discovery for JVM 19 | * ZooKeeper 20 | * Storm 21 | * Hadoop 22 | -------------------------------------------------------------------------------- /iostat/dev-discovery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DEVICES=`iostat | awk '{ if ($1 ~ "^([shxv]|xv)d[a-z]$") { print $1 } }'` 4 | 5 | COUNT=`echo "$DEVICES" | wc -l` 6 | INDEX=0 7 | echo '{"data":[' 8 | echo "$DEVICES" | while read LINE; do 9 | echo -n '{"{#DEVNAME}":"'$LINE'"}' 10 | INDEX=`expr $INDEX + 1` 11 | if [ $INDEX -lt $COUNT ]; then 12 | echo ',' 13 | fi 14 | done 15 | echo ']}' 16 | 17 | -------------------------------------------------------------------------------- /mysql/mysql-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z $1 ] || [ -z $2 ]; then 4 | exit 1 5 | fi 6 | 7 | HOST_HOST=$1 8 | QUERY_KEY=$2 9 | 10 | if [ "x$QUERY_KEY" = "xReplication_delay" ]; then 11 | 12 | mysql -uroot -ppassword -h127.0.0.1 -P3306 -Dheartbeat_db -e "SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(ts) FROM heartbeat ORDER BY id DESC LIMIT 1" | sed '1d' 13 | 14 | else 15 | 16 | mysqladmin -uroot -ppassword -h127.0.0.1 -P3306 extended-status | grep -w "$QUERY_KEY" | awk '{print $4}' 17 | 18 | fi 19 | 20 | -------------------------------------------------------------------------------- /hadoop/hadoop-params.conf: -------------------------------------------------------------------------------- 1 | 2 | UserParameter=hadoop.namenode.collector[*],/usr/local/zabbix-agent-ops/bin/hadoop-collector.py -t namenode -s "$1" 3 | 4 | UserParameter=hadoop.jobtracker.collector[*],/usr/local/zabbix-agent-ops/bin/hadoop-collector.py -t jobtracker -s "$1" 5 | 6 | UserParameter=hadoop.tasktracker.collector[*],/usr/local/zabbix-agent-ops/bin/hadoop-collector.py -t tasktracker -s "$1" --jobtracker-host="$2" --jobtracker-port="$3" 7 | 8 | UserParameter=hadoop.datanode.collector[*],/usr/local/zabbix-agent-ops/bin/hadoop-collector.py -t datanode -s "$1" --namenode-host="$2" --namenode-port="$3" 9 | 10 | -------------------------------------------------------------------------------- /iostat/iostat-cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################## 3 | # Zabbix monitoring script 4 | # 5 | # Info: 6 | # - cron job to gather iostat data 7 | # - can not do real time as iostat data gathering will exceed 8 | # Zabbix agent timeout 9 | ################################## 10 | # Contact: 11 | # vincent.viallet@gmail.com 12 | ################################## 13 | # ChangeLog: 14 | # 20100922 VV initial creation 15 | ################################## 16 | 17 | # source data file 18 | DEST_DATA=/usr/local/zabbix-agent-ops/var/iostat-data 19 | TMP_DATA=/usr/local/zabbix-agent-ops/var/iostat-data.tmp 20 | 21 | # 22 | # gather data in temp file first, then move to final location 23 | # it avoids zabbix-agent to gather data from a half written source file 24 | # 25 | # iostat -kx 10 2 - will display 2 lines : 26 | # - 1st: statistics since boot -- useless 27 | # - 2nd: statistics over the last 10 sec 28 | # 29 | iostat -kx 10 2 > $TMP_DATA 30 | mv $TMP_DATA $DEST_DATA 31 | 32 | 33 | -------------------------------------------------------------------------------- /iostat/README.md: -------------------------------------------------------------------------------- 1 | Template iostat 2 | =============== 3 | 4 | Show `iostat` result in Zabbix. 5 | 6 | 7 | INSTALL 8 | ------- 9 | 10 | Assume the Zabbix agent directory is /zabbix-agent/. 11 | 12 | ### Install Cron Job 13 | 14 | Since the first output of `iostat` is the statistics since boot time, we need to wait for a period (like 10 seconds) to get the result, which should be done through cron job, otherwise it'll surpass the zabbix agent's timeout. 15 | 16 | Do the following two steps: 17 | 18 | 1. Copy iostat-cron.sh to /zabbix-agent/bin/; 19 | 2. Copy iostat-cron.conf to /etc/cron.d/; 20 | 21 | After a while, you'll see the iostat-data file in /zabbix-agent/var/. 22 | 23 | ### Install User Parameters 24 | 25 | To expose the iostat-data to Zabbix, do the following steps: 26 | 27 | 1. Copy dev-discovery.sh and iostat-check.sh to /zabbix-agent/bin/, the former one is to enable disk device discovery capability. 28 | 2. Copy iostat-params.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/. 29 | 30 | ### Import Template 31 | 32 | Import iostat-template.xml, and link it to a host. 33 | 34 | 35 | CREDITS 36 | ------- 37 | 38 | Some of the scripts are from https://github.com/zbal/zabbix. 39 | 40 | -------------------------------------------------------------------------------- /mysql/README.md: -------------------------------------------------------------------------------- 1 | Template MySQL 2 | ============ 3 | 4 | Show MySQL statistics in Zabbix. 5 | 6 | INSTALL 7 | ------- 8 | 9 | Assume the Zabbix agent is installed in /zabbix-agent/ directory. 10 | 11 | ### Preparatory 12 | 13 | This package uses `mysql` and `mysqladmin` commands to gather information of MySQL. 14 | 15 | ### Install Script and Add User Parameters 16 | 17 | Copy mysql-check.sh to /zabbix-agent/bin/. Copy mysql-params.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/. Restart Zabbix agent. 18 | 19 | Edit mysql-check.sh to configure username and password. 20 | 21 | ### Import Template 22 | 23 | Import mysql-template.xml, and link it to a host. 24 | 25 | HOW IT WORKS 26 | ------------ 27 | 28 | ### mysqladmin 29 | 30 | Most statistics items are from `mysqladmin extended-status`. 31 | 32 | ### Replication Delay 33 | 34 | To detect the replication delay (in sec) of Slave database, we use a dedicated `heartbeat_db`, in which the Master database update the timestamp periodically, and the Slave agents check the difference between current timestamp and the heartbeat_db's timestamp. 35 | 36 | The `heartbeat_db.heartbeat` table's structure is: 37 | 38 | ```sql 39 | CREATE TABLE `heartbeat` ( 40 | `id` int(11) NOT NULL AUTO_INCREMENT, 41 | `ts` datetime NOT NULL, 42 | RIMARY KEY (`id`) 43 | ) 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /nginx/README.md: -------------------------------------------------------------------------------- 1 | Template Nginx 2 | ============== 3 | 4 | Show Nginx status in Zabbix. 5 | 6 | REQUIREMENTS 7 | ------------ 8 | 9 | * Zabbix Server **2.0** 10 | * Zabbix Agent **2.0** 11 | * Wget 12 | 13 | INSTALL 14 | ------- 15 | 16 | Assume the Zabbix agent is installed in /zabbix-agent/ directory. 17 | 18 | ### Nginx HttpStubStatusModule 19 | 20 | Nginx needs to be built with HttpStubStatusModule, i.e. --with-http_stub_status_module. You can use `nginx -V` to check whether the current binary includes this module. 21 | 22 | More information could be found in this [Wiki][1] 23 | 24 | ### Add Configuration 25 | 26 | Add the following into Nginx configuration: 27 | 28 |
29 | server {
30 |     listen 10061;
31 |     location /nginx_status {
32 |         stub_status on;
33 |         access_log off;
34 |         allow 127.0.0.1;
35 |         deny all;
36 |     }
37 | }
38 | 
39 | 40 | Reload Nginx, and use `curl http://127.0.0.1:10061/nginx_status` to get the statistics. 41 | 42 | ### Install script nginx-check.sh 43 | 44 | Create directory /usr/local/zabbix-agent-ops/bin/ and copy nginx-check.sh to inside. 45 | 46 | ### Add User Parameters 47 | 48 | Copy nginx-params.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/. Restart Zabbix agent. 49 | 50 | ### Import Template 51 | 52 | Import nginx-template.xml, and link it to a host. Set the host macro {$NGINX_STATUS_URL} if needed. 53 | 54 | 55 | CREDITS 56 | ------- 57 | 58 | The scripts are form http://github.com/zbal/zabbix. 59 | 60 | [1]: http://wiki.nginx.org/HttpStubStatusModule 61 | -------------------------------------------------------------------------------- /jvm/README.md: -------------------------------------------------------------------------------- 1 | Template JVM 2 | ============ 3 | 4 | Show JVM statistics in Zabbix. 5 | 6 | INSTALL 7 | ------- 8 | 9 | Assume the Zabbix agent is installed in /zabbix-agent/ directory. 10 | 11 | ### A Compatible JDK 12 | 13 | This package uses `jstat` and `jstack` commands to gather information of jVM. 14 | 15 | ### Start Daemon 16 | 17 | Since the Zabbix agent runs in zabbix user, making it impossible to attache to JVMs running under other users. The solution is to start a daemon under that user and provide socket access to gather the information. 18 | 19 | $ ./jvm-service.pl -d 20 | 21 | It will write logs into /tmp/jvm-service.log 22 | 23 | ### Install Script and Add User Parameters 24 | 25 | Copy jvm-check.pl to /zabbix-agent/bin/. Copy jvm-params.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/. Restart Zabbix agent. 26 | 27 | ### Import Template 28 | 29 | Import jvm-template.xml, and link it to a host. Set the host macro {$JVMPORT} to which the JVM you want to monitor bind. 30 | 31 | HOW IT WORKS 32 | ------------ 33 | 34 | To gather information more effectively, I didn't use a lot of user parameters in the configuration file, to run multiple times. Instead, I used the 'zabbix agent trapper' data type, and run another script sending multiple data items to zabbix server. 35 | 36 | Again, instead of setup a cron job for the script, I used another 'zabbix agent' data type to let the server trigger this script. 37 | 38 | In case the `jstat` command spends more than 3 seconds, which surpasses the timeout limit of Zabbix, so you may want to adjust the `Timeout` option in *both* Zabbix server and agent configuration. 39 | 40 | -------------------------------------------------------------------------------- /php-fpm/README.md: -------------------------------------------------------------------------------- 1 | Template php-fpm 2 | ================ 3 | 4 | Show php-fpm statistics in Zabbix. 5 | 6 | REQUIREMENTS 7 | ------------ 8 | 9 | * Zabbix Server **2.0** 10 | * Zabbix Agent **2.0** 11 | * Wget 12 | 13 | INSTALL 14 | ------- 15 | 16 | Assume the Zabbix agent is installed in /zabbix-agent/ directory. 17 | 18 | ### Configure php-fpm 19 | 20 | Open the php-fpm pool's configuration file, uncomment the 'pm.status=' directive: 21 | 22 | pm.status_path = /php-fpm_status 23 | 24 | Since php-fpm's statistics is collected by different pools, so you need to create corresponding hosts for them. 25 | 26 | ### Configure Nginx 27 | 28 | Add the following lines to Nginx configuration: 29 | 30 | ``` 31 | server { 32 | listen 10061; 33 | 34 | location /php-fpm_status { 35 | fastcgi_pass 127.0.0.1:9000; 36 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 37 | include fastcgi_params; 38 | } 39 | } 40 | ``` 41 | 42 | After restarting both php-fpm and nginx, try the following command to test: 43 | 44 | $ curl http://127.0.0.1:10061/php-fpm_status 45 | 46 | ### Install script php-fpm-check.sh 47 | 48 | Create directory /usr/local/zabbix-agent-ops/bin/ and copy php-fpm-check.sh to inside. 49 | 50 | ### Add User Parameters 51 | 52 | Copy php-fpm-params.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/. Restart Zabbix agent. 53 | 54 | ### Import Template 55 | 56 | Import php-fpm-template.xml, and link it to a host. Set the host macro {$PHP_FPM_STATUS_URL} if needed. 57 | 58 | 59 | CREDITS 60 | ------- 61 | 62 | Some of the scripts are form http://github.com/zbal/zabbix. 63 | 64 | -------------------------------------------------------------------------------- /php-fpm/php-fpm-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################## 3 | # Zabbix monitoring script 4 | # 5 | # php-fpm: 6 | # - anything available via FPM status page 7 | # 8 | ################################## 9 | # Contact: 10 | # vincent.viallet@gmail.com 11 | ################################## 12 | # ChangeLog: 13 | # 20100922 VV initial creation 14 | ################################## 15 | 16 | # Zabbix requested parameter 17 | ZBX_REQ_DATA="$1" 18 | ZBX_REQ_DATA_URL="$2" 19 | 20 | # Nginx defaults 21 | NGINX_STATUS_DEFAULT_URL="http://localhost:80/php-fpm_status" 22 | WGET_BIN="/usr/bin/wget" 23 | 24 | # 25 | # Error handling: 26 | # - need to be displayable in Zabbix (avoid NOT_SUPPORTED) 27 | # - items need to be of type "float" (allow negative + float) 28 | # 29 | ERROR_NO_ACCESS_FILE="-0.9900" 30 | ERROR_NO_ACCESS="-0.9901" 31 | ERROR_WRONG_PARAM="-0.9902" 32 | ERROR_DATA="-0.9903" # either can not connect / bad host / bad port 33 | 34 | # Handle host and port if non-default 35 | if [ ! -z "$ZBX_REQ_DATA_URL" ]; then 36 | URL="$ZBX_REQ_DATA_URL" 37 | else 38 | URL="$NGINX_STATUS_DEFAULT_URL" 39 | fi 40 | 41 | # save the nginx stats in a variable for future parsing 42 | NGINX_STATS=$($WGET_BIN -q $URL -O - 2> /dev/null) 43 | 44 | # error during retrieve 45 | if [ $? -ne 0 -o -z "$NGINX_STATS" ]; then 46 | echo $ERROR_DATA 47 | exit 1 48 | fi 49 | 50 | # 51 | # Extract data from nginx stats 52 | # 53 | RESULT=$(echo "$NGINX_STATS" | awk 'match($0, "^'"$ZBX_REQ_DATA"':[[:space:]]+(.*)", a) { print a[1] }') 54 | if [ $? -ne 0 -o -z "$RESULT" ]; then 55 | echo $ERROR_WRONG_PARAM 56 | exit 1 57 | fi 58 | 59 | echo $RESULT 60 | 61 | exit 0 62 | -------------------------------------------------------------------------------- /mysql-v2/README.md: -------------------------------------------------------------------------------- 1 | Template MySQL 2 | ============ 3 | 4 | Show MySQL statistics in Zabbix. Version 2 uses LLD (Low Level Discovery) to bind multiple MySQL instances to the same host. 5 | 6 | INSTALL 7 | ------- 8 | 9 | Assume the Zabbix agent is installed in /zabbix-agent/ directory. 10 | 11 | ### Preparatory 12 | 13 | This package uses `mysql` and `mysqladmin` commands to gather information of MySQL. 14 | 15 | ### Install Script and Add User Parameters 16 | 17 | * Copy mysql-check-v2.sh to /zabbix-agent/bin/. 18 | * Copy mysql-params-v2.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/. 19 | * Edit mysql-check-v2.sh to configure username and password. 20 | * Restart Zabbix agent. 21 | 22 | ### Import Template 23 | 24 | Import mysql-template-v2.xml, and link it to a host. 25 | 26 | HOW IT WORKS 27 | ------------ 28 | 29 | ### Discovery 30 | 31 | `mysql-check-v2.sh` has two forms of invocation: 32 | 33 | * `./mysql-check-v2.sh discovery` Return a JSON encoded string indicating the MySQL instances (or ports) to be discovered. 34 | * `./mysql-check-v2.sh collector "$host" $port` Get and submit the statistics from MySQL Server to Zabbix Server. (use `zabbix trapper` data type) 35 | 36 | ### Collector 37 | 38 | In order not to run `mysqladmin` several times to get enough information, here we use `Zabbix trapper` data type to let the agent send data actively. Also to save the trouble of adding a cron job, here we use a `Zabbix agent` item to trigger the data collection process. 39 | 40 | ### `mysqladmin` 41 | 42 | Most statistics items are from `mysqladmin extended-status`. 43 | 44 | ### Replication Delay 45 | 46 | To detect the replication delay (in sec) of Slave database, we use a dedicated `heartbeat_db`, in which the Master database update the timestamp periodically, and the Slave agents check the difference between current timestamp and the heartbeat_db's timestamp. 47 | 48 | The `heartbeat_db.heartbeat` table's structure is: 49 | 50 | ```sql 51 | CREATE TABLE `heartbeat` ( 52 | `id` int(11) NOT NULL AUTO_INCREMENT, 53 | `ts` datetime NOT NULL, 54 | RIMARY KEY (`id`) 55 | ) 56 | ``` 57 | -------------------------------------------------------------------------------- /mysql-v2/mysql-check-v2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MYSQL_USERNAME="root" 4 | MYSQL_PASSWORD="password" 5 | MYSQL_PORTS="3306" # use space-seperated multiple instance ports 6 | 7 | MYSQL_VARIABLES="Connections Aborted_clients Aborted_connects Com_select Com_insert Com_update Com_replace Com_delete Slow_queries Threads_connected Threads_running" 8 | 9 | ZABBIX_HOME="/usr/local/zabbix-agent-ops" 10 | ZABBIX_BIN="$ZABBIX_HOME/bin/zabbix_sender -c $ZABBIX_HOME/etc/zabbix_agentd.conf" 11 | 12 | function usage() { 13 | echo "Usage: ./mysql-check-v2.sh [host] [port]" 14 | exit 1 15 | } 16 | 17 | if [ "x$1" = "xdiscovery" ]; then 18 | 19 | COUNT=`echo "$MYSQL_PORTS" | wc -w` 20 | INDEX=0 21 | echo '{"data":[' 22 | for MYSQL_PORT in $MYSQL_PORTS; do 23 | echo -n '{"{#MYSQL_PORT}":"'$MYSQL_PORT'"}' 24 | INDEX=`expr $INDEX + 1` 25 | if [ $INDEX -lt $COUNT ]; then 26 | echo ',' 27 | fi 28 | done 29 | echo ']}' 30 | 31 | elif [ "x$1" = "xcollector" ]; then 32 | 33 | if [ -z $2 ] || [ -z $3 ]; then 34 | usage 35 | fi 36 | 37 | HOST_HOST=$2 38 | MYSQL_PORT=$3 39 | 40 | EXTENDED_STATUS=`mysqladmin -u$MYSQL_USERNAME -p$MYSQL_PASSWORD -h127.0.0.1 -P$MYSQL_PORT extended-status` 41 | 42 | DATA="" 43 | for MYSQL_VARIABLE in $MYSQL_VARIABLES; do 44 | VALUE=`echo "$EXTENDED_STATUS" | grep -w "$MYSQL_VARIABLE" | awk '{print $4}'` 45 | if [ -n "$VALUE" ]; then 46 | DATA=$DATA"- mysql-v2.check[$MYSQL_PORT,$MYSQL_VARIABLE] $VALUE\n" 47 | fi 48 | done 49 | 50 | REPLICATION_DELAY=`mysql -u$MYSQL_USERNAME -p$MYSQL_PASSWORD -h127.0.0.1 -P$MYSQL_PORT -Dheartbeat_db -e "SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(ts) FROM heartbeat ORDER BY id DESC LIMIT 1" | sed '1d'` 51 | 52 | if [ -n "$REPLICATION_DELAY" ]; then 53 | DATA=$DATA"- mysql-v2.check[$MYSQL_PORT,Replication_delay] $REPLICATION_DELAY\n" 54 | fi 55 | 56 | if [ -n "$DATA" ]; then 57 | echo -e "$DATA" | $ZABBIX_BIN -s "$HOST_HOST" -i- >/dev/null 2>&1 58 | echo 1 59 | else 60 | echo 0 61 | fi 62 | 63 | else 64 | usage 65 | fi 66 | -------------------------------------------------------------------------------- /jvm/jvm-check.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use Getopt::Long; 5 | use Pod::Usage; 6 | use IO::Socket::INET; 7 | 8 | use constant COLLECTOR_UP => 1; 9 | use constant COLLECTOR_DOWN => 0; 10 | 11 | sub stats { 12 | my ($host, $jvmport, $service_addr, $zabbix_bin) = @_; 13 | my ($service_ip, $service_port) = split(/:/, $service_addr); 14 | 15 | my $client = IO::Socket::INET->new( 16 | PeerAddr => $service_ip, 17 | PeerPort => $service_port, 18 | Type => SOCK_STREAM 19 | ) || die "Unable to connect to server.\n"; 20 | 21 | print $client "JVMPORT $jvmport\n"; 22 | my $status = <$client>; 23 | chomp($status); 24 | if ($status ne 'OK') { 25 | print COLLECTOR_DOWN; 26 | return 2; 27 | } 28 | 29 | open my $fd, "| $zabbix_bin -s \"$host\" -i- >/dev/null 2>&1"; 30 | 31 | while (<$client>) { 32 | chomp; 33 | my ($key, $value) = split /\s+/; 34 | if (!$key) { 35 | next; 36 | } 37 | $key = lc $key; 38 | $key =~ s/%/p/g; 39 | print $fd "- jvm.$key $value\n"; 40 | } 41 | 42 | close($fd); 43 | close($client); 44 | 45 | print COLLECTOR_UP; 46 | return 0; 47 | } 48 | 49 | my $help = 0; 50 | my $host = ''; 51 | my $jvmport = 0; 52 | my $service_addr = '127.0.0.1:10060'; 53 | my $zabbix_sender = '/usr/local/zabbix-agent-ops/bin/zabbix_sender'; 54 | my $zabbix_conf = '/usr/local/zabbix-agent-ops/etc/zabbix_agentd.conf'; 55 | 56 | GetOptions ( 57 | 'help|?' => \$help, 58 | 'host=s' => \$host, 59 | 'jvmport=i' => \$jvmport, 60 | 'service-addr=s' => \$service_addr, 61 | 'zabbix-sender=s' => \$zabbix_sender, 62 | 'zabbix-conf=s' => \$zabbix_conf 63 | ) || pod2usage(2); 64 | pod2usage(1) if $help || !$jvmport || !$host; 65 | 66 | exit(stats($host, $jvmport, $service_addr, "$zabbix_sender -c \"$zabbix_conf\"")); 67 | 68 | __END__ 69 | 70 | =head1 NAME 71 | 72 | JVM Statistics 73 | 74 | =head1 SYNOPSIS 75 | 76 | jvm-check.pl [options] 77 | 78 | Options: 79 | -help brief help message 80 | -host hostname recognized by zabbix server 81 | -jvmport JVM port 82 | -service-addr service address "ip:port" 83 | -zabbix-sender path to zabbix_sender binary 84 | -zabbix-conf path to zabbix_agentd.conf 85 | 86 | =cut 87 | -------------------------------------------------------------------------------- /nginx/nginx-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################## 3 | # Zabbix monitoring script 4 | # 5 | # nginx: 6 | # - anything available via nginx stub-status module 7 | # 8 | ################################## 9 | # Contact: 10 | # vincent.viallet@gmail.com 11 | ################################## 12 | # ChangeLog: 13 | # 20100922 VV initial creation 14 | ################################## 15 | 16 | # Zabbix requested parameter 17 | ZBX_REQ_DATA="$1" 18 | ZBX_REQ_DATA_URL="$2" 19 | 20 | # Nginx defaults 21 | NGINX_STATUS_DEFAULT_URL="http://localhost:80/nginx_status" 22 | WGET_BIN="/usr/bin/wget" 23 | CURL_BIN="/usr/bin/curl" 24 | 25 | if [ ! -f $WGET_BIN ]; 26 | then 27 | USE_CURL=true 28 | fi 29 | 30 | # 31 | # Error handling: 32 | # - need to be displayable in Zabbix (avoid NOT_SUPPORTED) 33 | # - items need to be of type "float" (allow negative + float) 34 | # 35 | ERROR_NO_ACCESS_FILE="-0.9900" 36 | ERROR_NO_ACCESS="-0.9901" 37 | ERROR_WRONG_PARAM="-0.9902" 38 | ERROR_DATA="-0.9903" # either can not connect / bad host / bad port 39 | 40 | # Handle host and port if non-default 41 | if [ ! -z "$ZBX_REQ_DATA_URL" ]; then 42 | URL="$ZBX_REQ_DATA_URL" 43 | else 44 | URL="$NGINX_STATUS_DEFAULT_URL" 45 | fi 46 | 47 | # save the nginx stats in a variable for future parsing 48 | if [ ! $USE_CURL = true ]; then 49 | NGINX_STATS=$($WGET_BIN -q $URL -O - 2> /dev/null) 50 | else 51 | NGINX_STATS=$($CURL_BIN -S -s $URL) 52 | fi 53 | 54 | # error during retrieve 55 | if [ $? -ne 0 -o -z "$NGINX_STATS" ]; then 56 | echo $ERROR_DATA 57 | exit 1 58 | fi 59 | 60 | # 61 | # Extract data from nginx stats 62 | # 63 | case $ZBX_REQ_DATA in 64 | active_connections) echo "$NGINX_STATS" | head -1 | cut -f3 -d' ';; 65 | accepted_connections) echo "$NGINX_STATS" | grep -Ev '[a-zA-Z]' | cut -f2 -d' ';; 66 | handled_connections) echo "$NGINX_STATS" | grep -Ev '[a-zA-Z]' | cut -f3 -d' ';; 67 | handled_requests) echo "$NGINX_STATS" | grep -Ev '[a-zA-Z]' | cut -f4 -d' ';; 68 | reading) echo "$NGINX_STATS" | tail -1 | cut -f2 -d' ';; 69 | writing) echo "$NGINX_STATS" | tail -1 | cut -f4 -d' ';; 70 | waiting) echo "$NGINX_STATS" | tail -1 | cut -f6 -d' ';; 71 | *) echo $ERROR_WRONG_PARAM; exit 1;; 72 | esac 73 | 74 | exit 0 75 | -------------------------------------------------------------------------------- /hadoop/README.md: -------------------------------------------------------------------------------- 1 | Template Hadoop 2 | =============== 3 | 4 | Collect Hadoop statistics, both cluster-wise and for individual nodes, and display them with different templates and screens Zabbix. 5 | 6 | INSTALL 7 | ------- 8 | 9 | Assume the Zabbix agent is installed in /zabbix-agent/ directory. 10 | 11 | ### Preparatory 12 | 13 | This package requires `Python 2.7`. For legacy Linux distributions, it's recommended to install Python in a standalone directory, e.g. `/usr/local/python-2.7`. 14 | 15 | ### Install Script and Add User Parameters 16 | 17 | * Copy hadoop-collector.py to /zabbix-agent/bin/, and set it to `755`. 18 | * Copy hadoop-params.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/. 19 | * Restart Zabbix agent. 20 | 21 | ### Import Template 22 | 23 | Import the following templates and apply them to the corresponding servers: 24 | 25 | * hadoop-namenode-template.xml 26 | * hadoop-jobtracker-template.xml 27 | * hadoop-datanode-template.xml 28 | * hadoop-tasktracker-template.xml 29 | 30 | And the `hadoop-basic-template.xml` consists of cluster-wise data aggregation items, so it should be applied to the master node. 31 | 32 | ### Create Aggregated Items 33 | 34 | In order to get an cluster-wise aggregated data, such as disk util, we need to get it first from respective servers. LLD (Low Level Discovery) will produce all the disk devices on the server, but fails to provide an aggregated item for them. 35 | 36 | Here comes the `Zabbix calculated item`, we use a script (create-aggr-item.py) to create aggregated disk and network items for every nodes. 37 | 38 | Besides, in `hadoop-basic-template.xml` there's a macro named `{$CLUSTER_NAME}`, whose default value is `dw-hadoop`. So you need to put all slave nodes into a Zabbix host group named after this macro, so that the template item can calculate the correct data. 39 | 40 | HOW IT WORKS 41 | ------------ 42 | 43 | ### Data Source 44 | 45 | All statistics are parsed from the Hadoop status page, i.e. `http://host:50030` and `https://host:50070`. 46 | 47 | The server basic monitoring data is from Zabbix agent and other templates in this repo, like [iostat][1]. 48 | 49 | ### Collector 50 | 51 | In order not to parse the status page several times to get enough information, here we use `Zabbix trapper` data type to let the agent send data actively. Also to save the trouble of adding a cron job, here we use a `Zabbix agent` item to trigger the data collection process. 52 | 53 | [1]: https://github.com/jizhang/zabbix-templates/tree/master/iostat 54 | 55 | -------------------------------------------------------------------------------- /iostat/iostat-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################## 3 | # Zabbix monitoring script 4 | # 5 | # iostat: 6 | # - IO 7 | # - running / blocked processes 8 | # - swap in / out 9 | # - block in / out 10 | # 11 | # Info: 12 | # - vmstat data are gathered via cron job 13 | ################################## 14 | # Contact: 15 | # vincent.viallet@gmail.com 16 | ################################## 17 | # ChangeLog: 18 | # 20100922 VV initial creation 19 | ################################## 20 | 21 | # Zabbix requested parameter 22 | ZBX_REQ_DATA="$2" 23 | ZBX_REQ_DATA_DEV="$1" 24 | 25 | # source data file 26 | SOURCE_DATA=/usr/local/zabbix-agent-ops/var/iostat-data 27 | 28 | # 29 | # Error handling: 30 | # - need to be displayable in Zabbix (avoid NOT_SUPPORTED) 31 | # - items need to be of type "float" (allow negative + float) 32 | # 33 | ERROR_NO_DATA_FILE="-0.9900" 34 | ERROR_OLD_DATA="-0.9901" 35 | ERROR_WRONG_PARAM="-0.9902" 36 | ERROR_MISSING_PARAM="-0.9903" 37 | 38 | # No data file to read from 39 | if [ ! -f "$SOURCE_DATA" ]; then 40 | echo $ERROR_NO_DATA_FILE 41 | exit 1 42 | fi 43 | 44 | # Missing device to get data from 45 | if [ -z "$ZBX_REQ_DATA_DEV" ]; then 46 | echo $ERROR_MISSING_PARAM 47 | exit 1 48 | fi 49 | 50 | # 51 | # Old data handling: 52 | # - in case the cron can not update the data file 53 | # - in case the data are too old we want to notify the system 54 | # Consider the data as non-valid if older than OLD_DATA minutes 55 | # 56 | OLD_DATA=5 57 | if [ $(stat -c "%Y" $SOURCE_DATA) -lt $(date -d "now -$OLD_DATA min" "+%s" ) ]; then 58 | echo $ERROR_OLD_DATA 59 | exit 1 60 | fi 61 | 62 | # 63 | # Grab data from SOURCE_DATA for key ZBX_REQ_DATA 64 | # 65 | # 1st check the device exists and gets data gathered by cron job 66 | device_count=$(grep -Ec "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA) 67 | if [ $device_count -eq 0 ]; then 68 | echo $ERROR_WRONG_PARAM 69 | exit 1 70 | fi 71 | 72 | # 2nd grab the data from the source file 73 | case $ZBX_REQ_DATA in 74 | rrqm/s) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $2}';; 75 | wrqm/s) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $3}';; 76 | r/s) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $4}';; 77 | w/s) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $5}';; 78 | rkB/s) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $6}';; 79 | wkB/s) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $7}';; 80 | avgrq-sz) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $8}';; 81 | avgqu-sz) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $9}';; 82 | await) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $10}';; 83 | svctm) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $11}';; 84 | %util) grep -E "^$ZBX_REQ_DATA_DEV " $SOURCE_DATA | tail -1 | awk '{print $12}';; 85 | *) echo $ERROR_WRONG_PARAM; exit 1;; 86 | esac 87 | 88 | exit 0 89 | 90 | -------------------------------------------------------------------------------- /jvm/jvm-service.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use Getopt::Long; 5 | use Pod::Usage; 6 | use IO::Socket::INET; 7 | use POSIX 'setsid'; 8 | 9 | sub stats { 10 | my $jvmport = shift(@_); 11 | 12 | my @netstat = `netstat -nlpt`; 13 | my $pid = 0; 14 | foreach my $line (@netstat) { 15 | if ($line =~ /.*?:$jvmport\s.*?([0-9]+)\/java\s*$/) { 16 | $pid = $1; 17 | last; 18 | } 19 | } 20 | if (!$pid) { 21 | return 0; 22 | } 23 | 24 | my $result = ''; 25 | 26 | my @jstat = `jstat -gc $pid`; 27 | $result .= kv_parse(@jstat); 28 | 29 | my @jstack = `jstack $pid`; 30 | my $threads = 0; 31 | my $threads_running = 0; 32 | for my $line (@jstack) { 33 | if (index($line, '"') != -1) { 34 | $threads += 1; 35 | } 36 | if (index($line, 'java.lang.Thread.State: RUNNABLE') != -1) { 37 | $threads_running += 1; 38 | } 39 | } 40 | $result .= "threads $threads\n"; 41 | $result .= "threads_running $threads_running\n"; 42 | 43 | my @ps = `ps -o pcpu,rss -p $pid`; 44 | $result .= kv_parse(@ps); 45 | 46 | return $result; 47 | 48 | } 49 | 50 | sub kv_parse { 51 | my @kv_data = @_; 52 | 53 | map { s/^\s+|\s+$// } @kv_data; 54 | my @kv_keys = split(/\s+/, $kv_data[0]); 55 | my @kv_vals = split(/\s+/, $kv_data[1]); 56 | 57 | my $result = ''; 58 | for my $i (0 .. $#kv_keys) { 59 | $result .= "$kv_keys[$i] $kv_vals[$i]\n"; 60 | } 61 | 62 | return $result; 63 | } 64 | 65 | sub process { 66 | my $client = shift; 67 | 68 | my $input = <$client>; 69 | chomp($input); 70 | 71 | if ($input =~ /^JVMPORT ([0-9]+)$/) { 72 | 73 | print "JVMPORT is $1.\n"; 74 | 75 | if (my $result = stats($1)) { 76 | print $client "OK\n", $result, "\n"; 77 | print "[$$] OK\n"; 78 | } else { 79 | print $client "ERROR\n"; 80 | print "[$$] ERROR\n"; 81 | } 82 | 83 | } else { 84 | print "[$$] Invalid input '$input'.\n"; 85 | } 86 | 87 | close($client); 88 | } 89 | 90 | sub daemonize { 91 | exit if fork(); 92 | chdir('/'); 93 | umask(0); 94 | setsid(); 95 | exit if fork(); 96 | open STDIN, '<', '/dev/null'; 97 | open STDOUT, '>>', '/tmp/jvm-service.log'; 98 | open STDERR, '>&', \*STDOUT; 99 | } 100 | 101 | my $help = 0; 102 | my $port = 10060; 103 | my $daemonize = 0; 104 | 105 | GetOptions( 106 | 'help|?' => \$help, 107 | 'port=i' => \$port, 108 | 'daemonize' => \$daemonize 109 | ) || pod2usage(2); 110 | pod2usage(1) if $help; 111 | 112 | if ($daemonize) { 113 | daemonize(); 114 | } 115 | 116 | print "Bind to port $port.\n"; 117 | 118 | my $server = IO::Socket::INET->new( 119 | LocalPort => $port, 120 | Type => SOCK_STREAM, 121 | Reuse => 1, 122 | Listen => SOMAXCONN 123 | ) || die "Unable to create server.\n"; 124 | 125 | # signal handlers 126 | 127 | sub REAPER { 128 | my $pid; 129 | while (($pid = waitpid(-1, 'WNOHANG')) > 0) { 130 | print "SIGCHLD pid $pid\n"; 131 | } 132 | } 133 | 134 | my $interrupted = 0; 135 | 136 | sub INTERRUPTER { 137 | $interrupted = 1; 138 | } 139 | 140 | $SIG{CHLD} = \&REAPER; 141 | $SIG{TERM} = \&INTERRUPTER; 142 | $SIG{INT} = \&INTERRUPTER; 143 | 144 | while (!$interrupted) { 145 | 146 | if (my $client = $server->accept()) { 147 | 148 | my $pid = fork(); 149 | 150 | if ($pid > 0) { 151 | close($client); 152 | print "forked child pid $pid\n"; 153 | } elsif ($pid == 0) { 154 | close($server); 155 | process($client); 156 | exit; 157 | } else { 158 | print "unable to fork\n"; 159 | } 160 | 161 | } 162 | 163 | } 164 | 165 | close($server); 166 | print "Service quit.\n"; 167 | 168 | __END__ 169 | 170 | =head1 NAME 171 | 172 | JVM Statistics 173 | 174 | =head1 SYNOPSIS 175 | 176 | jvm-server.pl [options] 177 | 178 | Options: 179 | -help brief help message 180 | -port bind to tcp port 181 | 182 | =cut 183 | -------------------------------------------------------------------------------- /hadoop/create-aggr-item.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import argparse 5 | import pyzabbix 6 | import re 7 | 8 | def main(args): 9 | 10 | zapi = pyzabbix.ZabbixAPI('http://%s' % args.zabbix_server) 11 | zapi.login(args.zabbix_username, args.zabbix_password) 12 | 13 | for host in args.host: 14 | process(zapi, host) 15 | 16 | def process(zapi, host): 17 | 18 | print host 19 | 20 | metrics = { # value_type, units, is_average 21 | 'rkB/s' : (3, 'B', False), 22 | 'wkB/s' : (3, 'B', False), 23 | '%util' : (0, '', True) 24 | } 25 | process_metrics(zapi, host=host, 26 | application='iostat', 27 | search_key='iostat', 28 | key_pattern=r'iostat\[(?P[^,]+),\s*(?P[^\]]+)\]', 29 | metrics=metrics, 30 | name_format='All Disk %s', 31 | key_format='iostat[all,%s]') 32 | 33 | metrics = { 34 | 'in': (3, 'bps', False), 35 | 'out': (3, 'bps', False) 36 | } 37 | process_metrics(zapi, host=host, 38 | application='Network interfaces', 39 | search_key='net.if', 40 | key_pattern=r'net.if.(?P[^\[]+)\[(?P[^\]]+)\]', 41 | metrics=metrics, 42 | name_format='All Network %s', 43 | key_format='net.if.%s[all]') 44 | 45 | def process_metrics(zapi, host, application, search_key, key_pattern, metrics, name_format, key_format): 46 | 47 | host = zapi.host.get(filter={'host': host}) 48 | hostid = host[0]['hostid'] 49 | 50 | application = zapi.application.get(hostids=hostid, filter={'name': application}) 51 | applicationid = application[0]['applicationid'] 52 | 53 | items = zapi.item.get(hostids=hostid, 54 | search={'key_': search_key}, 55 | startSearch=True, 56 | output=['key_', 'params']) 57 | devices = {} 58 | ptrn_device = re.compile(key_pattern) 59 | for item in items: 60 | mo = ptrn_device.match(item['key_']) 61 | if mo is None: 62 | continue 63 | device_name = mo.group('device') 64 | if device_name not in devices: 65 | devices[device_name] = {} 66 | device_info = devices[device_name] 67 | device_info[mo.group('metric')] = (item['itemid'], item['key_'], item['params']) 68 | 69 | for metric, metric_info in metrics.iteritems(): 70 | print metric 71 | keys = [v[metric][1] for k, v in devices.iteritems() if k != 'all'] 72 | params = '+'.join('last("%s")' % key for key in keys) 73 | if metric_info[2]: 74 | params = '(%s)/%d' % (params, len(keys)) 75 | 76 | if 'all' not in devices: 77 | devices['all'] = {} 78 | 79 | if metric not in devices['all']: 80 | print 'create', metric, params 81 | zapi.item.create(hostid=hostid, 82 | name=name_format % metric, 83 | key_=key_format % metric, 84 | type=15, 85 | value_type=metric_info[0], 86 | params=params, 87 | units=metric_info[1], 88 | delay=60, 89 | applications=[applicationid]) 90 | 91 | elif devices['all'][metric][2] != params: 92 | print 'update', metric, params 93 | zapi.item.update(itemid=devices['all'][metric][0], 94 | params=params) 95 | 96 | else: 97 | print 'skip', metric 98 | 99 | 100 | if __name__ == '__main__': 101 | parser = argparse.ArgumentParser() 102 | parser.add_argument('-z', '--zabbix-server', required=True, help='e.g. zabbix.domain.com:8080') 103 | parser.add_argument('-u', '--zabbix-username', required=True) 104 | parser.add_argument('-p', '--zabbix-password', required=True) 105 | parser.add_argument('-s', '--host', action='append', required=True) 106 | main(parser.parse_args()) 107 | -------------------------------------------------------------------------------- /hadoop/hadoop-collector.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import sys 5 | import argparse 6 | import urllib2 7 | import re 8 | import subprocess 9 | import traceback 10 | import logging 11 | 12 | SERVICE_UP = 1 13 | SERVICE_DOWN = 0 14 | PTRN_TAG = re.compile('<[^>]+>') 15 | 16 | class Job(object): 17 | 18 | def __init__(self, args): 19 | self.args = args 20 | 21 | def run(self): 22 | 23 | logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', 24 | level=logging.INFO, stream=sys.stderr) 25 | 26 | try: 27 | getattr(self, 'collect_%s' % self.args.type)() 28 | except Exception: 29 | traceback.print_exc() 30 | print SERVICE_DOWN 31 | else: 32 | print SERVICE_UP 33 | 34 | def request(self, url): 35 | logging.info('Request: %s' % url) 36 | f = urllib2.urlopen(url) 37 | content = f.read() 38 | f.close() 39 | return content 40 | 41 | def collect_namenode(self): 42 | 43 | content = self.request('http://%s:%d/dfshealth.jsp' % (self.args.namenode_host, self.args.namenode_port)) 44 | result = {} 45 | 46 | mo = re.search('([0-9]+) files and directories, ([0-9]+) blocks', content) 47 | result['file_count'] = mo.group(1) 48 | result['block_count'] = mo.group(2) 49 | 50 | mo = re.search('Heap Size is ([0-9.]+ [KMGTP]?B) / ([0-9.]+ [KMGTP]?B)', content) 51 | result['heap_used'] = self.regulate_size(mo.group(1)) 52 | result['heap_total'] = self.regulate_size(mo.group(2)) 53 | 54 | for dfstable in content.split('\n'): 55 | if 'Configured Capacity' in dfstable: 56 | break 57 | 58 | dfstable = re.sub(']*>', '\n', dfstable) 59 | dfstable = PTRN_TAG.sub('', dfstable) 60 | dfsmap = {} 61 | for line in dfstable.split('\n'): 62 | try: 63 | k, v = line.split(':') 64 | dfsmap[k.strip()] = v.strip() 65 | except ValueError: 66 | pass 67 | 68 | result['dfs_capacity'] = self.regulate_size(dfsmap['Configured Capacity']) 69 | result['dfs_used'] = self.regulate_size(dfsmap['DFS Used']) 70 | result['dfs_used_other'] = self.regulate_size(dfsmap['Non DFS Used']) 71 | result['dfs_remaining'] = self.regulate_size(dfsmap['DFS Remaining']) 72 | result['node_alive'] = dfsmap['Live Nodes'] 73 | result['node_dead'] = dfsmap['Dead Nodes'] 74 | result['node_decom'] = dfsmap['Decommissioning Nodes'] 75 | result['block_under'] = dfsmap['Number of Under-Replicated Blocks'] 76 | 77 | self.send_result(result) 78 | 79 | def collect_jobtracker(self): 80 | 81 | content = self.request('http://%s:%d/jobtracker.jsp' % (self.args.jobtracker_host, self.args.jobtracker_port)) 82 | result = {} 83 | 84 | mo = re.search('Heap Size is ([0-9.]+ [KMGTP]?B)/([0-9.]+ [KMGTP]?B)', content) 85 | result['heap_used'] = self.regulate_size(mo.group(1)) 86 | result['heap_total'] = self.regulate_size(mo.group(2)) 87 | 88 | lines = iter(content.split('\n')) 89 | for jthead in lines: 90 | if 'Running Map Tasks' in jthead: 91 | jtbody = lines.next() 92 | break 93 | 94 | iter_head = re.finditer(']*>(.*?)', jthead) 95 | iter_body = re.finditer(']*>(.*?)', jtbody) 96 | 97 | jtmap = {} 98 | for mo_head in iter_head: 99 | mo_body = iter_body.next() 100 | jtmap[mo_head.group(1).strip()] = PTRN_TAG.sub('', mo_body.group(1)).strip() 101 | 102 | result['map_running'] = jtmap['Running Map Tasks'] 103 | result['map_occupied'] = jtmap['Occupied Map Slots'] 104 | result['map_reserved'] = jtmap['Reserved Map Slots'] 105 | result['map_capacity'] = jtmap['Map Task Capacity'] 106 | 107 | result['reduce_running'] = jtmap['Running Reduce Tasks'] 108 | result['reduce_occupied'] = jtmap['Occupied Reduce Slots'] 109 | result['reduce_reserved'] = jtmap['Reserved Reduce Slots'] 110 | result['reduce_capacity'] = jtmap['Reduce Task Capacity'] 111 | 112 | result['node_count'] = jtmap['Nodes'] 113 | result['node_black'] = jtmap['Blacklisted Nodes'] 114 | result['node_gray'] = jtmap['Graylisted Nodes'] 115 | result['node_excluded'] = jtmap['Excluded Nodes'] 116 | 117 | result['submission_total'] = jtmap['Total Submissions'] 118 | 119 | for line in lines: 120 | if 'Running Jobs' in line: 121 | break 122 | 123 | job_running = 0 124 | for line in lines: 125 | if 'Completed Jobs' in line: 126 | break 127 | if 'id="job_' in line: 128 | job_running += 1 129 | 130 | result['job_running'] = job_running 131 | 132 | for line in lines: 133 | if 'Failed Jobs' in line: 134 | break 135 | 136 | job_failed = 0 137 | for line in lines: 138 | if 'Retired Jobs' in line: 139 | break 140 | if 'id="job_' in line: 141 | job_failed += 1 142 | 143 | result['job_failed'] = job_failed 144 | 145 | self.send_result(result) 146 | 147 | def collect_tasktracker(self): 148 | 149 | content = self.request('http://%s:%d/machines.jsp?type=active' % (self.args.jobtracker_host, self.args.jobtracker_port)) 150 | 151 | lines = iter(content.split('\n')) 152 | jthead = None 153 | for line in lines: 154 | if line.startswith('Name'): 155 | jthead = line 156 | elif jthead is not None: 157 | jthead += line 158 | if '' in line: 159 | break 160 | 161 | jtbody = None 162 | for line in lines: 163 | if line.startswith('') \ 164 | and self.args.host in line: 165 | jtbody = line 166 | elif jtbody is not None: 167 | jtbody += line 168 | if '' in line: 169 | break 170 | 171 | iter_head = re.finditer(']*>(.*?)', jthead) 172 | iter_body = re.finditer(']*>(.*?)', jtbody) 173 | jtmap = {} 174 | for mo_head in iter_head: 175 | mo_body = iter_body.next() 176 | jtmap[PTRN_TAG.sub('', mo_head.group(1)).strip()] = \ 177 | PTRN_TAG.sub('', mo_body.group(1)).strip() 178 | 179 | result = {} 180 | result['task_running'] = jtmap['# running tasks'] 181 | result['task_capacity'] = int(jtmap['Max Map Tasks']) + int(jtmap['Max Reduce Tasks']) 182 | result['task_failed'] = jtmap['Task Failures'] 183 | result['task_total'] = jtmap['Total Tasks Since Start'] 184 | result['task_succeeded'] = jtmap['Succeeded Tasks Since Start'] 185 | 186 | self.send_result(result) 187 | 188 | def collect_datanode(self): 189 | 190 | content = self.request('http://%s:%d/dfsnodelist.jsp?whatNodes=LIVE' % (self.args.namenode_host, self.args.namenode_port)) 191 | 192 | lines = iter(content.split('\n')) 193 | for line in lines: 194 | if line.startswith(''): 195 | break 196 | jthead = line 197 | 198 | for line in lines: 199 | if line.startswith(']*>.*?', '', line) 203 | 204 | iter_head = re.finditer(']*>(.*?)(?=]*>(.*?)(?= 2 | 3 | 2.0 4 | 2013-11-24T13:50:31Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 276 | 277 | 278 | 279 | DataNode Blocks 280 | 900 281 | 200 282 | 0.0000 283 | 100.0000 284 | 1 285 | 1 286 | 0 287 | 1 288 | 0 289 | 0.0000 290 | 0.0000 291 | 0 292 | 0 293 | 0 294 | 0 295 | 296 | 297 | 0 298 | 0 299 | 0000EE 300 | 0 301 | 2 302 | 0 303 | 304 | Template Hadoop DataNode 305 | hadoop.datanode.block_count 306 | 307 | 308 | 309 | 310 | 311 | DataNode Capacity 312 | 900 313 | 200 314 | 0.0000 315 | 100.0000 316 | 1 317 | 1 318 | 1 319 | 1 320 | 0 321 | 0.0000 322 | 0.0000 323 | 1 324 | 0 325 | 0 326 | 0 327 | 328 | 329 | 2 330 | 0 331 | 0000EE 332 | 0 333 | 2 334 | 0 335 | 336 | Template Hadoop DataNode 337 | hadoop.datanode.dfs_remaining 338 | 339 | 340 | 341 | 1 342 | 0 343 | EEEE00 344 | 0 345 | 2 346 | 0 347 | 348 | Template Hadoop DataNode 349 | hadoop.datanode.dfs_used_other 350 | 351 | 352 | 353 | 0 354 | 0 355 | EE0000 356 | 0 357 | 2 358 | 0 359 | 360 | Template Hadoop DataNode 361 | hadoop.datanode.dfs_used 362 | 363 | 364 | 365 | 366 | 367 | 368 | -------------------------------------------------------------------------------- /nginx/nginx-template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2013-03-26T04:17:58Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 344 | 345 | 346 | 347 | {Template_Nginx:proc.num[nginx].last(0)}=0 348 | Nginx is not running on {HOSTNAME} 349 | 350 | 0 351 | 4 352 | Nginx is not running. 353 | 354 | It has been stopped / shutdown or has crashed. 355 | Check on the server for more details: 356 | - w / last 357 | - dmesg logs 358 | - /var/log/messages 359 | - nginx error logs 360 | 0 361 | 362 | 363 | 364 | 365 | 366 | Nginx - Connections and Requests status 367 | 900 368 | 200 369 | 0.0000 370 | 100.0000 371 | 0 372 | 0 373 | 0 374 | 1 375 | 0 376 | 0.0000 377 | 0.0000 378 | 1 379 | 0 380 | 0 381 | 0 382 | 383 | 384 | 0 385 | 1 386 | FF9999 387 | 0 388 | 4 389 | 0 390 | 391 | Template_Nginx 392 | nginx[accepted_connections,{$NGINX_STATUS_URL}] 393 | 394 | 395 | 396 | 1 397 | 2 398 | 990000 399 | 0 400 | 4 401 | 0 402 | 403 | Template_Nginx 404 | nginx[handled_connections,{$NGINX_STATUS_URL}] 405 | 406 | 407 | 408 | 2 409 | 0 410 | 009900 411 | 0 412 | 4 413 | 0 414 | 415 | Template_Nginx 416 | nginx[handled_requests,{$NGINX_STATUS_URL}] 417 | 418 | 419 | 420 | 421 | 422 | Nginx - Threads status 423 | 900 424 | 200 425 | 0.0000 426 | 100.0000 427 | 0 428 | 0 429 | 1 430 | 1 431 | 0 432 | 0.0000 433 | 0.0000 434 | 1 435 | 0 436 | 0 437 | 0 438 | 439 | 440 | 0 441 | 1 442 | 990000 443 | 0 444 | 4 445 | 0 446 | 447 | Template_Nginx 448 | nginx[writing,{$NGINX_STATUS_URL}] 449 | 450 | 451 | 452 | 1 453 | 1 454 | 999900 455 | 0 456 | 4 457 | 0 458 | 459 | Template_Nginx 460 | nginx[reading,{$NGINX_STATUS_URL}] 461 | 462 | 463 | 464 | 2 465 | 1 466 | 009900 467 | 0 468 | 4 469 | 0 470 | 471 | Template_Nginx 472 | nginx[waiting,{$NGINX_STATUS_URL}] 473 | 474 | 475 | 476 | 477 | 478 | 479 | -------------------------------------------------------------------------------- /php-fpm/php-fpm-template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2013-03-26T04:12:09Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 309 | 310 | 311 | 312 | php-fpm Accepted Connections / sec 313 | 900 314 | 200 315 | 0.0000 316 | 100.0000 317 | 1 318 | 1 319 | 0 320 | 1 321 | 0 322 | 0.0000 323 | 0.0000 324 | 0 325 | 0 326 | 0 327 | 0 328 | 329 | 330 | 0 331 | 0 332 | C80000 333 | 0 334 | 2 335 | 0 336 | 337 | Template php-fpm 338 | php-fpm["accepted conn",{$PHP_FPM_STATUS_URL}] 339 | 340 | 341 | 342 | 343 | 344 | php-fpm Listen Queue 345 | 900 346 | 200 347 | 0.0000 348 | 100.0000 349 | 1 350 | 1 351 | 0 352 | 1 353 | 0 354 | 0.0000 355 | 0.0000 356 | 0 357 | 0 358 | 0 359 | 0 360 | 361 | 362 | 0 363 | 0 364 | EE0000 365 | 0 366 | 2 367 | 0 368 | 369 | Template php-fpm 370 | php-fpm["listen queue len",{$PHP_FPM_STATUS_URL}] 371 | 372 | 373 | 374 | 1 375 | 0 376 | 00EE00 377 | 0 378 | 2 379 | 0 380 | 381 | Template php-fpm 382 | php-fpm["listen queue",{$PHP_FPM_STATUS_URL}] 383 | 384 | 385 | 386 | 387 | 388 | php-fpm Processes 389 | 900 390 | 200 391 | 0.0000 392 | 100.0000 393 | 1 394 | 1 395 | 0 396 | 1 397 | 0 398 | 0.0000 399 | 0.0000 400 | 0 401 | 0 402 | 0 403 | 0 404 | 405 | 406 | 0 407 | 0 408 | C80000 409 | 0 410 | 2 411 | 0 412 | 413 | Template php-fpm 414 | php-fpm["total processes",{$PHP_FPM_STATUS_URL}] 415 | 416 | 417 | 418 | 1 419 | 0 420 | 00C800 421 | 0 422 | 2 423 | 0 424 | 425 | Template php-fpm 426 | php-fpm["active processes",{$PHP_FPM_STATUS_URL}] 427 | 428 | 429 | 430 | 2 431 | 0 432 | 0000C8 433 | 0 434 | 2 435 | 0 436 | 437 | Template php-fpm 438 | php-fpm["idle processes",{$PHP_FPM_STATUS_URL}] 439 | 440 | 441 | 442 | 443 | 444 | php-fpm Slow Requests / sec 445 | 900 446 | 200 447 | 0.0000 448 | 100.0000 449 | 1 450 | 1 451 | 0 452 | 1 453 | 0 454 | 0.0000 455 | 0.0000 456 | 0 457 | 0 458 | 0 459 | 0 460 | 461 | 462 | 0 463 | 0 464 | C80000 465 | 0 466 | 2 467 | 0 468 | 469 | Template php-fpm 470 | php-fpm["slow requests",{$PHP_FPM_STATUS_URL}] 471 | 472 | 473 | 474 | 475 | 476 | 477 | -------------------------------------------------------------------------------- /hadoop/hadoop-tasktracker-template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2013-11-24T12:40:04Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 354 | 355 | 356 | 357 | TaskTracker Running Tasks 358 | 900 359 | 200 360 | 0.0000 361 | 100.0000 362 | 1 363 | 1 364 | 0 365 | 1 366 | 0 367 | 0.0000 368 | 0.0000 369 | 0 370 | 0 371 | 0 372 | 0 373 | 374 | 375 | 0 376 | 0 377 | 0000EE 378 | 0 379 | 2 380 | 0 381 | 382 | Template Hadoop TaskTracker 383 | hadoop.tasktracker.task_capacity 384 | 385 | 386 | 387 | 1 388 | 0 389 | 00EE00 390 | 0 391 | 2 392 | 0 393 | 394 | Template Hadoop TaskTracker 395 | hadoop.tasktracker.task_running 396 | 397 | 398 | 399 | 400 | 401 | TaskTracker Total Tasks 402 | 900 403 | 200 404 | 0.0000 405 | 100.0000 406 | 1 407 | 1 408 | 0 409 | 1 410 | 0 411 | 0.0000 412 | 0.0000 413 | 0 414 | 0 415 | 0 416 | 0 417 | 418 | 419 | 0 420 | 0 421 | 0000C8 422 | 0 423 | 2 424 | 0 425 | 426 | Template Hadoop TaskTracker 427 | hadoop.tasktracker.task_total 428 | 429 | 430 | 431 | 1 432 | 0 433 | EE0000 434 | 0 435 | 2 436 | 0 437 | 438 | Template Hadoop TaskTracker 439 | hadoop.tasktracker.task_failed 440 | 441 | 442 | 443 | 2 444 | 0 445 | 00EE00 446 | 0 447 | 2 448 | 0 449 | 450 | Template Hadoop TaskTracker 451 | hadoop.tasktracker.task_succeeded 452 | 453 | 454 | 455 | 456 | 457 | TaskTracker Used Memory 458 | 900 459 | 200 460 | 0.0000 461 | 100.0000 462 | 1 463 | 1 464 | 0 465 | 1 466 | 0 467 | 0.0000 468 | 0.0000 469 | 1 470 | 0 471 | 0 472 | 0 473 | 474 | 475 | 0 476 | 1 477 | 0000EE 478 | 0 479 | 2 480 | 0 481 | 482 | Template Hadoop TaskTracker 483 | hadoop.tasktracker.memory_total 484 | 485 | 486 | 487 | 1 488 | 1 489 | EE0000 490 | 0 491 | 2 492 | 0 493 | 494 | Template Hadoop TaskTracker 495 | hadoop.tasktracker.memory_used 496 | 497 | 498 | 499 | 500 | 501 | 502 | -------------------------------------------------------------------------------- /hadoop/hadoop-basic-template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2013-11-23T07:40:16Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 467 | 468 | 469 | 470 | Hadoop Cluster Disk Util 471 | 900 472 | 200 473 | 0.0000 474 | 100.0000 475 | 1 476 | 1 477 | 0 478 | 1 479 | 0 480 | 0.0000 481 | 0.0000 482 | 0 483 | 0 484 | 0 485 | 0 486 | 487 | 488 | 0 489 | 0 490 | 0000EE 491 | 0 492 | 2 493 | 0 494 | 495 | Template Hadoop Basic 496 | grpavg[{$CLUSTER_NAME},"iostat[all,%util]",last,0] 497 | 498 | 499 | 500 | 1 501 | 5 502 | 00EE00 503 | 1 504 | 2 505 | 0 506 | 507 | Template Hadoop Basic 508 | grpsum[{$CLUSTER_NAME},"iostat[all,rkB/s]",last,0] 509 | 510 | 511 | 512 | 2 513 | 5 514 | EE0000 515 | 1 516 | 2 517 | 0 518 | 519 | Template Hadoop Basic 520 | grpsum[{$CLUSTER_NAME},"iostat[all,wkB/s]",last,0] 521 | 522 | 523 | 524 | 525 | 526 | Hadoop Cluster Memory Usage 527 | 900 528 | 200 529 | 0.0000 530 | 100.0000 531 | 1 532 | 1 533 | 0 534 | 1 535 | 0 536 | 0.0000 537 | 0.0000 538 | 1 539 | 0 540 | 0 541 | 0 542 | 543 | 544 | 0 545 | 1 546 | 0000EE 547 | 0 548 | 2 549 | 0 550 | 551 | Template Hadoop Basic 552 | grpsum[{$CLUSTER_NAME},"vm.memory.size[total]",last,0] 553 | 554 | 555 | 556 | 1 557 | 1 558 | EE0000 559 | 0 560 | 2 561 | 0 562 | 563 | Template Hadoop Basic 564 | hadoop.basic.memory.used 565 | 566 | 567 | 568 | 569 | 570 | Hadoop Cluster Network Throughput 571 | 900 572 | 200 573 | 0.0000 574 | 100.0000 575 | 1 576 | 1 577 | 0 578 | 1 579 | 0 580 | 0.0000 581 | 0.0000 582 | 0 583 | 0 584 | 0 585 | 0 586 | 587 | 588 | 0 589 | 5 590 | 00EE00 591 | 0 592 | 2 593 | 0 594 | 595 | Template Hadoop Basic 596 | grpsum[{$CLUSTER_NAME},"net.if.in[all]",last,0] 597 | 598 | 599 | 600 | 1 601 | 5 602 | 0000EE 603 | 0 604 | 2 605 | 0 606 | 607 | Template Hadoop Basic 608 | grpsum[{$CLUSTER_NAME},"net.if.out[all]",last,0] 609 | 610 | 611 | 612 | 613 | 614 | Hadoop Cluster Processor Load 615 | 900 616 | 200 617 | 0.0000 618 | 100.0000 619 | 1 620 | 1 621 | 0 622 | 1 623 | 0 624 | 0.0000 625 | 0.0000 626 | 0 627 | 0 628 | 0 629 | 0 630 | 631 | 632 | 0 633 | 0 634 | 00EE00 635 | 0 636 | 2 637 | 0 638 | 639 | Template Hadoop Basic 640 | grpavg[{$CLUSTER_NAME},"system.cpu.load[percpu,avg1]",last,0] 641 | 642 | 643 | 644 | 1 645 | 0 646 | 0000EE 647 | 0 648 | 2 649 | 0 650 | 651 | Template Hadoop Basic 652 | grpavg[{$CLUSTER_NAME},"system.cpu.load[percpu,avg5]",last,0] 653 | 654 | 655 | 656 | 2 657 | 0 658 | EE0000 659 | 0 660 | 2 661 | 0 662 | 663 | Template Hadoop Basic 664 | grpavg[{$CLUSTER_NAME},"system.cpu.load[percpu,avg15]",last,0] 665 | 666 | 667 | 668 | 669 | 670 | 671 | -------------------------------------------------------------------------------- /hadoop/hadoop-namenode-template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2013-11-19T07:04:37Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 549 | 550 | 551 | 552 | HDFS Capacity 553 | 900 554 | 200 555 | 0.0000 556 | 100.0000 557 | 1 558 | 1 559 | 1 560 | 1 561 | 0 562 | 0.0000 563 | 0.0000 564 | 0 565 | 0 566 | 0 567 | 0 568 | 569 | 570 | 0 571 | 0 572 | FF3333 573 | 0 574 | 2 575 | 0 576 | 577 | Template Hadoop NameNode 578 | hadoop.namenode.dfs_used 579 | 580 | 581 | 582 | 1 583 | 0 584 | FFFF33 585 | 0 586 | 2 587 | 0 588 | 589 | Template Hadoop NameNode 590 | hadoop.namenode.dfs_used_other 591 | 592 | 593 | 594 | 2 595 | 0 596 | 3333FF 597 | 0 598 | 2 599 | 0 600 | 601 | Template Hadoop NameNode 602 | hadoop.namenode.dfs_remaining 603 | 604 | 605 | 606 | 607 | 608 | HDFS Files and Directories 609 | 900 610 | 200 611 | 0.0000 612 | 100.0000 613 | 1 614 | 1 615 | 0 616 | 1 617 | 0 618 | 0.0000 619 | 0.0000 620 | 0 621 | 0 622 | 0 623 | 0 624 | 625 | 626 | 0 627 | 0 628 | 3333FF 629 | 0 630 | 2 631 | 0 632 | 633 | Template Hadoop NameNode 634 | hadoop.namenode.file_count 635 | 636 | 637 | 638 | 639 | 640 | HDFS NameNode Heap Size 641 | 900 642 | 200 643 | 0.0000 644 | 100.0000 645 | 1 646 | 1 647 | 0 648 | 1 649 | 0 650 | 0.0000 651 | 0.0000 652 | 0 653 | 0 654 | 0 655 | 0 656 | 657 | 658 | 0 659 | 1 660 | 3333FF 661 | 0 662 | 2 663 | 0 664 | 665 | Template Hadoop NameNode 666 | hadoop.namenode.heap_total 667 | 668 | 669 | 670 | 1 671 | 1 672 | FF3333 673 | 0 674 | 2 675 | 0 676 | 677 | Template Hadoop NameNode 678 | hadoop.namenode.heap_used 679 | 680 | 681 | 682 | 683 | 684 | HDFS Nodes 685 | 900 686 | 200 687 | 0.0000 688 | 100.0000 689 | 1 690 | 1 691 | 0 692 | 1 693 | 0 694 | 0.0000 695 | 0.0000 696 | 0 697 | 0 698 | 0 699 | 0 700 | 701 | 702 | 0 703 | 0 704 | 00AA00 705 | 0 706 | 2 707 | 0 708 | 709 | Template Hadoop NameNode 710 | hadoop.namenode.node_alive 711 | 712 | 713 | 714 | 1 715 | 0 716 | AA0000 717 | 0 718 | 2 719 | 0 720 | 721 | Template Hadoop NameNode 722 | hadoop.namenode.node_dead 723 | 724 | 725 | 726 | 2 727 | 0 728 | AAAAAA 729 | 0 730 | 2 731 | 0 732 | 733 | Template Hadoop NameNode 734 | hadoop.namenode.node_decom 735 | 736 | 737 | 738 | 739 | 740 | 741 | -------------------------------------------------------------------------------- /mysql/mysql-template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2013-04-03T09:55:45Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 541 | 542 | 543 | 544 | MySQL - Connections 545 | 900 546 | 200 547 | 0.0000 548 | 100.0000 549 | 1 550 | 1 551 | 0 552 | 1 553 | 0 554 | 0.0000 555 | 0.0000 556 | 0 557 | 0 558 | 0 559 | 0 560 | 561 | 562 | 0 563 | 0 564 | 00DD00 565 | 0 566 | 2 567 | 0 568 | 569 | Template MySQL 570 | mysql[{HOST.HOST},Connections] 571 | 572 | 573 | 574 | 1 575 | 0 576 | FF3333 577 | 0 578 | 2 579 | 0 580 | 581 | Template MySQL 582 | mysql[{HOST.HOST},Aborted_clients] 583 | 584 | 585 | 586 | 2 587 | 0 588 | 6666FF 589 | 0 590 | 2 591 | 0 592 | 593 | Template MySQL 594 | mysql[{HOST.HOST},Aborted_connects] 595 | 596 | 597 | 598 | 599 | 600 | MySQL - Read / Write 601 | 900 602 | 200 603 | 0.0000 604 | 100.0000 605 | 1 606 | 1 607 | 0 608 | 1 609 | 0 610 | 0.0000 611 | 0.0000 612 | 0 613 | 0 614 | 0 615 | 0 616 | 617 | 618 | 0 619 | 0 620 | 00C800 621 | 0 622 | 2 623 | 0 624 | 625 | Template MySQL 626 | mysql[{HOST.HOST},Com_select] 627 | 628 | 629 | 630 | 1 631 | 0 632 | C80000 633 | 0 634 | 2 635 | 0 636 | 637 | Template MySQL 638 | mysql[{HOST.HOST},Com_write_total] 639 | 640 | 641 | 642 | 643 | 644 | MySQL - Replication Delay 645 | 900 646 | 200 647 | 0.0000 648 | 100.0000 649 | 1 650 | 1 651 | 0 652 | 1 653 | 0 654 | 0.0000 655 | 0.0000 656 | 0 657 | 0 658 | 0 659 | 0 660 | 661 | 662 | 0 663 | 0 664 | 0000EE 665 | 0 666 | 2 667 | 0 668 | 669 | Template MySQL 670 | mysql[{HOST.HOST},Replication_delay] 671 | 672 | 673 | 674 | 675 | 676 | MySQL - Slow Queries 677 | 900 678 | 200 679 | 0.0000 680 | 100.0000 681 | 1 682 | 1 683 | 0 684 | 1 685 | 0 686 | 0.0000 687 | 0.0000 688 | 0 689 | 0 690 | 0 691 | 0 692 | 693 | 694 | 0 695 | 0 696 | 0000EE 697 | 0 698 | 2 699 | 0 700 | 701 | Template MySQL 702 | mysql[{HOST.HOST},Slow_queries] 703 | 704 | 705 | 706 | 707 | 708 | MySQL - Threads 709 | 900 710 | 200 711 | 0.0000 712 | 100.0000 713 | 1 714 | 1 715 | 0 716 | 1 717 | 0 718 | 0.0000 719 | 0.0000 720 | 0 721 | 0 722 | 0 723 | 0 724 | 725 | 726 | 0 727 | 0 728 | 00C800 729 | 0 730 | 2 731 | 0 732 | 733 | Template MySQL 734 | mysql[{HOST.HOST},Threads_connected] 735 | 736 | 737 | 738 | 1 739 | 0 740 | C80000 741 | 0 742 | 2 743 | 0 744 | 745 | Template MySQL 746 | mysql[{HOST.HOST},Threads_running] 747 | 748 | 749 | 750 | 751 | 752 | 753 | --------------------------------------------------------------------------------