Merge ~brad-marshall/charm-openstack-service-checks/+git/charm-openstack-service-checks:nova-check-fixes into ~canonical-bootstack/charm-openstack-service-checks:master

Proposed by Brad Marshall
Status: Merged
Merged at revision: 3c9d8876f67ff8167fb310d988379eb10a7e6c25
Proposed branch: ~brad-marshall/charm-openstack-service-checks/+git/charm-openstack-service-checks:nova-check-fixes
Merge into: ~canonical-bootstack/charm-openstack-service-checks:master
Diff against target: 43 lines (+16/-2)
2 files modified
config.yaml (+10/-0)
reactive/service_checks.py (+6/-2)
Reviewer Review Type Date Requested Status
Marian Gasparovic (community) Approve
Review via email: mp+334084@code.launchpad.net

Description of the change

Allow tweaking of the warning and critical levels

To post a comment you must log in.
Revision history for this message
Marian Gasparovic (marosg) wrote :

All seems good to me.

review: Approve
Revision history for this message
James Hebden (ec0) wrote :

Minor nitpick - if you could update the config.yaml to include a statement such as -
"Setting this value to any negative number will effectively disable host aggregate checks"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index fbee527..3a8f508 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -7,6 +7,16 @@ options:
6 It is strongly recommended this be a user with a dedicated role,
7 and not a full admin. Takes the format of
8 username=foo, password=bar, credentials_project=baz, region_name=Region1, auth_url=http://127.0.0.1:35357
9+ nova_warn:
10+ default: 2
11+ type: int
12+ description: |
13+ Warning level for nova aggregate unit count check - setting this to -1 will effectively disable host aggregate checks.
14+ nova_crit:
15+ default: 1
16+ type: int
17+ description: |
18+ Critical level for nova aggregate unit count check - setting this to -1 will effectively disable host aggregate checks.
19 nagios_context:
20 default: "juju"
21 type: string
22diff --git a/reactive/service_checks.py b/reactive/service_checks.py
23index f22a164..29d4de7 100644
24--- a/reactive/service_checks.py
25+++ b/reactive/service_checks.py
26@@ -135,12 +135,16 @@ def render_checks():
27 options=['--executability']
28 )
29
30+ warn = config.get("nova_warn")
31+ crit = config.get("nova_crit")
32+
33 nrpe.add_check(shortname='nova_services',
34 description='Check that enabled Nova services are up',
35- check_cmd=plugins_dir+'check_nova_services.py')
36+ check_cmd=plugins_dir + 'check_nova_services.py --warn '
37+ + str(warn) + ' --crit ' + str(crit))
38 nrpe.add_check(shortname='neutron_agents',
39 description='Check that enabled Neutron agents are up',
40- check_cmd=plugins_dir+'check_neutron_agents.sh')
41+ check_cmd=plugins_dir + 'check_neutron_agents.sh')
42
43 nrpe.write()
44

Subscribers

People subscribed via source and target branches