SPM Agent for monitoring MongoDB
npm install spm-agent-mongodb
This is the MongoDB monitoring Agent for MongoDB Monitoring with Sematext Cloud.
1. Get a free Sematext account
2. Create a Monitoring App of type "MongoDB" and copy the App Token - or execute the commands displayed in the Sematext UI (which are described here as well)
3. Install Node.js on your MongoDB server
4. The MongoDB driver might need libkrb5-dev for Kerberos authentication (if you use Kerberos ...)
```
apt-get install libkrb5-dev`Setup
shInstall spm-agent-mongodb
npm i spm-agent-mongodb -g
Note that the monitoring agent requires admin rights to query the relevant tables. It should have ClusterAdmin role and read access to any DB.Configuration
The setup script will store your configuration in /etc/sematext/spm-agent-mongodb.config
If you want to change the settings later edit /etc/sematext/spm-agent-mongodb.config.
Then restart the Sematext MongoDB Agent after config changes, depending on the init system:
- Upstart (Ubuntu):
`
sudo service spm-agent-mongodb restart
`
- Systemd (Linux others):
`
sudo systemctl stop spm-agent-mongodb
sudo systemctl start spm-agent-mongodb
`
- Launchd (Mac OS X):
`
sudo launchctl stop com.sematext.spm-agent-mongodb
sudo launchctl stop com.sematext.spm-agent-mongodb
`For tests you can just run the agent from command line:
`
spm-agent-mongodb SPM_TOKEN MONGODB_URL
`Setup on Docker
The MongoDB agent is integrated in SPM-Client docker image.
The relevant SPM_CONFIG string ist:
`mongodb SPM_TOKEN MONGODB_URL`. Run SPM-Client, replace the App Token and MongoDB URL with your configuration:
`
docker run --name spm-client --restart=always -v /var/run/docker.sock:/var/run/docker.sock -e SPM_CONFIG="mongodb YOUR_SPM_MONGODB_TOKEN mongodb://mongodbUser:mogodbPassword@mongodb-server:port/database" sematext/spm-client
``Docker-Compose example with SPM-Client and MongoDB server: docker-compose.yml.
More Information:
- MongoDB monitoring integration
- Announcement blog post
- MongoDB reports video
- Twitter: @sematext
- Blog: blog.sematext.com
- Homepage: www.sematext.com