Home Directory Plugins Cloud check_CloudEndure_replication.py

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_CloudEndure_replication.py

Rating
0 votes
Favoured:
1
Current Version
2016-02-02
Last Release Date
2016-02-02
Compatible With
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
Owner
License
MIT
Hits
6153
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This Python 2 script is a Nagios plugin which will query the CloudEndure API for the replication / sync status of a host. (CloudEndure is a server-replication provider, allowing migration and/or DR.) https://www.cloudendure.com/

Disclaimer: I have no affiliation with CloudEndure; my employer is a customer of CloudEndure.

Tested under Nagios Core 4.0.8 and Python 2.6.6 & 2.7.10.

Python libraries used: urllib, httplib, json, re, sys, argparse, time, calendar, math, datetime

Updated 2016-02-02: Add close() after each use of the httplib.HTTPSConnection()
========================================================

usage: check_CloudEndure_replication.py [-h] [-v] -u USERNAME -p PASSWORD [-n HOSTNAME]

Nagios check of the sync status of CloudEndure replication.

Exit status 0 == OK, 1 == Warning, 2 == Critical, 3 == Unknown.

arguments:
-h, --help show this help message and exit
-v, --verbose increase output verbosity
-u USERNAME, --username USERNAME
user name for the CloudEndure account - required
-p PASSWORD, --password PASSWORD
password for the CloudEndure account - required
-n HOSTNAME, --hostname HOSTNAME
hostname of instance to check, or "all" (defaults to
"all" if not specified)

Required inputs: CloudEndure username and password.

Optional inputs: A host name (expected to be FQDN, but not manditory) to check

Outputs: One line of text containing the explanation of the replication status. Note that this will be one line no matter how many hosts are found (in the case of "all")

Exit status: 0, 1, 2, 3 as standard Nagios status codes.



Examples of output:

server3.mydomain.net last update 2016-01-16 13:30:36, 1 second ago

server5.mydomain.net last update 2016-01-16 13:24:56, 5 minutes, 7 seconds ago

server1.mydomain.net has not had an update since 2015-12-01 10:39:29, 46 days, 2 hours, 50 minutes, 16 seconds ago