项目作者: bytemine

项目描述 :
icinga plugin api compatible check for CrashPlan Pro alerts
高级语言: Python
项目地址: git://github.com/bytemine/cpp-alert-check.git
创建时间: 2017-12-04T15:52:06Z
项目社区:https://github.com/bytemine/cpp-alert-check

开源协议:BSD 2-Clause "Simplified" License

下载


cpp-alert-check

About

Icinga check to read alerts from a crashplan pro server. it uses the
CrashPlan API to fetch alerts and uses the most recent one for status
(WARNING or CRITICAL) and message. Alerts can be acknowledged in the
CrashPlan administrator panel. If only acknowledged alerts are present,
the check will succeed with status OK.
If the check can’t read the data from the CrashPlan API, it will exit
with status UNKNOWN and print the message of the python exception.

Installation

Requirements

  • python 2.7
  • virtualenv has to be installed to generate the pex file or for manual setup.
    It usually is available for installation using packages of the distribution.

Setup

pex

To create a pex file, just run make pex/cpp_alert_check.pex. It will

  • create a virtualenv and install pex into it
  • use the installed pex to create a pex, which is dropped to ./pex/cpp_alert_check.pex

Manual setup

Put the contents of this directory somewhere, then run:

  1. virtualenv venv
  2. . venv/bin/activate
  3. pip install -r requirements.txt

This will install the python dependencies into the virtual environment.

Calling the check

To run the check, either use cpp_alert_check.pex which should work out of the box when
executed. if running with manual installation, this line should work:

  1. . venv/bin/activate && python -m cpp_alert_check.cpp_alert_check

Parameters









Parameter Description
-h, —help show this help message and exit
-V, —version display the version and exit
-l LOGIN, —login LOGIN username used for basic auth
-p PASSWORD, —password PASSWORDpassword used for basic auth
-u URL, —url URLbase url of the CrashPlan instance
—no-verifyignore invalid SSL certificate chains

Examples

If the CrashPlan instance is reachable at https://cpp.example.com:1234 a call
would look like this:

  1. ./cpp_alert_check.pex -u https://cpp.example.com:1234 -l username -p password

To accept “invalid” SSL certificate chains (for example self-signed) use the --no-verify switch:

  1. ./cpp-alert-check.pex -u https://cpp.example.com:1234 -l username -p password --no-verify