I wonder if the subject is better located in the forum "Nagios Plugin Development" - even though this maybe not is a "plugin" in terms of something that can be used for a servicecheck er similar....
But if anyone could contribute with info/hints on why Nagos logs "Error: Failed to add event to squeue '(nil)' with prio 1: Success" when initializing the broker module, I would really appeciate it...
I have tried to dig into events.c in the nagios base sourcecode (also based on the debug output from nagios) - but it did not help me much...
Code: Select all
[1481222429.462557] [001.0] [pid=30847] schedule_new_event()
[1481222429.462566] [008.0] [pid=30847] New Event Details:
[1481222429.462577] [008.0] [pid=30847] Type: EVENT_USER_FUNCTION
[1481222429.462582] [008.0] [pid=30847] High Priority: Yes
[1481222429.462585] [008.0] [pid=30847] Run Time: 2016-12-08 19:40:44
[1481222429.462588] [008.0] [pid=30847] Recurring: Yes
[1481222429.462591] [008.0] [pid=30847] Event Interval: 15
[1481222429.462594] [008.0] [pid=30847] Compensate for Time Change: Yes
[1481222429.462596] [008.0] [pid=30847] Event Options: 0
[1481222429.462601] [008.0] [pid=30847] Event ID: 0x8def60
[1481222429.462604] [001.0] [pid=30847] add_event()
Everything looks OK so far... So what to seem to fail, is the call to add_event in the function schedule_new_event in base/events.c
The call is made like:
Code: Select all
/* add the event to the event list */
add_event(nagios_squeue, new_event);
nagios_squeue seems to be a variable, that is set by Nagios itself .... Digging into add_event, I see:
Code: Select all
if(event->priority) {
event->sq_event = squeue_add_usec(sq, event->run_time, event->priority - 1, event);
}
else {
event->sq_event = squeue_add(sq, event->run_time, event);
}
This is just before the check with
Code: Select all
if(!event->sq_event) {
logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Failed to add event to squeue '%p' with prio %u: %s\n",
sq, event->priority, strerror(errno));
}
The main question is now why event->sq_event - and the call to squeue_add/squeue_add_usec - not puts a "right" value in that variable....