Giter Club home page Giter Club logo

mongomonitor's Introduction

Mongodb Status and Backup

This is a simple script that you can monitor a mongodb cluster. It expects to connect to 1 or more mongos routers.

It also comes with a backup script for your cronning delight.

Installation

Fairly straight forward, copy config.ini.example to config.ini and change the settings. There are no weird dependencies here, even mustache is embedded.

Dev'd and tested on Ubuntu 16.04 with php7.

Pro tip: Make your webserver not serve config.ini unless you like your passwords in the open. Use something like this in an .htaccess file:

<filesMatch "\.(ini)$">
	Order deny,allow
	Deny from all
</filesMatch>

If you are looking for what to do with mongodb permissions stuff, there's an example command in the config.ini.example file. When in doubt, run it on every primary node. Worst that can happen is you get an error.

###Usage Run the backup.php as a cronjob to mongodump your database.

monitor.php may take a while to complete since PHP is so serial. But you can just drop in the whole folder into apache and smoke it.

Normally, there aren't any errors and you're chilling happily at OK everywhere. If you get a 503, there's an error. The status page will show one of two new sections, an Error log section, and a Backup log section. If any host was unreachable or there were replica set problems (quite unlikely), you should see them there.

Individual mongodb nodes can fail and the cluster health will not drop. Seeing a replicaSetError is truly a big deal. Probably best to restore from backups and skip the crazy fixing.

mongomonitor's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.