Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- HOST=`/bin/hostname`
- SERVER='zabbix.yourdomain.com'
- CURL=/usr/bin/curl
- read -a stat <<< "`$CURL -m 3 -s \""http://${HOST}/nginx_status"\" | tr '\n' ' '`"
- [ ! -z $stat ] && {
- echo -e "\
- ${HOST} nginx.active ${stat[2]}\n\
- ${HOST} nginx.accepts ${stat[7]}\n\
- ${HOST} nginx.handled ${stat[8]}\n\
- ${HOST} nginx.requests ${stat[9]}\n\
- ${HOST} nginx.reading ${stat[11]}\n\
- ${HOST} nginx.writing ${stat[13]}\n
- ${HOST} nginx.waiting ${stat[15]}" | \
- \
- ~/zabbix/bin/zabbix_sender \
- --zabbix-server ${SERVER} -s ${HOST} \
- --port '10051' -i - >/dev/null 2>&1
- }
- echo "1"
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement