- Administration >
- Administration Tutorials >
- Configuration, Maintenance, and Analysis >
- Monitor MongoDB with SNMP
Monitor MongoDB with SNMP¶
New in version 2.2.
Enterprise Feature
This feature is only available in MongoDB Enterprise.
This document outlines the use and operation of MongoDB’s SNMP extension, which is only available in MongoDB Enterprise.
Prerequisites¶
Install MongoDB Enterprise¶
MongoDB Enterprise
Included Files¶
The Enterprise packages contain the following files:
MONGO-MIB.txt
:The
MIB
file that describes the data (i.e. schema) for MongoDB’s SNMP outputmongod.conf
:The SNMP configuration file for reading the SNMP output of MongoDB. The SNMP configures the community names, permissions, access controls, etc.
Required Packages¶
To use SNMP, you must install several prerequisites. The names of the packages vary by distribution and are as follows:
Ubuntu 11.04 requires
libssl0.9.8
,snmp-mibs-downloader
,snmp
, andsnmpd
. Issue a command such as the following to install these packages:Red Hat Enterprise Linux 6.x series and Amazon Linux AMI require
libssl
,net-snmp
,net-snmp-libs
, andnet-snmp-utils
. Issue a command such as the following to install these packages:SUSE Enterprise Linux requires
libopenssl0_9_8
,libsnmp15
,slessp1-libsnmp15
, andsnmp-mibs
. Issue a command such as the following to install these packages:
Configure SNMP¶
Install MIB Configuration Files¶
Ensure that the MIB directory /usr/share/snmp/mibs
exists. If
not, issue the following command:
Use the following command to create a symbolic link:
Replace [/path/to/mongodb/distribution/]
with the path to your
MONGO-MIB.txt
configuration file.
Copy the mongod.conf
file into the /etc/snmp
directory
with the following command:
Start Up¶
You can control MongoDB Enterprise using default or custom control
scripts, just as with any other mongod
:
Use the following command to view all SNMP options available in your MongoDB:
The above command should return the following output:
Ensure that the following directories exist:
/data/db/
(This is the path where MongoDB stores the data files.)/var/log/mongodb/
(This is the path where MongoDB writes the log output.)
If they do not, issue the following command:
Start the mongod
instance with the following command:
Optionally, you can set these options in a configuration file.
To check if mongod
is running with SNMP support, issue the
following command:
The command should return output that includes the following
line. This indicates that the proper mongod
instance is running:
Test SNMP¶
Check for the snmp agent process listening on port 1161
with the
following command:
which return the following output:
Similarly, this command:
should return the following output:
Run snmpwalk
Locally¶
snmpwalk
provides tools for retrieving and parsing the SNMP data
according to the MIB. If you installed all of the required packages
above, your system will have snmpwalk
.
Issue the following command to collect data from mongod
using
SNMP:
You may also choose to specify the path to the MIB file:
Use this command only to ensure that you can retrieve and validate SNMP data from MongoDB.