NRPE check incorrectly passes string instead of list

Bug #1643855 reported by Adam Collard
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Server
Fix Released
High
Adam Collard
percona-cluster (Juju Charms Collection)
Fix Released
High
Adam Collard

Bug Description

Snippet from hooks/nrpe-external-master-relation-changed in percona-cluster rev 246

@hooks.hook('nrpe-external-master-relation-joined',
            'nrpe-external-master-relation-changed')
def update_nrpe_config():
    # python-dbus is used by check_upstart_job
    apt_install('python-dbus')
    hostname = nrpe.get_nagios_hostname()
    current_unit = nrpe.get_nagios_unit_name()
    nrpe_setup = nrpe.NRPE(hostname=hostname)
    nrpe.add_init_service_checks(nrpe_setup, 'mysql', current_unit)
    nrpe_setup.add_check(
        shortname='mysql_proc',
        description='Check MySQL process {%s}' % current_unit,
        check_cmd='check_procs -c 1:1 -C mysqld'
    )
    nrpe_setup.write()

Note that 'mysql' is passed into nrpe.add_init_service_checks() but that function takes a list.

I end up with a nagios complaining about missing services 'l', 'm', 'q', 's' and 'y': http://imgur.com/a/CILDQ

It should be a list a la ['mysql'] instead.

Changed in percona-cluster (Juju Charms Collection):
assignee: nobody → Adam Collard (adam-collard)
Revision history for this message
Adam Collard (adam-collard) wrote :

Added landscape task for update to charm revision.

Changed in percona-cluster (Juju Charms Collection):
status: New → In Progress
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-percona-cluster (master)

Fix proposed to branch: master
Review: https://review.openstack.org/401270

David Britton (dpb)
Changed in landscape:
milestone: none → 16.11
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-percona-cluster (master)

Reviewed: https://review.openstack.org/401270
Committed: https://git.openstack.org/cgit/openstack/charm-percona-cluster/commit/?id=d367494fbee3b27c93f1293e3dcddd47f7b21c7b
Submitter: Jenkins
Branch: master

commit d367494fbee3b27c93f1293e3dcddd47f7b21c7b
Author: Adam Collard <email address hidden>
Date: Wed Nov 23 12:14:24 2016 +0000

    NRPE services is a list not a string

    Pass charm-helpers' nrpe.add_init_service_checks() a list of services
    as its second argument, instead of a string.

    Additionally adjust amulet tests to configure hacluster's cluster_count
    when > 1 unit is configured.

    Change-Id: Ib48a31e17c1e8d8c68e774b64fcf52c0ee99bef5
    Closes-Bug: 1643855

Changed in percona-cluster (Juju Charms Collection):
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-percona-cluster (stable/16.10)

Fix proposed to branch: stable/16.10
Review: https://review.openstack.org/403814

Changed in percona-cluster (Juju Charms Collection):
milestone: none → 17.01
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-percona-cluster (stable/16.10)

Reviewed: https://review.openstack.org/403814
Committed: https://git.openstack.org/cgit/openstack/charm-percona-cluster/commit/?id=1d7aa4eb3afd8902ed86cfa6ed08d5c09e8c28b8
Submitter: Jenkins
Branch: stable/16.10

commit 1d7aa4eb3afd8902ed86cfa6ed08d5c09e8c28b8
Author: Adam Collard <email address hidden>
Date: Wed Nov 23 12:14:24 2016 +0000

    NRPE services is a list not a string

    Pass charm-helpers' nrpe.add_init_service_checks() a list of services
    as its second argument, instead of a string.

    Additionally adjust amulet tests to configure hacluster's cluster_count
    when > 1 unit is configured.

    Change-Id: Ib48a31e17c1e8d8c68e774b64fcf52c0ee99bef5
    Closes-Bug: 1643855
    (cherry picked from commit d367494fbee3b27c93f1293e3dcddd47f7b21c7b)

Revision history for this message
Adam Collard (adam-collard) wrote :

 cs:~openstack-charmers/percona-cluster-247

Changed in landscape:
status: New → Fix Committed
assignee: nobody → Adam Collard (adam-collard)
Changed in percona-cluster (Juju Charms Collection):
status: Fix Committed → Fix Released
Revision history for this message
Ursula Junque (ursinha) wrote :

Tested landscape r10759, nagios shows "mysql.service" missing, as it should (unit is blocked, it's reporting the issue accordingly).

tags: added: qa-ok
Changed in landscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.