Usage: ./check_f5.py -H (--hostname) F5 ip to query (required) -C (--community) SNMP read community (defaults to public) -c (--content) Montor Content('sys'/'pool'/'http') -hc (--critical) HttpRequests Threshold -sc (--critical) CurConns Threshold -s (--show) Show the Poolname (if choose Content 'Pool') -n (--name) Poolname to query (if choose Content 'Pool') -t (--traffic) |_Pool traffic to query ('-n' required) -tc (--critical) |_Traffic Threshold ('-n' required) -o (--other) |_Pool other information ('-n' required) -oc (--critical) |_Pool ServerCurConns information ('-o' required) -h (--help) usage help For example: 1. check_f5.py -H x.x.x.x -c sys -sc 1000 #查看F5总体性能 2. check_f5.py -H x.x.x.x -c http -hc 1000 #查看当前http请求数 3. check_f5.py -H x.x.x.x -c pool -s #查看当前配置的pool 4. check_f5.py -H x.x.x.x -c pool -n poolname -t #监控指定pool的流量 5. check_f5.py -H x.x.x.x -c pool -n poolname -o -oc 1000''' #监控指定pool的服务端连接数
这个脚本所使用的OID值: # The host memory in bytes currently in use (not including TMM). 'MemUsed':'1.3.6.1.4.1.3375.2.1.7.1.2', #The current connections from client side. 'ClientCurConns':'1.3.6.1.4.1.3375.2.1.1.2.1.8', # The current connections from server side. 'ServerCurConns':'1.3.6.1.4.1.3375.2.1.1.2.1.15', #The number of ltmPool entries in the table. 'PoolNumber':'1.3.6.1.4.1.3375.2.2.5.1.1' #The total number of HTTP requests. 'sysStatHttpRequests':'1.3.6.1.4.1.3375.2.1.1.2.1.56', #The current connections from server side. 'PoolStatServerCurConns':'1.3.6.1.4.1.3375.2.2.5.2.3.1.8', 'PoolName':'1.3.6.1.4.1.3375.2.2.5.5.2.1.1', #The state of the pool availability indicated in color. 'PoolStatusAvailState':'1.3.6.1.4.1.3375.2.2.5.5.2.1.2', #The number of bytes received from server side. 'PoolStatServerBytesIn':'1.3.6.1.4.1.3375.2.2.5.2.3.1.3', #The number of bytes sent to server side. 'PoolStatServerBytesOut':'1.3.6.1.4.1.3375.2.2.5.2.3.1.5', #The total number of members in the specified pool. 'PoolMemberCnt':'1.3.6.1.4.1.3375.2.2.5.1.2.1.23'
提示:此脚本是专为nagios而编写的插件,代码指定了nagios插件安装路径‘/usr/local/nagios/libexec’,如需更改,请更改代码。
|