Abakus Status Checks
Project description
Abakus Status Checks
====================
.. image:: https://ci.frigg.io/eirsyl/abakus-status-checks.svg
:target: https://ci.frigg.io/eirsyl/abakus-status-checks/last/
:alt: Build Status
.. image:: https://ci.frigg.io/eirsyl/abakus-status-checks/coverage.svg
:target: https://ci.frigg.io/eirsyl/abakus-status-checks/last/
:alt: Coverage Status
This package is used together with Sensu_. Checks is managed with Puppet and reported to our #devops
channel on Slack.
Supported checks:
- CPU percent
- Load
Create a new check
------------------
- Create a new file in the abakus_checks/checks directory
- Import abakus_checks.utils.check.StatusCheck and use this as a base for your check.
- Give the check a name, decription and options
::
name = 'load'
description = 'Trigger errors based on load threshold. Load is divided by core count.'
options = [
click.option('--warning', default='2,1.5,1', type=str),
click.option('--critical', default='3,2,1.5', type=str),
]
- Implement the run method. Call self.ok, self.warning, self.critical with a message based on the
result.
- Register the check in abakus_checks/cli.py. Import the check in the check import block and
register the check.
::
from .checks import load
register_check(load.LoadCheck)
- You can use the tests.test_case.CLITestCase to test the check. This TestCase has a .invoke
method you can use to call the check.
::
class LoadCheckTestCase(CLITestCase):
@mock.patch('os.getloadavg', return_value=(0, 0, 0))
def test_load_ok(self, mock_loadavg):
result = self.invoke(['load', '--warning /'3.2.1/''])
self.assertEquals(result.exit_code, 0)
.. _Sensu: https://sensuapp.org/
====================
.. image:: https://ci.frigg.io/eirsyl/abakus-status-checks.svg
:target: https://ci.frigg.io/eirsyl/abakus-status-checks/last/
:alt: Build Status
.. image:: https://ci.frigg.io/eirsyl/abakus-status-checks/coverage.svg
:target: https://ci.frigg.io/eirsyl/abakus-status-checks/last/
:alt: Coverage Status
This package is used together with Sensu_. Checks is managed with Puppet and reported to our #devops
channel on Slack.
Supported checks:
- CPU percent
- Load
Create a new check
------------------
- Create a new file in the abakus_checks/checks directory
- Import abakus_checks.utils.check.StatusCheck and use this as a base for your check.
- Give the check a name, decription and options
::
name = 'load'
description = 'Trigger errors based on load threshold. Load is divided by core count.'
options = [
click.option('--warning', default='2,1.5,1', type=str),
click.option('--critical', default='3,2,1.5', type=str),
]
- Implement the run method. Call self.ok, self.warning, self.critical with a message based on the
result.
- Register the check in abakus_checks/cli.py. Import the check in the check import block and
register the check.
::
from .checks import load
register_check(load.LoadCheck)
- You can use the tests.test_case.CLITestCase to test the check. This TestCase has a .invoke
method you can use to call the check.
::
class LoadCheckTestCase(CLITestCase):
@mock.patch('os.getloadavg', return_value=(0, 0, 0))
def test_load_ok(self, mock_loadavg):
result = self.invoke(['load', '--warning /'3.2.1/''])
self.assertEquals(result.exit_code, 0)
.. _Sensu: https://sensuapp.org/
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
Built Distribution
Close
Hashes for abakus-status-checks-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a4b6e5c9fc2315ad49dacd18f2b426915e21320786bd3367cccaf2cc29d7a25 |
|
MD5 | de2c70b555a2599f7bc145e4b9329ecc |
|
BLAKE2b-256 | c1edb23e0bfa195759e1f136b35b1014a9926707b2d68f1d5ebf5a0d7f921756 |
Close
Hashes for abakus_status_checks-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80c8a4bf7b610acaebdb76d4a8f6ef4f488282b728f6b9ab86bf8a4ffc9fc0c1 |
|
MD5 | c25a4b40e846f08ab359216e37b920f8 |
|
BLAKE2b-256 | 58e1f689116be8936ab47998e1fbf1e87b26472e155b261f542e100f870247e4 |