Giter Club home page Giter Club logo

check_couchdb_replication's Introduction

check_couchdb_replication's People

Contributors

maethor avatar napsty avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

check_couchdb_replication's Issues

CRITICAL alert "unable to authenticate" is confusing

When a replication has failed, the plugin's current output is confusing:

$ ./check_couchdb_replication.sh -H localhost -u admin -p secret -r claudioreptest
COUCHDB REPLICATION CRITICAL - Unable to authenticate user admin

This happens because the plugin checks the http response for "unauthorized", trying to identify if user and password credentials to access CouchDB were correct:

  cdbresp=$(curl -k -s $cdburl)

  if [[ -n $(echo $cdbresp | grep -i unauthorized) ]]; then
    echo "COUCHDB REPLICATION CRITICAL - Unable to authenticate user $user"
    exit $STATE_CRITICAL
  fi

But if a replication fails because within the replication wrong credentials were used, the following info is shown in the _replicator database:

{"database":"_replicator","doc_id":"claudioreptest","id":"c7d010d31ab268968f22f4d71c5766bf+continuous+create_target","node":"[email protected]","source":"http://admin:*****@localhost:5984/db1/","target":"https://remoteuser:*****@remotecouch.example.com/db1/","state":"crashing","info":"unauthorized: unauthorized to access or create database http://admin:*****@localhost:5984/db1/","error_count":7,"last_updated":"2018-03-26T07:07:24Z","start_time":"2018-03-26T06:30:23Z","proxy":null} ]]

Need to separate this.

Plugin alerts on one-time replication (non continuous replication)

When a user creates a one-time replication (not a continuous replication), the plugin alerts when this replication is completed:

COUCHDB REPLICATION CRITICAL - 1 replications not running ("doc_id":"d0aacd8dc4068db931fff88557b115a2" "error_count":0 "info":{"revisions_checked":4700,)

The replication document looks like this:

{
  "_id": "d0aacd8dc4068db931fff88557b115a2",
  "_rev": "2-a27dc87bc178c97e50ca27e6b59b66d9",
  "user_ctx": {
    "name": "sofaadmin",
    "roles": [
      "_admin",
      "_reader",
      "_writer"
    ]
  },
  "source": {
    "url": "http://localhost:5984/et-geodata",
    "headers": {
      "Authorization": "Basic c29mYWFkbWluOk9DR3NvS1haNA=="
    }
  },
  "target": {
    "url": "http://localhost:5984/et-geodata-old",
    "headers": {
      "Authorization": "Basic c29mYWFkbWluOk9DR3NvS1haNA=="
    }
  },
  "create_target": true,
  "continuous": false,
  "owner": "sofaadmin",
  "_replication_state": "completed",
  "_replication_state_time": "2020-01-15T10:13:46Z",
  "_replication_stats": {
    "revisions_checked": 4700,
    "missing_revisions_found": 4700,
    "docs_read": 4700,
    "docs_written": 4700,
    "changes_pending": null,
    "doc_write_failures": 0,
    "checkpointed_source_seq": "4729-g1AAAAJ7eJydz10KwjAMAOCigr7uBOoFpH-z3ZO7gGeYS1sZY84nn_UmehO9id6kdu1gCEPYCCQkIR-kQggtiqlGkTpfVKEhJVRssAtSudUkR7C01pbFFFy3P7nZnLGEMar6bv5IsHIZdh1WemwrVCy1GIqlDZZ1WOQxUFQmRz0UOzTYtcPWASOcCY0HYvXMZXRzxXn3Fsw8SDgxFJtR4COAzxbUHswJNkTKUeArgO8WrD1odGyoglHgJ4D252UNHCQnfaflF2v2oW0",
    "start_time": "2020-01-15T10:13:34Z"
  }
}

Relevant here: "continuous": false,

The plugin should not alert on a replication which has "continuous": false, in its replication settings.

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.