My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<plugin>

<script name="hq-nginx-stat">
<![CDATA[
#!/usr/bin/python

import httplib

conn = httplib.HTTPConnection("127.0.0.1")
try:
conn.request("GET", "/nginx_status")
resp = conn.getresponse()
data = resp.read().strip()

lines = data.split('\n')
connections = lines[0].split(':')[1].strip()
print 'Connections=%s' % connections

accepts, handled, requests = lines[2].strip().split(' ')
print 'Accepts=%s' % accepts
print 'Handled=%s' % handled
print 'Requests=%s' % requests

stats = lines[3].split(' ')
print 'Reading=%s' % stats[1]
print 'Writing=%s' % stats[3]
print 'Waiting=%s' % stats[5]

finally:
conn.close()
]]>
</script>

<server name="nginx">

<config>
<option name="process.query" description="Process Query" default="Pid.PidFile.eq=/var/run/nginx.pid"/>
</config>

<property name="HAS_BUILTIN_SERVICES" value="false"/>
<property name="PROC_QUERY" value="Pid.PidFile.eq=/var/run/nginx.pid"/>
<plugin type="autoinventory" class="org.hyperic.hq.product.DaemonDetector"/>
<plugin type="measurement" class="org.hyperic.hq.product.MeasurementPlugin"/>

<metric name="Availability" alias="Availability" template="sigar:Type=ProcState,Arg=%process.query%:State"
category="AVAILABILITY" indicator="true"/>

<filter name="template" value="exec:timeout=10,file=pdk/work/scripts/nginx/hq-nginx-stat,exec=%exec%:${alias}"/>

<metric name="Connections" indicator="true"/>
<metric name="Accepts" indicator="true"/>
<metric name="Handled" indicator="true"/>
<metric name="Requests" indicator="true"/>
<metric name="Writing" indicator="true"/>
<metric name="Waiting" indicator="true"/>


</server>

<!--
==================== Plugin Help ===========================
-->
<help name="nginx">
Nginx Plugin
</help>
</plugin>

Change log

r3 by dcancel on Apr 9, 2008   Diff
Version 1
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1850 bytes, 66 lines

File properties

svn:executable
*
Powered by Google Project Hosting