Page 1 of 1

Re: [Nagios-devel] H_UP notification regarless scheduled downtime

Posted: Tue Nov 06, 2012 6:34 pm
by Guest
On 11/06/2012 07:23 PM, Ricardo Jose Maraschini wrote:
> * Andreas Ericsson ([email protected]) wrote:
>> It looks as if that should be impossible, but I've had a few beers right
>> now and I'm leaving for a one-week vacation in egypt in ten hours, so
>> I'll have to postpone a further analysis of this patch and its ultimate
>> consequences.
>
> Alright then. The code below avoids an uneeded pointer check

The pointer check left behind, along with its warning, is also unnecessary.
There's no way we can find the service and not the host anymore.

> Have a nice vacation.
>

Thanks :)

> Index: base/notifications.c
> ===================================================================
> --- base/notifications.c (revision 2455)
> +++ base/notifications.c (working copy)
> @@ -338,11 +338,7 @@
> }
>
> /* find the host this service is associated with */
> - if((temp_host = (host *)svc->host_ptr) == NULL)
> - return ERROR;
> -
> - /* if we couldn't find the host, return an error */
> - if(temp_host == NULL) {
> + if((temp_host = (host *)svc->host_ptr) == NULL) {
> log_debug_info(DEBUGL_NOTIFICATIONS, 1, "Couldn't find the host associated with this service, so we won't send a notification.\n");
> return ERROR;
> }
>


--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]