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