summaryrefslogtreecommitdiff
path: root/debian/mongosniff.1
blob: 8b4ffd41d2a4b0d56d79d99b68b97ff9f5a1c702 (plain)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
.TH "MONGOSNIFF" "1" "March 14, 2013" "2.2.3" "mongodb-manual"
.SH NAME
mongosniff \- MongoDB
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.\" Man page generated from reStructuredText.
.
.SH SYNOPSIS
.sp
\fI\%mongosniff\fP provides a low\-level operation tracing/sniffing view
into database activity in real time. Think of \fI\%mongosniff\fP as a
MongoDB\-specific analogue of \fBtcpdump\fP for TCP/IP network
traffic. Typically, \fI\%mongosniff\fP is most frequently used in driver
development.
.IP Note
\fI\%mongosniff\fP requires \fBlibpcap\fP and is only available for
Unix\-like systems. Furthermore, the version distributed with the
MongoDB binaries is dynamically linked against aversion 0.9 of
\fBlibpcap\fP. If your system has a different version of \fBlibpcap\fP, you
will need to compile \fI\%mongosniff\fP yourself or create a
symbolic link pointing to \fBlibpcap.so.0.9\fP to your local version
of \fBlibpcap\fP. Use an operation that resembles the following:
.sp
.nf
.ft C
ln \-s /usr/lib/libpcap.so.1.1.1 /usr/lib/libpcap.so.0.9
.ft P
.fi
.sp
Change the path\(aqs and name of the shared library as needed.
.RE
.sp
As an alternative to \fI\%mongosniff\fP, Wireshark, a popular
network sniffing tool is capable of inspecting and parsing the MongoDB
wire protocol.
.SH OPTIONS
.INDENT 0.0
.TP
.B mongosniff
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help
Returns a basic help and usage text.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-forward <host><:port>
Declares a host to forward all parsed requests that the
\fI\%mongosniff\fP intercepts to another \fBmongod\fP
instance and issue those operations on that database instance.
.sp
Specify the target host name and port in the \fB<host><:port>\fP
format.
.sp
To connect to a replica set, you can specify the replica set seed
name, and a seed list of set members, in the following format:
.sp
.nf
.ft C
<replica_set_name>/<hostname1><:port>,<hostname2:<port>,...
.ft P
.fi
.UNINDENT
.INDENT 0.0
.TP
.B \-\-source <NET [interface]>, <FILE [filename]>, <DIAGLOG [filename]>
Specifies source material to inspect. Use \fB\-\-source NET
[interface]\fP to inspect traffic from a network interface
(e.g. \fBeth0\fP or \fBlo\fP.) Use \fB\-\-source FILE [filename]\fP to
read captured packets in \fIpcap\fP format.
.sp
You may use the \fB\-\-source DIAGLOG [filename]\fP option to read
the output files produced by the \fI\-\-diaglog\fP
option.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-objcheck
Modifies the behavior to \fIonly\fP display invalid BSON objects and
nothing else. Use this option for troubleshooting driver
development. This option has some performance impact on the
performance of \fI\%mongosniff\fP.
.UNINDENT
.INDENT 0.0
.TP
.B <port>
Specifies alternate ports to sniff for traffic. By default,
\fI\%mongosniff\fP watches for MongoDB traffic on port 27017. Append
multiple port numbers to the end of \fI\%mongosniff\fP to monitor
traffic on multiple ports.
.UNINDENT
.SH USAGE
.sp
Use the following command to connect to a \fBmongod\fP or
\fBmongos\fP running on port 27017 \fIand\fP 27018 on the localhost
interface:
.sp
.nf
.ft C
mongosniff \-\-source NET lo 27017 27018
.ft P
.fi
.sp
Use the following command to only log invalid \fIBSON\fP objects for
the \fBmongod\fP or \fBmongos\fP running on the localhost
interface and port 27018, for driver development and troubleshooting:
.sp
.nf
.ft C
mongosniff \-\-objcheck \-\-source NET lo 27018
.ft P
.fi
.SH BUILD MONGOSNIFF
.sp
To build \fBmongosniff\fP yourself, Linux users can use the following
procedure:
.INDENT 0.0
.IP 1. 3
Obtain prerequisites using your operating
systems package management software. Dependencies include:
.INDENT 3.0
.IP \(bu 2
\fBlibpcap\fP \- to capture network packets.
.IP \(bu 2
\fBgit\fP \- to download the MongoDB source code.
.IP \(bu 2
\fBscons\fP and a C++ compiler \- to build \fI\%mongosniff\fP.
.UNINDENT
.IP 2. 3
Download a copy of the MongoDB source code using \fBgit\fP:
.sp
.nf
.ft C
git clone git://github.com/mongodb/mongo.git
.ft P
.fi
.IP 3. 3
Issue the following sequence of commands to change to the
\fBmongo/\fP directory and build \fI\%mongosniff\fP:
.sp
.nf
.ft C
cd mongo
scons mongosniff
.ft P
.fi
.UNINDENT
.IP Note
If you run \fBscons mongosniff\fP before installing \fBlibpcap\fP you
must run \fBscons clean\fP before you can build \fI\%mongosniff\fP.
.RE
.SH AUTHOR
MongoDB Documentation Project
.SH COPYRIGHT
2011-2013, 10gen, Inc.
.\" Generated by docutils manpage writer.
.