Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: snmp
á Õ ×ÁÓ ÓÌÕÞÁÊÎÏ ÄÌÑ cacti ÐÌÁÇÉÎÁ ÎÅÔÕ?
06.03.08, 18:48, "Olexander Shtepa" <isk@xxxxxxxxxxxx>:
> snmpd.conf:
> exec nginx_requests /etc/snmp/exec_nginx requests
> exec nginx_active /etc/snmp/exec_nginx active
> exec nginx_keepalive /etc/snmp/exec_nginx keepalive
> exec nginx_accepts /etc/snmp/exec_nginx accepts
> /etc/snmp/exec_nginx:
> #!/bin/sh
> function status(){
> curl -s -m 10 http://host/stub_status
> }
> case "$1" in
> requests)
> status | awk 'FNR==3 {print $3}'
> ;;
> accepts)
> status | awk 'FNR==3 {print $1}'
> ;;
> active)
> status | awk '$1=="Active" {print $3}'
> ;;
> keepalive)
> status | awk '$1=="Reading:" {print $6}'
> ;;
> *)
> echo "Using: $0 requests|accepts|active|keepalive"
> exit 1
> esac
|