forked from sflow/nginx-sflow-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
132 lines (113 loc) · 3.26 KB
/
README
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Copyright (c) 2011-2014 InMon Corp. Licensed under the terms of the InMon sFlow licence:
http://www.inmon.com/technology/sflowlicense.txt
nginx-sflow-module
==================
A binary, random-sampling nginx module designed for:
lightweight,
centralized,
continuous,
real-time monitoring of very large and very busy web farms.
Installation
============
First download the nginx sources, then tell the "./configure" script
that you want to add this module:
./configure ... --add-module=/absolute/path/to/nginx-sflow-module
make
make install
Configuration
=============
The module picks up it's sFlow config from the file /etc/hsflowd.auto,
so the easiest way to configure it is to install that daemon:
http://host-sflow.sourceforge.net
Alternatively, you could type something like this into /etc/hsflowd.auto:
rev_start=1
sampling=100
header=128
polling=10
agentIP=<ip-address>
collector=127.0.0.1 6343
rev_end=1
Where <ip-address> is the local IP address that best represents this host.
Output
======
The sFlow output goes to a UDP port on your sFlow collector host.
There you can examine it using a number of tools, including the
freeware "sflowtool", which can be downloaded as source code from:
http://www.inmon.com/technology/sflowTools.php
For example, to log all the fields in ASCII:
$ sflowtool
Or to log the HTTP samples in common-log-file format:
$ sflowtool -H
Example output from sflowtool:
startDatagram =================================
datagramSourceIP 10.0.0.150
datagramSize 192
unixSecondsUTC 1294168545
datagramVersion 5
agentSubId 32576
agent 10.0.0.150
packetSequenceNo 7
sysUpTime 25000
samplesInPacket 1
startSample ----------------------
sampleType_tag 0:1
sampleType FLOWSAMPLE
sampleSequenceNo 1
sourceId 3:65537
meanSkipCount 400
samplePool 124
dropEvents 0
inputPort 0
outputPort 1073741823
flowBlock_tag 0:2100
extendedType socket4
socket4_ip_protocol 6
socket4_local_ip 10.0.0.150
socket4_remote_ip 10.0.0.70
socket4_local_port 80
socket4_remote_port 63023
flowBlock_tag 0:2201
flowSampleType http
http_method 2
http_protocol 1001
http_uri /membase.php
http_host 10.0.0.150
http_useragent Java/1.6.0_22
http_bytes 3487
http_duration_uS 24278
http_status 200
endSample ----------------------
endDatagram =================================
startDatagram =================================
datagramSourceIP 10.0.0.150
datagramSize 116
unixSecondsUTC 1294168501
datagramVersion 5
agentSubId 32576
agent 10.0.0.150
packetSequenceNo 3
sysUpTime 42000
samplesInPacket 1
startSample ----------------------
sampleType_tag 0:2
sampleType COUNTERSSAMPLE
sampleSequenceNo 3
sourceId 3:65537
counterBlock_tag 0:2201
http_method_option_count 0
http_method_get_count 113
http_method_head_count 0
http_method_post_count 0
http_method_put_count 0
http_method_delete_count 0
http_method_trace_count 0
http_methd_connect_count 0
http_method_other_count 0
http_status_1XX_count 0
http_status_2XX_count 112
http_status_3XX_count 0
http_status_4XX_count 1
http_status_5XX_count 0
http_status_other_count 0
endSample ----------------------
endDatagram =================================