Skip to content
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
20 changes: 20 additions & 0 deletions source/includes/fact-snmp-configuration-files.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. 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 |mongod-program| 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 |mongod-program| as the SNMP
master. This file sets SNMP run-time configuration options.
4 changes: 4 additions & 0 deletions source/includes/fact-snmp-run-mongodb-as-snmp-master.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
You can run |mongod-program| with the :setting:`snmp-master`
option for testing 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:
26 changes: 26 additions & 0 deletions source/includes/steps-monitor-with-snmp-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
stepnum: 1
source:
file: steps-monitor-with-snmp.yaml
ref: copy-config-files
ref: copy-config-files-windows
action:
language: powershell
code: |
md C:\snmp\etc\config
copy MONGO-MIB.txt C:\snmp\etc\config\MONGO-MIB.txt
copy mongod.conf.subagent C:\snmp\etc\config\mongod.conf
---
stepnum: 2
source:
file: steps-monitor-with-snmp.yaml
ref: start-with-snmp
ref: start-snmp-on-windows
action:
language: powershell
code: mongod.exe --snmp-subagent
---
stepnum: 3
source:
file: steps-monitor-with-snmp.yaml
ref: test-snmp
...
58 changes: 58 additions & 0 deletions source/includes/steps-monitor-with-snmp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
title: Copy Configuration Files
stepnum: 1
ref: copy-config-files
pre: |
Use the following sequence of commands to move the SNMP
configuration files to the SNMP service configuration directory.

First, create the SNMP configuration directory if needed and then, from
the installation directory, copy the configuration files to the SNMP
service configuration directory:
action:
language: sh
code: |
mkdir -p /etc/snmp/
cp MONGO-MIB.txt /usr/share/snmp/mibs/MONGO-MIB.txt
cp mongod.conf.subagent /etc/snmp/mongod.conf
post: |
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.
---
title: Start MongoDB
stepnum: 2
ref: start-with-snmp
pre: |
Start |mongod-program| with the :setting:`snmp-subagent` to send data
to the SNMP master.
action:
language: sh
code: mongod --snmp-subagent
---
title: Confirm SNMP Data Retrieval
stepnum: 3
ref: test-snmp
action:
pre: |
Use ``snmpwalk`` to collect data from |mongod-program|:

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.
language: sh
code: |
snmpwalk -m /usr/share/snmp/mibs/MONGO-MIB -v 2c -c mongodb 127.0.0.1:<port> 1.3.6.1.4.1.34601
post: |
``<port>`` refers to the port defined by the SNMP master,
*not* the primary :setting:`port` used by |mongod-program| for
client communication.
...
21 changes: 15 additions & 6 deletions source/includes/toc-administration-routine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ description: |
Collect data that introspects the performance of query and update
operations on a :program:`mongod` instance.
---
file: /tutorial/monitor-with-snmp
description: |
The SNMP extension, available in
MongoDB Enterprise, allows MongoDB to report
data into SNMP traps.
---
file: /tutorial/rotate-log-files
description: |
Archive the current log files and start new ones.
Expand All @@ -42,6 +36,21 @@ description: |
Introduces the basic process for upgrading a MongoDB deployment
between different minor release versions.
---
file: /tutorial/monitor-with-snmp
description: |
The SNMP extension, available in MongoDB Enterprise, allows MongoDB
to report data into SNMP traps.
---
file: /tutorial/monitor-with-snmp-on-windows
description: |
The SNMP extension, available in the Windows build of MongoDB
Enterprise, allows MongoDB to report data into SNMP traps.
---
file: /tutorial/troubleshoot-snmp
description: |
Outlines common errors and diagnostic processes useful for deploying
MongoDB Enterprise with SNMP support.
---
file: /tutorial
description: |
A complete list of tutorials in the MongoDB Manual that address
Expand Down
51 changes: 51 additions & 0 deletions source/tutorial/monitor-with-snmp-on-windows.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
=================================
Monitor MongoDB Windows with SNMP
=================================

.. default-domain:: mongodb

.. 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.

.. |mongod-program| replace:: :program:`mongod.exe`

.. |copy-command| replace:: copy mongod.conf.master C:\snmp\etc\config\mongod.conf

Overview
--------

MongoDB Enterprise can report system information into SNMP traps, to
support centralized data collection and aggregation. This procedure
explains the setup and configuration of a |mongod-program| instance
as an SNMP subagent, as well as initializing and testing of SNMP
support with MongoDB Enterprise.

.. seealso:: :doc:`/tutorial/monitor-with-snmp-on-windows` and
:doc:`/tutorial/troubleshoot-snmp` for more information.

Configuration Files
-------------------

.. include:: /includes/fact-snmp-configuration-files.rst

Procedure
---------

.. include:: /includes/steps/monitor-with-snmp-windows.rst

Optional: Run MongoDB as SNMP Master
------------------------------------

.. include:: /includes/fact-snmp-run-mongodb-as-snmp-master.rst

.. code-block:: powershell

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