Skip to content

1945 server status metrics to enterprise snmp #1466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions source/tutorial/monitor-mongodb-windows-with-snmp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
=================================
Monitor MongoDB Windows with SNMP
=================================

.. versionadded:: 2.5.3

.. admonition:: Enterprise Feature

SNMP is only available in `MongoDB Enterprise
<http://www.mongodb.com/products/mongodb-enterprise>`_. Only
:program:`mongod.exe` instances provide SNMP support.
:program:`mongos.exe` and the other MongoDB binaries do not support
SNMP.

Overview
--------

MongoDB Enterprise supports SNMP monitoring :program:`mongod.exe`
instances to help ensure a robust deployment. This procedure explains
how to run :program:`mongod.exe` as an SNMP subagent. This procedure
covers where to copy relevant configuration files and how to initialize
and test MongoDB Enterprise SNMP support.

.. seealso:: :doc:`/tutorial/monitor-mongodb-with-snmp` and :doc:`/tutorial/troubleshoot-snmp`

Install Configuration Files
---------------------------

MongoDB Enterprise contains the following configuration files to
support SNMP:

- ``MONGO-MIB.txt``:

The management information base (MIB) file that defines MongoDB's
SNMP output.

- ``mongod.conf.subagent``:

The configuration file to run :program:`mongod.exe` as the SNMP
subagent. This file sets SNMP run-time configuration options,
including the ``AgentX`` socket to connect to the SNMP master.

- ``mongod.conf.master``:

The configuration file to run :program:`mongod.exe` as the SNMP
master. This file sets SNMP run-time configuration options.

Copy Configuration Files
~~~~~~~~~~~~~~~~~~~~~~~~

Ensure that the ``C:\snmp\etc\config`` directory exists. From the
installation directory, copy the configuration files to the SNMP
service configuration directory:

.. code-block:: sh

copy MONGO-MIB.txt C:\snmp\etc\config\MONGO-MIB.txt
copy mongod.conf.subagent C:\snmp\etc\config\mongod.conf

Edit the new ``mongod.conf`` using instructions in that file, to
ensure that:

- The ``agentXAddress`` socket matches the ``agentXAddress`` in the
SNMP master configuration file. The configuration filename
is tool-dependent. For example, when using ``net-snmp`` the
configuration file is ``snmpd.conf``.

- SNMP uses TCP rather than UNIX Domain Sockets.

Start MongoDB
-------------

Start :program:`mongod.exe` with the :option:`--snmp-subagent <mongod.exe>` to send data
to the SNMP master.

.. code-block:: sh

mongod.exe --snmp-subagent

Test SNMP
---------

Confirm Data Retrieval
~~~~~~~~~~~~~~~~~~~~~~

Connect an SNMP client to verify the ability to collect SNMP data
from MongoDB.

Install the `net-snmp <http://www.net-snmp.org/>`_ package to
access the snmpwalk client. ``net-snmp`` provides the ``snmpwalk``
SNMP client.

Use ``snmpwalk`` to collect data from :program:`mongod.exe`:

.. code-block:: sh

snmpwalk -m C:\snmp\etc\config\MONGO-MIB -v 2c -c mongodb 127.0.0.1:<port> 1.3.6.1.4.1.34601

``<port>`` refers to the UDP port defined by the SNMP master,
*not* the :option:`--port <mongod --port>` argument used by :program:`mongod.exe`.

Optional: Run as SNMP Master
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can run :program:`mongod.exe` with the :option:`--snmp-master`
option for test purposes. To do this, use the SNMP master
configuration file instead of the subagent configuration file. From
the directory containing the unpacked MongoDB installation files:

.. code-block:: sh

copy mongod.conf.master C:\snmp\etc\config\mongod.conf

115 changes: 115 additions & 0 deletions source/tutorial/monitor-mongodb-with-snmp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
=========================
Monitor MongoDB With SNMP
=========================

.. versionadded:: 2.2

.. admonition:: Enterprise Feature

SNMP is only available in `MongoDB Enterprise
<http://www.mongodb.com/products/mongodb-enterprise>`_. Only
:program:`mongod` instances provide SNMP support.
:program:`mongos` and the other MongoDB binaries do not support
SNMP.

Overview
--------

MongoDB Enterprise supports SNMP monitoring :program:`mongod` instances
to help ensure a robust deployment. This procedure explains how to run
:program:`mongod` as an SNMP subagent. This procedure covers where
to copy relevant configuration files and how to initialize and test
MongoDB Enterprise SNMP support.

.. seealso:: :doc:`/tutorial/monitor-mongodb-windows-with-snmp` and :doc:`/tutorial/troubleshoot-snmp`

Install Configuration Files
---------------------------

.. versionchanged:: 2.5.3

MongoDB Enterprise contains the following configuration files to
support SNMP:

- ``MONGO-MIB.txt``:

The management information base (MIB) file that defines MongoDB's
SNMP output.

- ``mongod.conf.subagent``:

The configuration file to run :program:`mongod` as the SNMP
subagent. This file sets SNMP run-time configuration options,
including the ``AgentX`` socket to connect to the SNMP master.

- ``mongod.conf.master``:

The configuration file to run :program:`mongod` as the SNMP
master. This file sets SNMP run-time configuration options.

Copy Configuration Files
~~~~~~~~~~~~~~~~~~~~~~~~

Ensure the ``/etc/snmp`` directory exists. From the installation
directory, copy the configuration files to the SNMP service
configuration directory:

.. code-block:: sh

cp MONGO-MIB.txt /usr/share/snmp/mibs/MONGO-MIB.txt
cp mongod.conf.subagent /etc/snmp/mongod.conf

Edit the new ``mongod.conf`` using instructions in that file, to
ensure that:

- The ``agentXAddress`` socket matches the ``agentXAddress`` in the
SNMP master configuration file. The configuration filename
is tool-dependent. For example, when using ``net-snmp`` the
configuration file is ``snmpd.conf``.

- SNMP uses TCP rather than UNIX Domain Sockets.

Start MongoDB
-------------

Start :program:`mongod` with the :option:`--snmp-subagent <mongod>` to send data
to the SNMP master.

.. code-block:: sh

mongod --snmp-subagent

Test SNMP
---------

Confirm Data Retrieval
~~~~~~~~~~~~~~~~~~~~~~

Connect an SNMP client to verify the ability to collect SNMP data
from MongoDB.

Install the `net-snmp <http://www.net-snmp.org/>`_ package to
access the snmpwalk client. ``net-snmp`` provides the ``snmpwalk``
SNMP client.

Use ``snmpwalk`` to collect data from :program:`mongod`:

.. code-block:: sh

snmpwalk -m /usr/share/snmp/mibs/MONGO-MIB -v 2c -c mongodb 127.0.0.1:<port> 1.3.6.1.4.1.34601

``<port>`` refers to the UDP port defined by the SNMP master,
*not* the :option:`--port <mongod --port>` argument used by :program:`mongod`.

Optional: Run as SNMP Master
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can run :program:`mongod` with the :option:`--snmp-master`
option for test purposes. To do this, use the SNMP master
configuration file instead of the subagent configuration file. From
the directory containing the unpacked MongoDB installation files:

.. code-block:: sh

cp mongod.conf.master /etc/snmp/mongod.conf

Loading