On Thu, Aug 31, 2017 at 02:44:06PM -0000, Seyeong Kim wrote:
> I tried to deploy fresh simple ubuntu, nrpe, nagios charm ( relation is
> ubuntu, nrpe and nrpe:monitors, nagios:monitors)
>
> nagios has config-hooks error
>
> ERROR msg : global name 'self' is not defined
>
> which seems that caused from
>
> https://git.launchpad.net/nagios-
> charm/commit/?id=38f049516d4865a1e3c1fec5289f6f189fff0631
>
> + host_context = hookenv.config('nagios_host_context')
> + principal_unitname = hookenv.principal_unit()
> + # Fallback to using "primary" if it exists.
> + if not principal_unitname:
> + for relunit in self[self.name]:
> + if relunit.get('primary', 'False').lower() == 'true':
> + principal_unitname = relunit['__unit__']
> + break
>
> no error in your test env?
>
Can you provide the full traceback?
The code segment above is from the nrpe charm but you're reporting
config-changed in nagios itself?
On Thu, Aug 31, 2017 at 02:44:06PM -0000, Seyeong Kim wrote: /git.launchpad. net/nagios- ?id=38f049516d4 865a1e3c1fec528 9f6f189fff0631 config( 'nagios_ host_context' ) principal_ unit() get('primary' , 'False').lower() == 'true':
> I tried to deploy fresh simple ubuntu, nrpe, nagios charm ( relation is
> ubuntu, nrpe and nrpe:monitors, nagios:monitors)
>
> nagios has config-hooks error
>
> ERROR msg : global name 'self' is not defined
>
> which seems that caused from
>
> https:/
> charm/commit/
>
> + host_context = hookenv.
> + principal_unitname = hookenv.
> + # Fallback to using "primary" if it exists.
> + if not principal_unitname:
> + for relunit in self[self.name]:
> + if relunit.
> + principal_unitname = relunit['__unit__']
> + break
>
> no error in your test env?
>
Can you provide the full traceback?
The code segment above is from the nrpe charm but you're reporting
config-changed in nagios itself?