nrpe.NRPE.write doesn't support multiple writes (previous checks will be lost for nagios)

Bug #1821602 reported by Alvaro Uria
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
New
Undecided
Unassigned

Bug Description

Per [1], checks will be configured in /etc/nagios/nrpe.d/check_SHORTNAME.cfg, but they will only be shared with Nagios (via the monitors interface) if all checks are added before nrpe_setup.write().

1) Sample 1 (works fine):
"""
nrpe_setup = nrpe.NRPE()
nrpe_setup.add_check(shortname='test1', description='test1 desc', check_cmd='check_test.py')
nrpe_setup.add_check(shortname='test2', description='test2 desc', check_cmd='check_test.py')
nrpe_setup.write()
"""

2) Sample 2 (only test2 will be configured in nagios):
"""
def func(name):
    nrpe_setup = nrpe.NRPE()
    nrpe_setup.add_check(shortname=name, description='test desc', check_cmd='check_test.py')
    nrpe_setup.write()

func('test1')
func('test2')
"""

I think the NRPE class should support a "clear" method or already existing checks should be kept.

OTOH: nrpe-external-master interface [2] doesn't support such relation data.

1. https://github.com/juju/charm-helpers/blob/master/charmhelpers/contrib/charmsupport/nrpe.py#L285
2. https://github.com/cmars/nrpe-external-master-interface/blob/master/provides.py

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.