2013-10-04 22:58:27 +02:00
|
|
|
.\" Man page generated from reStructuredText.
|
|
|
|
.
|
2015-01-30 22:44:56 +01:00
|
|
|
.TH "MONGOSNIFF" "1" "January 30, 2015" "3.0" "mongodb-manual"
|
2013-03-15 00:00:30 +01:00
|
|
|
.SH NAME
|
2014-02-28 17:16:26 +01:00
|
|
|
mongosniff \- MongoDB Protocol Introspection Utility
|
2013-03-15 00:00:30 +01:00
|
|
|
.
|
|
|
|
.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
|
|
|
|
..
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.sp
|
2013-10-04 22:58:27 +02:00
|
|
|
\fBmongosniff\fP provides a low\-level operation tracing/sniffing view
|
|
|
|
into database activity in real time. Think of \fBmongosniff\fP as a
|
2013-03-15 00:00:30 +01:00
|
|
|
MongoDB\-specific analogue of \fBtcpdump\fP for TCP/IP network
|
2013-10-04 22:58:27 +02:00
|
|
|
traffic. Typically, \fBmongosniff\fP is most frequently used in driver
|
2013-03-15 00:00:30 +01:00
|
|
|
development.
|
2013-10-04 22:58:27 +02:00
|
|
|
.sp
|
|
|
|
\fBNOTE:\fP
|
|
|
|
.INDENT 0.0
|
|
|
|
.INDENT 3.5
|
|
|
|
\fBmongosniff\fP requires \fBlibpcap\fP and is only available for
|
2015-01-30 22:44:56 +01:00
|
|
|
Unix\-like systems.
|
2013-10-04 22:58:27 +02:00
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
2013-10-04 22:58:27 +02:00
|
|
|
As an alternative to \fBmongosniff\fP, Wireshark, a popular
|
2013-03-15 00:00:30 +01:00
|
|
|
network sniffing tool is capable of inspecting and parsing the MongoDB
|
|
|
|
wire protocol.
|
|
|
|
.SH OPTIONS
|
|
|
|
.INDENT 0.0
|
2010-02-08 19:57:59 +01:00
|
|
|
.TP
|
2013-03-15 00:00:30 +01:00
|
|
|
.B mongosniff
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
2010-02-08 19:57:59 +01:00
|
|
|
.TP
|
2013-10-04 22:58:27 +02:00
|
|
|
.B mongosniff
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
2015-01-30 22:44:56 +01:00
|
|
|
.B \-\-help
|
|
|
|
Returns information on the options and use of \fBmongosniff\fP\&.
|
2013-03-15 00:00:30 +01:00
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
2010-02-08 19:57:59 +01:00
|
|
|
.TP
|
2013-03-15 00:00:30 +01:00
|
|
|
.B \-\-forward <host><:port>
|
|
|
|
Declares a host to forward all parsed requests that the
|
2014-02-28 17:16:26 +01:00
|
|
|
\fBmongosniff\fP intercepts to another \fBmongod\fP instance
|
|
|
|
and issue those operations on that database instance.
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
2014-02-28 17:16:26 +01:00
|
|
|
Specify the target host name and port in the \fB<host><:port>\fP format.
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
2015-01-30 22:44:56 +01:00
|
|
|
To connect to a replica set, specify the \fBreplica set name\fP and a seed list of set members. Use the
|
|
|
|
following form:
|
2013-10-04 22:58:27 +02:00
|
|
|
.INDENT 7.0
|
|
|
|
.INDENT 3.5
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
2015-01-30 22:44:56 +01:00
|
|
|
<replSetName>/<hostname1><:port>,<hostname2><:port>,<...>
|
2013-03-15 00:00:30 +01:00
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.UNINDENT
|
2013-10-04 22:58:27 +02:00
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
2013-03-15 00:00:30 +01:00
|
|
|
.INDENT 0.0
|
2011-03-17 19:56:03 +01:00
|
|
|
.TP
|
2014-02-28 17:16:26 +01:00
|
|
|
.B \-\-source <NET [interface]>
|
|
|
|
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
|
2013-03-15 00:00:30 +01:00
|
|
|
option.
|
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
|
|
|
.B \-\-objcheck
|
2014-02-28 17:16:26 +01:00
|
|
|
Displays invalid BSON objects only and nothing else. Use this option for
|
|
|
|
troubleshooting driver development. This option has some performance
|
|
|
|
impact on the performance of \fBmongosniff\fP\&.
|
2013-03-15 00:00:30 +01:00
|
|
|
.UNINDENT
|
|
|
|
.INDENT 0.0
|
|
|
|
.TP
|
|
|
|
.B <port>
|
|
|
|
Specifies alternate ports to sniff for traffic. By default,
|
2014-02-28 17:16:26 +01:00
|
|
|
\fBmongosniff\fP watches for MongoDB traffic on port \fB27017\fP\&. Append
|
2013-10-04 22:58:27 +02:00
|
|
|
multiple port numbers to the end of \fBmongosniff\fP to monitor
|
2013-03-15 00:00:30 +01:00
|
|
|
traffic on multiple ports.
|
|
|
|
.UNINDENT
|
2014-02-28 17:16:26 +01:00
|
|
|
.SH USE
|
2013-03-15 00:00:30 +01:00
|
|
|
.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:
|
2013-10-04 22:58:27 +02:00
|
|
|
.INDENT 0.0
|
|
|
|
.INDENT 3.5
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
mongosniff \-\-source NET lo 27017 27018
|
|
|
|
.ft P
|
|
|
|
.fi
|
2013-10-04 22:58:27 +02:00
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
2013-03-15 00:00:30 +01:00
|
|
|
.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:
|
2013-10-04 22:58:27 +02:00
|
|
|
.INDENT 0.0
|
|
|
|
.INDENT 3.5
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
mongosniff \-\-objcheck \-\-source NET lo 27018
|
|
|
|
.ft P
|
|
|
|
.fi
|
2013-10-04 22:58:27 +02:00
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
2013-03-15 00:00:30 +01:00
|
|
|
.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
|
2013-10-04 22:58:27 +02:00
|
|
|
\fBscons\fP and a C++ compiler \- to build \fBmongosniff\fP\&.
|
2013-03-15 00:00:30 +01:00
|
|
|
.UNINDENT
|
|
|
|
.IP 2. 3
|
|
|
|
Download a copy of the MongoDB source code using \fBgit\fP:
|
2013-10-04 22:58:27 +02:00
|
|
|
.INDENT 3.0
|
|
|
|
.INDENT 3.5
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
git clone git://github.com/mongodb/mongo.git
|
|
|
|
.ft P
|
|
|
|
.fi
|
2013-10-04 22:58:27 +02:00
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
2013-03-15 00:00:30 +01:00
|
|
|
.IP 3. 3
|
|
|
|
Issue the following sequence of commands to change to the
|
2013-10-04 22:58:27 +02:00
|
|
|
\fBmongo/\fP directory and build \fBmongosniff\fP:
|
|
|
|
.INDENT 3.0
|
|
|
|
.INDENT 3.5
|
2013-03-15 00:00:30 +01:00
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.ft C
|
|
|
|
cd mongo
|
|
|
|
scons mongosniff
|
|
|
|
.ft P
|
|
|
|
.fi
|
|
|
|
.UNINDENT
|
2013-10-04 22:58:27 +02:00
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
|
|
|
.sp
|
|
|
|
\fBNOTE:\fP
|
|
|
|
.INDENT 0.0
|
|
|
|
.INDENT 3.5
|
2013-03-15 00:00:30 +01:00
|
|
|
If you run \fBscons mongosniff\fP before installing \fBlibpcap\fP you
|
2013-10-04 22:58:27 +02:00
|
|
|
must run \fBscons clean\fP before you can build \fBmongosniff\fP\&.
|
|
|
|
.UNINDENT
|
|
|
|
.UNINDENT
|
2013-03-15 00:00:30 +01:00
|
|
|
.SH AUTHOR
|
|
|
|
MongoDB Documentation Project
|
|
|
|
.SH COPYRIGHT
|
2015-01-30 22:44:56 +01:00
|
|
|
2011-2015
|
2013-03-15 00:00:30 +01:00
|
|
|
.\" Generated by docutils manpage writer.
|
|
|
|
.
|