Service* or host* in the object_ptr of a nebstruct_notification_struct?

Razvan Cojocaru razvan.cojocaru at 1and1.ro
Tue Sep 18 16:03:55 CEST 2012


Hello,

assuming something like this:

void process_notification(struct nebstruct_notification_struct *ndata)
{
	service *s = NULL;
	host *h = NULL;

	if(ndata) {
		if(ndata->type ... /* what? */) {
			s = (service *)ndata->object_ptr;
		} else {
			h = (host *)ndata->object_ptr;
		}
	}
}

How do I know if object_ptr points to a data, or a service struct
instance? Does the object_ptr member of a nebstruct_notification_struct
_always_ point to a service instance?

The function is called if(ndata->type == NEBTYPE_NOTIFICATION_START).


Thanks,
Razvan


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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