1
.TH MONGOSNIFF "1" "Jan 2010" "10gen" "Mongo Database"
3
mongosniff \- the Mongo packet analyzer
5
\fBmongosniff [\fIOPTIONS\fR] [\fI<port0> <port1> ...\fR]
9
is a analyzer tool for analyzing packets coming to your database.
14
Forward all parsed request messages to mongod instance at specified host:port
17
Source of traffic to sniff, either a network interface or a file containing previously captured packets, in pcap format. If no source is specified, mongosniff will attempt to sniff from one of the machine's network interfaces.
20
print a short help message.
23
These parameters are used to filter sniffing. By default, only port 27017 is sniffed.
26
show usage information
29
Copyright 2007\-2011 10gen
31
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
1
.TH "MONGOSNIFF" "1" "March 14, 2013" "2.2.3" "mongodb-manual"
5
.nr rst2man-indent-level 0
9
level \\n[rst2man-indent-level]
10
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17
.\" .rstReportMargin pre:
19
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20
. nr rst2man-indent-level +1
21
.\" .rstReportMargin post:
25
.\" indent \\n[an-margin]
26
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27
.nr rst2man-indent-level -1
28
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31
.\" Man page generated from reStructuredText.
35
\fI\%mongosniff\fP provides a low\-level operation tracing/sniffing view
36
into database activity in real time. Think of \fI\%mongosniff\fP as a
37
MongoDB\-specific analogue of \fBtcpdump\fP for TCP/IP network
38
traffic. Typically, \fI\%mongosniff\fP is most frequently used in driver
41
\fI\%mongosniff\fP requires \fBlibpcap\fP and is only available for
42
Unix\-like systems. Furthermore, the version distributed with the
43
MongoDB binaries is dynamically linked against aversion 0.9 of
44
\fBlibpcap\fP. If your system has a different version of \fBlibpcap\fP, you
45
will need to compile \fI\%mongosniff\fP yourself or create a
46
symbolic link pointing to \fBlibpcap.so.0.9\fP to your local version
47
of \fBlibpcap\fP. Use an operation that resembles the following:
51
ln \-s /usr/lib/libpcap.so.1.1.1 /usr/lib/libpcap.so.0.9
55
Change the path\(aqs and name of the shared library as needed.
58
As an alternative to \fI\%mongosniff\fP, Wireshark, a popular
59
network sniffing tool is capable of inspecting and parsing the MongoDB
69
Returns a basic help and usage text.
73
.B \-\-forward <host><:port>
74
Declares a host to forward all parsed requests that the
75
\fI\%mongosniff\fP intercepts to another \fBmongod\fP
76
instance and issue those operations on that database instance.
78
Specify the target host name and port in the \fB<host><:port>\fP
81
To connect to a replica set, you can specify the replica set seed
82
name, and a seed list of set members, in the following format:
86
<replica_set_name>/<hostname1><:port>,<hostname2:<port>,...
92
.B \-\-source <NET [interface]>, <FILE [filename]>, <DIAGLOG [filename]>
93
Specifies source material to inspect. Use \fB\-\-source NET
94
[interface]\fP to inspect traffic from a network interface
95
(e.g. \fBeth0\fP or \fBlo\fP.) Use \fB\-\-source FILE [filename]\fP to
96
read captured packets in \fIpcap\fP format.
98
You may use the \fB\-\-source DIAGLOG [filename]\fP option to read
99
the output files produced by the \fI\-\-diaglog\fP
105
Modifies the behavior to \fIonly\fP display invalid BSON objects and
106
nothing else. Use this option for troubleshooting driver
107
development. This option has some performance impact on the
108
performance of \fI\%mongosniff\fP.
113
Specifies alternate ports to sniff for traffic. By default,
114
\fI\%mongosniff\fP watches for MongoDB traffic on port 27017. Append
115
multiple port numbers to the end of \fI\%mongosniff\fP to monitor
116
traffic on multiple ports.
120
Use the following command to connect to a \fBmongod\fP or
121
\fBmongos\fP running on port 27017 \fIand\fP 27018 on the localhost
126
mongosniff \-\-source NET lo 27017 27018
130
Use the following command to only log invalid \fIBSON\fP objects for
131
the \fBmongod\fP or \fBmongos\fP running on the localhost
132
interface and port 27018, for driver development and troubleshooting:
136
mongosniff \-\-objcheck \-\-source NET lo 27018
141
To build \fBmongosniff\fP yourself, Linux users can use the following
145
Obtain prerequisites using your operating
146
systems package management software. Dependencies include:
149
\fBlibpcap\fP \- to capture network packets.
151
\fBgit\fP \- to download the MongoDB source code.
153
\fBscons\fP and a C++ compiler \- to build \fI\%mongosniff\fP.
156
Download a copy of the MongoDB source code using \fBgit\fP:
160
git clone git://github.com/mongodb/mongo.git
164
Issue the following sequence of commands to change to the
165
\fBmongo/\fP directory and build \fI\%mongosniff\fP:
175
If you run \fBscons mongosniff\fP before installing \fBlibpcap\fP you
176
must run \fBscons clean\fP before you can build \fI\%mongosniff\fP.
179
MongoDB Documentation Project
181
2011-2013, 10gen, Inc.
182
.\" Generated by docutils manpage writer.