A wrapper for sending Nagios plugin output to CloudWatch
Project description
# n2cw - Nagios to CloudWatch
n2cw is a wrapper for check scripts that implement the
[Nagios Plugin API](http://nagios.sourceforge.net/docs/3_0/pluginapi.html). It
runs the specified check command and pushes the results, optionally including
metrics for all [perfdata](http://nagios.sourceforge.net/docs/3_0/perfdata.html).
## 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 is a wrapper for check scripts that implement the
[Nagios Plugin API](http://nagios.sourceforge.net/docs/3_0/pluginapi.html). It
runs the specified check command and pushes the results, optionally including
metrics for all [perfdata](http://nagios.sourceforge.net/docs/3_0/perfdata.html).
## 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).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
n2cw-0.1.2.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file n2cw-0.1.2.tar.gz
.
File metadata
- Download URL: n2cw-0.1.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83a0d1f887913ceb1d22870d3c9e5c6f41df7f4c99e13160ccd93a339221222d |
|
MD5 | 8623e1aaaf56dd93f9deda076e7b5d1c |
|
BLAKE2b-256 | 93303465909042e663d301d63831698dab299b2999e6993229a111c81e782859 |
File details
Details for the file n2cw-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: n2cw-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a52b412022644df6ebdcba9356f3ac07892c8b9064c5ba810c4142b48599453e |
|
MD5 | c1a7fbbe697a728ac7167e8641015194 |
|
BLAKE2b-256 | e15af0a33c68d6ada9cdf05deadd121ad7cd6c33d1f20d3bedc86a4dbedfd01b |