OnWorks favicon

mongosniff - Online in the Cloud

Run mongosniff in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command mongosniff that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator



mongosniff - MongoDB


mongosniff provides a low-level operation tracing/sniffing view into database activity in
real time. Think of mongosniff as a MongoDB-specific analogue of tcpdump for TCP/IP
network traffic. Typically, mongosniff is most frequently used in driver development.

Note mongosniff requires libpcap and is only available for Unix-like systems.
Furthermore, the version distributed with the MongoDB binaries is dynamically
linked against aversion 0.9 of libpcap. If your system has a different version of
libpcap, you will need to compile mongosniff yourself or create a symbolic link
pointing to libpcap.so.0.9 to your local version of libpcap. Use an operation that
resembles the following:

ln -s /usr/lib/libpcap.so.1.1.1 /usr/lib/libpcap.so.0.9

Change the path's and name of the shared library as needed.

As an alternative to mongosniff, Wireshark, a popular network sniffing tool is capable of
inspecting and parsing the MongoDB wire protocol.



--help Returns a basic help and usage text.

--forward <host><:port>
Declares a host to forward all parsed requests that the mongosniff intercepts to
another mongod instance and issue those operations on that database instance.

Specify the target host name and port in the <host><:port> format.

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:


--source <NET [interface]>, <FILE [filename]>, <DIAGLOG [filename]>
Specifies source material to inspect. Use --source NET [interface] to inspect
traffic from a network interface (e.g. eth0 or lo.) Use --source FILE [filename] to
read captured packets in pcap format.

You may use the --source DIAGLOG [filename] option to read the output files
produced by the --diaglog option.

Modifies the behavior to only display invalid BSON objects and nothing else. Use
this option for troubleshooting driver development. This option has some
performance impact on the performance of mongosniff.

<port> Specifies alternate ports to sniff for traffic. By default, mongosniff watches for
MongoDB traffic on port 27017. Append multiple port numbers to the end of
mongosniff to monitor traffic on multiple ports.


Use the following command to connect to a mongod or mongos running on port 27017 and 27018
on the localhost interface:

mongosniff --source NET lo 27017 27018

Use the following command to only log invalid BSON objects for the mongod or mongos
running on the localhost interface and port 27018, for driver development and

mongosniff --objcheck --source NET lo 27018


To build mongosniff yourself, Linux users can use the following procedure:

1. Obtain prerequisites using your operating systems package management software.
Dependencies include:

· libpcap - to capture network packets.

· git - to download the MongoDB source code.

· scons and a C++ compiler - to build mongosniff.

2. Download a copy of the MongoDB source code using git:

git clone git://github.com/mongodb/mongo.git

3. Issue the following sequence of commands to change to the mongo/ directory and build

cd mongo
scons mongosniff

Note If you run scons mongosniff before installing libpcap you must run scons clean
before you can build mongosniff.

Use mongosniff online using onworks.net services

Free Servers & Workstations

Download Windows & Linux apps

  • 1
    itop - ITSM  CMDB OpenSource
    itop - ITSM CMDB OpenSource
    IT Operations Portal: a complete open
    source, ITIL, web based service
    management tool including a fully
    customizable CMDB, a helpdesk system and
    a document man...
    Download itop - ITSM CMDB OpenSource
  • 2
    Clementine is a multi-platform music
    player and library organizer inspired by
    Amarok 1.4. It has a fast and
    easy-to-use interface, and allows you to
    search and ...
    Download Clementine
  • 3
    ATTENTION: Cumulative update 2.4.3 has
    been released!! The update works for any
    previous 2.x.x version. If upgrading
    from version v1.x.x, please download and
    Download XISMuS
  • 4
    Modular headtracking program that
    supports multiple face-trackers, filters
    and game-protocols. Among the trackers
    are the SM FaceAPI, AIC Inertial Head
    Tracker ...
    Download facetracknoir
  • 5
    PHP QR Code
    PHP QR Code
    PHP QR Code is open source (LGPL)
    library for generating QR Code,
    2-dimensional barcode. Based on
    libqrencode C library, provides API for
    creating QR Code barc...
    Download PHP QR Code
  • 6
    Cuckoo Sandbox
    Cuckoo Sandbox
    Cuckoo Sandbox uses components to
    monitor the behavior of malware in a
    Sandbox environment; isolated from the
    rest of the system. It offers automated
    analysis o...
    Download Cuckoo Sandbox
  • 7
    Play YouTube video on LMS (porting of
    Triode's to YouTbe API v3) This is
    an application that can also be fetched
    Download LMS-YouTube
  • More »

Linux commands

  • 1
    2vcard - convert addressbooks to VCARD
    format ...
    Run 2vcard
  • 2
    xml2 - convert xml documents in a flat
    format 2xml - convert flat format into
    xml html2 - convert html documents in a
    flat format 2html - convert flat format
    Run 2xml
  • 3
    cpupower - Shows and sets processor
    power related values ...
    Run cpupower
  • 4
    CQRLOG - Advanced logging program for
    hamradio operators DESCRIPTION: CQRLOG
    is an advanced ham radio logger based on
    MySQL database. Provides radio control
    Run cqrlog
  • 5
    gammu-smsd - SMS daemon for Gammu ...
    Run gammu-smsd
  • 6
    gammu - Does some neat things with your
    cellular phone or modem. ...
    Run gammu
  • More »