Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (49 sloc) 1.75 KB
.. _mongosniff:
==============
``mongosniff``
==============
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Synopsis
--------
:program:`mongosniff` provides a low-level operation tracing/sniffing view
into database activity in real time. Think of :program:`mongosniff` as a
MongoDB-specific analogue of ``tcpdump`` for TCP/IP network
traffic. :program:`mongosniff` is most frequently used in driver
development.
.. _mongosniff-libcap:
.. note::
:program:`mongosniff` requires ``libpcap`` and is only available for
Unix-like systems.
As an alternative to :program:`mongosniff`, Wireshark, a popular
network sniffing tool is capable of inspecting and parsing the MongoDB
wire protocol.
.. _mongosniff-options:
Options
-------
.. binary:: mongosniff
.. program:: mongosniff
.. include:: /includes/option/option-mongosniff-help.rst
.. include:: /includes/option/option-mongosniff-forward.rst
.. include:: /includes/option/option-mongosniff-source.rst
.. include:: /includes/option/option-mongosniff-objcheck.rst
.. include:: /includes/option/option-mongosniff-<port>.rst
Use
---
Use the following command to connect to a :program:`mongod` or
:program:`mongos` running on port 27017 *and* 27018 on the localhost
interface:
.. code-block:: sh
mongosniff --source NET lo 27017 27018
Use the following command to only log invalid :term:`BSON` objects for
the :program:`mongod` or :program:`mongos` running on the localhost
interface and port 27018, for driver development and troubleshooting:
.. code-block:: sh
mongosniff --objcheck --source NET lo 27018
.. seealso::
To build :program:`mongosniff` yourself, see: `Build MongoDB
From Source <https://github.com/mongodb/mongo/wiki>`_.
Something went wrong with that request. Please try again.