problem setting up contact
Andy Kriger
andy.kriger at gmail.com
Tue Aug 9 22:04:48 CEST 2005
Accidentally sent that last mail to Marc only but he followed up with me...
Line 2409 in objects.c is --
#ifdef DEBUG1
printf("\tContact Name:
%s\n",new_contact->name);
printf("\tContact Alias:
%s\n",new_contact->alias);
printf("\tContact Email Address:
%s\n",new_contact->email);
---> printf("\tContact Pager Address/Number:
%s\n",new_contact->pager);
printf("\tSvc Notification Time Period:
%s\n",new_contact->service_notification_period);
printf("\tHost Notification Time Period:
%s\n",new_contact->host_notification_period);
#endif
It would appear to my laypersons eyes that printf is having difficulty
with the NULL value for new_contact->pager. I would also hazard that if
you compile nagios without the debug flags you might not see this issue
since that line is only called when DEBUG1 is enabled (oh the irony).
----
Setting a pager value eliminated the segfault.
So to sum-up, if you compile with DEBUG you need to set an email and
pager (even though they are not technically required) to avoid a
segfault from the debug info.
On 8/9/05, Andy Kriger <andy.kriger at gmail.com> wrote:
> Here's the contact info...
>
> define contact{
> contact_name nagios
> alias Nagios Admin
> host_notification_period 24x7
> service_notification_period 24x7
> host_notification_options n
> service_notification_options n
> email andy.kriger at gmail.com
> }
>
> define contactgroup{
> contactgroup_name admins
> alias Nagios Administrators
> members nagios
> }
>
> Here's the relevant part of the full debug output from running nagios
> -v nagios.cfg...
>
> add_contact() start
> find_contact() start
> Contact Name: nagios
> Contact Alias: Nagios Admin
> Contact Email Address: andy.kriger at gmail.com
> Segmentation Fault (core dumped)
>
> Here's the stacktrace from gdb...
>
> #0 0xff2344e4 in strlen () from /usr/lib/libc.so.1
> #1 0xff286c30 in _doprnt () from /usr/lib/libc.so.1
> #2 0xff2887f0 in printf () from /usr/lib/libc.so.1
> #3 0x00041ec4 in add_contact (name=0xff2bfdf8 "", alias=0x0,
> email=0x0, pager=0x0,
> addresses=0x0, svc_notification_period=0x8cc00 "",
> host_notification_period=0x8ce20 "",
> notify_service_ok=50, notify_service_critical=4,
> notify_service_warning=577056,
> notify_service_unknown=-13879868, notify_service_flapping=1,
> notify_host_up=577040,
> notify_host_down=0, notify_host_unreachable=0, notify_host_flapping=576512)
> at ../common/objects.c:2409
>
> It looks like the alias and email are not being passed to add_contact
> correctly (not sure why though).
>
> I can provide more info as needed, but if it's something about lib
> version, I'll need some direction on how to produce what you need (I'm
> unix saavy but not that saavy when it comes to library conflicts).
>
> thx for the help so far
> andy
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list