PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|C|nagios-2.9|module|helloworld.c =

page 2 of 2




	return;
        }


/* handle data from Nagios daemon */
int helloworld_handle_data(int event_type, void *data){
	nebstruct_aggregated_status_data *agsdata=NULL;
	char temp_buffer[1024];

	/* what type of event/data do we have? */
	switch(event_type){

	case NEBCALLBACK_AGGREGATED_STATUS_DATA:

		/* an aggregated status data dump just started or ended... */
		if((agsdata=(nebstruct_aggregated_status_data *)data)){

			/* log a message to the Nagios log file */
			snprintf(temp_buffer,sizeof(temp_buffer)-1,"helloworld: An aggregated status update just %s.",(agsdata->type==NEBTYPE_AGGREGATEDSTATUS_STARTDUMP)?"started":"finished");

			temp_buffer[sizeof(temp_buffer)-1]='\x0';
			write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE);
		        }

		break;

	default:
		break;
	        }

	return 0;
        }

=2=
THE END

1| < PREV = PAGE 2 =

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 

E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.05621 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)