[Linux-ha-dev] [PATCH] SNMP subagent syslog fix
Dejan Muhamedagic
dejanmm at fastmail.fm
Tue Dec 11 05:25:37 MST 2007
Hi,
On Tue, Dec 11, 2007 at 08:26:52PM +0900, Keisuke MORI wrote:
> Hi,
>
> The attached patch fixes the SNMP subagent so that
> it obeys the syslog policy of heartbeat; 1) use logd if it's
> enabled. 2) the default syslog facility is taken from the
> configure option as well as lrmd, mgmtd, etc.
>
> The current SNMP subagent produces its logs always into LOG_USER
> which is hard-coded. This is not good.
>
> This patch can be applied solely
> (i.e. independent from the SNMP extention for V2),
> so please consider including this patch into 2.1.3.
Thanks for the patch. I can recall vaguely seeing the problem,
perhaps I even filed a bugzilla for it. Or something. My memory
isn't in the best shape today.
Cheers,
Dejan
>
> Regards,
>
> --
> Keisuke MORI
> NTT DATA Intellilink Corporation
Content-Description: snmp-syslog.patch
> diff -r 0890907b816f snmp_subagent/hbagent.c
> --- a/snmp_subagent/hbagent.c Tue Dec 11 01:10:53 2007 +0100
> +++ b/snmp_subagent/hbagent.c Tue Dec 11 17:08:47 2007 +0900
> @@ -562,7 +562,10 @@ init_heartbeat(void)
> hb = NULL;
>
> cl_log_set_entity("lha-snmpagent");
> - cl_log_set_facility(LOG_USER);
> + cl_log_set_facility(HA_LOG_FACILITY);
> +
> + /* Use logd if it's enabled by heartbeat */
> + cl_inherit_logging_environment(0);
>
> hb = ll_cluster_new("heartbeat");
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
More information about the Linux-HA-Dev
mailing list