README
1Copyright (c) 2011-2014 InMon Corp. Licensed under the terms of the InMon sFlow licence:
2http://www.inmon.com/technology/sflowlicense.txt
3
4 nginx-sflow-module
5 ==================
6
7 A binary, random-sampling nginx module designed for:
8 lightweight,
9 centralized,
10 continuous,
11 real-time monitoring of very large and very busy web farms.
12
13Installation
14============
15 First download the nginx sources, then tell the "./configure" script
16 that you want to add this module:
17
18 ./configure ... --add-module=/absolute/path/to/nginx-sflow-module
19 make
20 make install
21
22Configuration
23=============
24 The module picks up it's sFlow config from the file /etc/hsflowd.auto,
25 so the easiest way to configure it is to install that daemon:
26
27 http://host-sflow.sourceforge.net
28
29 Alternatively, you could type something like this into /etc/hsflowd.auto:
30
31rev_start=1
32sampling=100
33header=128
34polling=10
35agentIP=<ip-address>
36collector=127.0.0.1 6343
37rev_end=1
38
39Where <ip-address> is the local IP address that best represents this host.
40
41Output
42======
43
44 The sFlow output goes to a UDP port on your sFlow collector host.
45 There you can examine it using a number of tools, including the
46 freeware "sflowtool", which can be downloaded as source code from:
47
48 http://www.inmon.com/technology/sflowTools.php
49
50 For example, to log all the fields in ASCII:
51
52 $ sflowtool
53
54 Or to log the HTTP samples in common-log-file format:
55
56 $ sflowtool -H
57
58
59Example output from sflowtool:
60
61 startDatagram =================================
62 datagramSourceIP 10.0.0.150
63 datagramSize 192
64 unixSecondsUTC 1294168545
65 datagramVersion 5
66 agentSubId 32576
67 agent 10.0.0.150
68 packetSequenceNo 7
69 sysUpTime 25000
70 samplesInPacket 1
71 startSample ----------------------
72 sampleType_tag 0:1
73 sampleType FLOWSAMPLE
74 sampleSequenceNo 1
75 sourceId 3:65537
76 meanSkipCount 400
77 samplePool 124
78 dropEvents 0
79 inputPort 0
80 outputPort 1073741823
81 flowBlock_tag 0:2100
82 extendedType socket4
83 socket4_ip_protocol 6
84 socket4_local_ip 10.0.0.150
85 socket4_remote_ip 10.0.0.70
86 socket4_local_port 80
87 socket4_remote_port 63023
88 flowBlock_tag 0:2201
89 flowSampleType http
90 http_method 2
91 http_protocol 1001
92 http_uri /membase.php
93 http_host 10.0.0.150
94 http_useragent Java/1.6.0_22
95 http_bytes 3487
96 http_duration_uS 24278
97 http_status 200
98 endSample ----------------------
99 endDatagram =================================
100 startDatagram =================================
101 datagramSourceIP 10.0.0.150
102 datagramSize 116
103 unixSecondsUTC 1294168501
104 datagramVersion 5
105 agentSubId 32576
106 agent 10.0.0.150
107 packetSequenceNo 3
108 sysUpTime 42000
109 samplesInPacket 1
110 startSample ----------------------
111 sampleType_tag 0:2
112 sampleType COUNTERSSAMPLE
113 sampleSequenceNo 3
114 sourceId 3:65537
115 counterBlock_tag 0:2201
116 http_method_option_count 0
117 http_method_get_count 113
118 http_method_head_count 0
119 http_method_post_count 0
120 http_method_put_count 0
121 http_method_delete_count 0
122 http_method_trace_count 0
123 http_methd_connect_count 0
124 http_method_other_count 0
125 http_status_1XX_count 0
126 http_status_2XX_count 112
127 http_status_3XX_count 0
128 http_status_4XX_count 1
129 http_status_5XX_count 0
130 http_status_other_count 0
131 endSample ----------------------
132 endDatagram =================================
133