Back to Nagios

Nagios

Nagios Configuration for mongo plugin

Author

Anjani Phuyal

Date

May 26, 2014

Category

Nagios

Read Time

4 min read

Prerequisite:

Git installation on Ubuntu remote server.

  • $which git
  • $sudo apt-get install git-core
  • $which git
  • /usr/bin/git
  • $git –version
  • git version 1.7.0.4
  • git clone git://github.com/mzupan/nagios-plugin-mongodb.git

Python dependencies installation on remote server.

  • sudo pip install pymongo
  • sudo apt-get install python-pip
  • sudo pip install pymongo
  • service mongodb status
  • default mongo db port: 27017

DOWNLOAD MONGO PLUGIN: https://anjani.co.uk/downloads/nagios-plugins/nagios-plugin-mongodb.zip

check_nrpe uses tcp port 5666

netstat -aunt | grep 5666
netstat -napt | grep -i Listen
  • Add command[check_mongo]=/etc/nagios-plugins/config/nagios-plugin-mongodb/check_mongodb.py on remote server file /etc/nagios/nrpe.cfg

Configuration on Nagios-server

Define host

define host{
	use linux-server
	host_name mongo
	alias mongo
	address 54.228.208.102
}

Define Services

define service{
	use local-service
	host_name mongo
	service_description momgo-db
	check_command check_nrpe!check_mongo
}
#Nagios#MongoDB#Monitoring