Comment 2 for bug 2019799

Revision history for this message
Danny Cocks (dannycocks) wrote :

I don't think we should be doing without this. The hook adds 6 new NRPEs that are otherwise not included.

I found the problem was to do the mixing of args and kwargs in the add_check/remove_check commands. Rather than fixing the issue in the lib though, here's a simple fix that gets the hook working as intended (just changing inputs from a tuple to a dict):

        ring_check = dict(
            shortname='corosync_rings',
            description='Check Corosync rings {}'.format(hostname),
            check_cmd='check_corosync_rings',
        )
        if CompareHostReleases(get_distrib_codename()) < 'eoan':
            nrpe_setup.add_check(**ring_check)
        else:
            nrpe_setup.remove_check(**ring_check)