Merge lp://staging/~pedronis/charms/trusty/apache2/nagios_extra_check_https into lp://staging/charms/trusty/apache2

Proposed by Samuele Pedroni
Status: Work in progress
Proposed branch: lp://staging/~pedronis/charms/trusty/apache2/nagios_extra_check_https
Merge into: lp://staging/charms/trusty/apache2
Prerequisite: lp://staging/~verterok/charms/trusty/apache2/nagios_servicegroups
Diff against target: 85 lines (+50/-1)
3 files modified
config.yaml (+13/-0)
hooks/hooks.py (+9/-0)
hooks/tests/test_nrpe_hooks.py (+28/-1)
To merge this branch: bzr merge lp://staging/~pedronis/charms/trusty/apache2/nagios_extra_check_https
Reviewer Review Type Date Requested Status
Matt Bruzek (community) Needs Fixing
Review via email: mp+270368@code.staging.launchpad.net

Commit message

support new config nagios_extra_http_checks to specify extra nrpe check_http checks, useful when fronting more than one backend

Description of the change

support new config nagios_extra_http_checks to specify extra nrpe check_http checks, useful when fronting more than one backend

To post a comment you must log in.
Revision history for this message
Matt Bruzek (mbruzek) wrote :

Hello Samuele,

Thank you for the submission of this change to the apache2 charm. Passing extra parameters to the Nagios http_checks can help build better monitoring for this charm.

I deployed a charm with your changes and they seemed to work on manual testing but I did not know how to use the new configuration option (even after I read config.yaml). I suspect users would have the same questions and problems. It would be great to add a section to the readme so other users know how to use this new configuration option. Perhaps give a real example of flags that you could set and the juju commands to set them. For example I tried the following commands:

juju set apache2 nagios_extra_http_checks="- name: test1
  params: -H localhost
- name: test2
  params: -w 1 -c 2 -H localhost
- name: test3
  params: -I 127.0.0.1
- name: test4
  params: -E -H localhost"
juju set apache2 nagios_extra_http_checks=””

The automated tests did not pass for this charm. The readme indicates that some additional packages are required for testing this charm. That is precisely what the tests/00-setup script is for. You install the packages needed for the testing of the charm. Even after I installed those packages the amulet tests failed. It would be great if you could take a look at these tests and update them so this charm passes automated testing. This would really help the charm's overall quality.

The automated testing uses the bundletester tool which can be pip installed:
https://github.com/juju-solutions/bundletester

You can run the bundletester from the charm directory. I ran the command like this:
bundletester -F -e amazon -l DEBUG -v

I am going to put this proposal in “Work in progress”, please put it back in “Needs review” when you have added more information in the readme for the new configuration option you are adding, and hopefully have fixed the tests to run. Thanks for your effort here. If you have any other questions please feel free to contact me in #juju or on the Juju mailing list.

review: Needs Fixing
Revision history for this message
Matt Bruzek (mbruzek) wrote :
Download full text (3.5 KiB)

Samuele,

I took the time to propose a merge against this branch of code with *some* of the suggestions that I made in the review. Please review my merge proposal.

lp:~mbruzek/charms/trusty/apache2/nagios_extra_check_https

This proposal fixes some of the amulet problems but does not address the failing amulet tests.

The failing tests are listed below:
======================================================================
ERROR: tests.test_vhost_config_relation.CreateVhostTest.test_create_vhost_missing_template
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/ubuntu/trusty/apache2/.venv/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/tmp/bundletester-JYI8cM/apache2/hooks/tests/test_vhost_config_relation.py", line 37, in test_create_vhost_missing_template
    mock_close_port.assert_called_once()
  File "/home/ubuntu/trusty/apache2/.venv/local/lib/python2.7/site-packages/mock/mock.py", line 721, in __getattr__
    raise AttributeError(name)
AttributeError: assert_called_once

======================================================================
ERROR: tests.test_vhost_config_relation.CreateVhostTest.test_create_vhost_template_directly
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/ubuntu/trusty/apache2/.venv/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/tmp/bundletester-JYI8cM/apache2/hooks/tests/test_vhost_config_relation.py", line 114, in test_create_vhost_template_directly
    mock_open_port.assert_called_once()
  File "/home/ubuntu/trusty/apache2/.venv/local/lib/python2.7/site-packages/mock/mock.py", line 721, in __getattr__
    raise AttributeError(name)
AttributeError: assert_called_once

======================================================================
ERROR: tests.test_vhost_config_relation.CreateVhostTest.test_create_vhost_template_through_config_no_protocol
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/ubuntu/trusty/apache2/.venv/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/tmp/bundletester-JYI8cM/apache2/hooks/tests/test_vhost_config_relation.py", line 62, in test_create_vhost_template_through_config_no_protocol
    mock_open_port.assert_called_once()
  File "/home/ubuntu/trusty/apache2/.venv/local/lib/python2.7/site-packages/mock/mock.py", line 721, in __getattr__
    raise AttributeError(name)
AttributeError: assert_called_once

======================================================================
ERROR: tests.test_vhost_config_relation.CreateVhostTest.test_create_vhost_template_through_config_with_protocol
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/ubuntu/trusty/apache2/.venv/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    r...

Read more...

Unmerged revisions

69. By Samuele Pedroni

the spelling was confusing, rename

68. By Samuele Pedroni

support new config nagios_extra_check_https to specify extra nrpe check_http checks, useful when fronting more than one backend

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: