Code Monkey home page Code Monkey logo

n2cw's Introduction

n2cw - Nagios to CloudWatch

n2cw is a wrapper for check scripts that implement the Nagios Plugin API. It runs the specified check command and pushes the results, optionally including metrics for all perfdata.

Installation

pip install n2cw

Usage

usage: n2cw [options] namespace base_name -- command

A wrapper for nagios-style checks that pushes check status and perfdata to
CloudWatch metrics.

positional arguments:
  namespace             CloudWatch namespace
  base_name             Base name for checks
  command               Command (nagios check) to run

optional arguments:
  -h, --help            show this help message and exit
  --dimensions key=value,key=value
                        CloudWatch metric dimensions
  --noop                Don't push metrics, just log
  --no-perfdata         Don't send metrics for performance data
  --no-status           Don't send the check status output

command is the full command line, with arguments, for the nagios plugin you wish to run.

Example

n2cw --dimensions "Host=webserver1" MySuperWebsite Disk -- ./check_disk -w 10% -c 5% -p / -k 

If the output of check_disk was ...

DISK OK - free space: / 7292772 kB (49% inode=88%);| /=7402636kB;15481742;15481741;0;15481840

The following metrics would be pushed to CloudWatch:

Namespace       Metric Name  Value    Dimensions
-----------------------------------------------------
MySuperWebsite  Disk-Status  0        Host=webserver1
MySuperWebsite  Disk-/       7292772  Host=webserver1

The value of the -Status metric is the check return code (so OK is 0, WARNING is 1, etc).

n2cw's People

Contributors

mwedgwood-rmn avatar

Watchers

 avatar  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.