View difference between Paste ID: 8KYSWWVn and J8B94c6f
SHOW: | | - or go back to the newest paste.
1
#!/bin/bash
2
3
HOST=`/bin/hostname`
4
SERVER='zabbix.yourdomain.com'
5
CURL=/usr/bin/curl
6
7-
read -a stat <<< "`$CURL -m 3 -s \""http://${HOST}/nginx_status"\"  | tr '\n' ' '`"
7+
read -a stat <<< `$CURL -sm3 "http://${HOST}/nginx_status"`
8
9
[ ! -z $stat ] && {
10-
    echo -e "\
10+
    echo "\
11-
${HOST} nginx.active ${stat[2]}\n\
11+
${HOST} nginx.active ${stat[2]}
12-
${HOST} nginx.accepts ${stat[7]}\n\
12+
${HOST} nginx.accepts ${stat[7]}
13-
${HOST} nginx.handled ${stat[8]}\n\
13+
${HOST} nginx.handled ${stat[8]}
14-
${HOST} nginx.requests ${stat[9]}\n\
14+
${HOST} nginx.requests ${stat[9]}
15-
${HOST} nginx.reading ${stat[11]}\n\
15+
${HOST} nginx.reading ${stat[11]}
16-
${HOST} nginx.writing ${stat[13]}\n
16+
${HOST} nginx.writing ${stat[13]}
17-
${HOST} nginx.waiting ${stat[15]}" | \
17+
${HOST} nginx.waiting ${stat[15]}" |
18-
\
18+
19
    ~/zabbix/bin/zabbix_sender \
20
    --zabbix-server ${SERVER} -s ${HOST} \
21
    --port '10051' -i - >/dev/null 2>&1
22
}
23
24
echo "1"
25
exit 0