Skip to main content

Monitoring: SNMP Support

Simple Network Management Protocol (SNMP) is an Internet-standard protocol for collecting and organizing information about managed devices on IP networks. It is used primarily for monitoring network services. SNMP exposes management data in the form of variables (metrics) which describe the system status and configuration. These metrics can then be remotely queried (and, in some circumstances, manipulated) by managing applications.

In RavenDB we have support for SNMP which allows monitoring tools like Zabbix, PRTG and Datadog direct access to the internal details of RavenDB. We expose a long list of metrics: CPU and memory usage, server total requests, the loaded databases, and also database specific metrics like the number of indexed items per second, document writes per second, storage space each database takes, and so on.

You can still monitor what is going on with RavenDB directly from the Studio, or by using one of our monitoring tools. However, using SNMP might be easier in some cases. As users start running large numbers of RavenDB instances, it becomes unpractical to deal with each of them individually and using a monitoring system that can watch many servers is advisable.

SNMP support is available for enterprise licenses only.

Enabling SNMP in RavenDB

RavenDB is already configured to support SNMP. All you have to do is enable it and restart the server. This is done by adding the following key to your settings.json file:

{
...
"Monitoring.Snmp.Enabled": true
...
}

There are two configurable SNMP properties in RavenDB: the SNMP port and the community string.
The default community string is "ravendb" and the default port is 161. You can change those with the following configuration keys:

{
...
"Monitoring.Snmp.Port": 12345,
"Monitoring.Snmp.Community": "YourString"
...
}

The community string is used like a password. It is sent with each SNMP Get request and allows or denies access to the monitored device.

The Metrics

It is usually easy to query the exposed metrics using a monitoring tool. (Example).
However, you should also be able to access those directly using any SNMP agent like Net-SNMP.

The most basic SNMP commands are snmpget, snmpset and snmptrapd (Read more).

Each metric has a unique identifier (OID) and can be accessed individually.
For example, using the SNMP agent you could run the following snmpget command which gets the server up time metric:

snmpget -v 2c -c ravendb live-test.ravendb.net 1.3.6.1.4.1.45751.1.1.1.1.1
snmpget -v 3 -l authNoPriv -u ravendb -a SHA -A ravendb live-test.ravendb.net 1.3.6.1.4.1.45751.1.1.1.2

Where "ravendb" is the community string and "live-test.ravendb.net" is the host.

ml054@MARCIN-WIN:~$ snmpget -v 2c -c ravendb live-test.ravendb.net 1.3.6.1.4.1.45751.1.1.1.1.1
iso.3.6.1.4.1.45751.1.1.1.1.1 = STRING: "http://bf7631445baf:8080"

For your convenience we've also added the list of metrics and their associated OIDs here:

You can list all OIDs along with its description using {serverUrl}/monitoring/snmp/oids endpoint.

RavenDB's root OID id: 1.3.6.1.4.1.45751.1.1.

OIDMetric
1.1.Server
1.1.1Server URL
1.1.2Server Public URL
1.1.3Server TCP URL
1.1.4Server Public TCP URL
1.2.1Server version
1.2.2Server full version
1.3Server up-time
1.4Server process ID
1.5.1Process CPU usage in %
1.5.2Machine CPU usage in %
1.6.1Server allocated memory in MB
1.7.1Number of concurrent requests
1.7.2Total number of requests since server startup
1.7.3Number of requests per second (one minute rate)
1.8Server last request time
1.9.1Server license type
1.9.2Server license expiration date
1.9.3Server license expiration left
3.1.1Current node tag
3.1.2Current node state
3.2.1Cluster term
3.2.2Cluster index
3.2.3Cluster ID
5.1.1Number of all databases
5.1.2Number of loaded databases
5.2.X.1.1Database name
5.2.X.1.2Number of indexes
5.2.X.1.3Number of stale indexes
5.2.X.1.4Number of documents
5.2.X.1.5Number of revision documents
5.2.X.1.6Number of attachments
5.2.X.1.7Number of unique attachments
5.2.X.1.10Number of alerts
5.2.X.1.11Database ID
5.2.X.1.12Database up-time
5.2.X.1.14Number of rehabs
5.2.X.1.13Indicates if database is loaded
5.2.X.2.1Documents storage allocated size in MB
5.2.X.2.2Documents storage used size in MB
5.2.X.2.3Index storage allocated size in MB
5.2.X.2.4Index storage used size in MB
5.2.X.2.5Total storage size in MB
5.2.X.2.6Remaining storage disk space in MB
5.2.X.3.1Number of document puts per second (one minute rate)
5.2.X.3.2Number of indexed documents per second for map indexes (one minute rate)
5.2.X.3.3Number of maps per second for map-reduce indexes (one minute rate)
5.2.X.3.4Number of reduces per second for map-reduce indexes (one minute rate)
5.2.X.3.5Number of requests per second (one minute rate)
5.2.X.3.6Number of requests from database start
5.2.X.5.1Number of indexes
5.2.X.5.2Number of static indexes
5.2.X.5.3Number of auto indexes
5.2.X.5.4Number of idle indexes
5.2.X.5.5Number of disabled indexes
5.2.X.5.6Number of error indexes
5.2.X.4.Y.1Indicates if index exists
5.2.X.4.Y.2Index name
5.2.X.4.Y.4Index priority
5.2.X.4.Y.5Index state
5.2.X.4.Y.6Number of index errors
5.2.X.4.Y.7Last query time
5.2.X.4.Y.8Index indexing time
5.2.X.4.Y.9Time since last query
5.2.X.4.Y.10Time since last indexing
5.2.X.4.Y.11Index lock mode
5.2.X.4.Y.12Indicates if index is invalid
5.2.X.4.Y.13Index status
5.2.X.4.Y.14Number of maps per second (one minute rate)
5.2.X.4.Y.15Number of reduces per second (one minute rate)

Templates

For easier setup we have prepared a few templates for monitoring tools which can be found here.
These templates include the metrics and their associated OIDs.