<P>Depends on which colors you're trying to modify and on which page. If you're trying to modify the red background displayed on the tac page for hosts & services (in critical,warning,unknown states), ie, you want the backgound for warning to be yellow instead of red, then you'll need to modify the tac.c and recomplie that tac.cgi and modify the tac.css, or just use mine. If you want to change the title/page colors just edit the .css file for the page in question. You'll have to play around with what variables do what...
<P> <B><I>Henrique leandro <henrique.leandro@varig.com></I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">so, i don't need change de C code to change colors ?<BR>Only files .css ?<BR><BR>i'll try it.<BR><BR>Thanks.<BR><BR><BR><BR><BR><BR>On Thu, 2003-02-06 at 19:08, Jon Lyons wrote:<BR>> <BR>> Are you talking about changing the default red for critical and warning on the stats page? If not, then look at the .css style sheets, there's a lot of options....<BR>> <BR>> See below, I have Red, Yellow, and brown for my Tac page.<BR>> <BR>> Henrique leandro <HENRIQUE.LEANDRO@VARIG.COM>wrote: Hi,<BR>> <BR>> ho do i for change the status colors ?<BR>> we would like something:<BR>> <BR>> CRITICAL: ORANGE<BR>> WARNING: BLUE<BR>> UNKNOWN: GRAY<BR>> PENDING: RED<BR>> <BR>> <BR>> <BR>> thanks <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> -------------------------------------------------------<BR>> This SF.NET
  email is sponsored by:<BR>> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!<BR>> http://www.vasoftware.com<BR>> _______________________________________________<BR>> Nagios-users mailing list<BR>> Nagios-users@lists.sourceforge.net<BR>> https://lists.sourceforge.net/lists/listinfo/nagios-users<BR>> <BR>> <BR>> <BR>> <BR>> Jon Lyons <JLYONS30@YAHOO.COM>wrote: <BR>> FYI, I've updated my tac.c and tac.css (1.0b6) stylesheet to change the default colors of the tac.cgi text backgrounds from red to yellow for warnings, and brownish for unknown. Now only the critical alerts on the tac.cgi are in red... <BR>> Basically I added two stylesheet definitions to tac.css; and call them in tac.c... <BR>> warningserviceImportantProblem { text-align: left; font-family: arial; font-size: 8pt; background-color: #FFFF00; color: black; }<BR>> .unknownserviceImportantProblem { text-align: left; font-family: arial; font-size: 8pt; b
 ackground-color: #FF9966; color: black; }<BR>> <BR>> /your/nagios/path/share/stylesheets/tac.css <BR>> Jon Lyons <JLYONS30@YAHOO.COM>wrote: <BR>> <BR>> Hi, I've modified my tac.css stylesheet colors, but I'd like to change the service warning text block from red to something more like yellow for the tac.cgi, is this in the style sheet or somewhere else?? I'd like the critical sections to only use red.. :) <BR>> Thanks....<BR>> <BR>> <BR>> <BR>> ---------------------------------<BR>> Do you Yahoo!?<BR>> Yahoo! Mail Plus - Powerful. Affordable. Sign up now<BR>> <BR>> <BR>> ---------------------------------<BR>> Do you Yahoo!?<BR>> Yahoo! Mail Plus - Powerful. Affordable. Sign up now/***********************************************************************<BR>> *<BR>> * TAC.C - Nagios Tactical Monitoring Overview CGI<BR>> *<BR>> * Copyright (c) 2001-2002 Ethan Galstad (nagios@nagios.org)<BR>> * Last Modified: 08-0
 7-2002<BR>> *<BR>> * This CGI program will display the contents of the Nagios<BR>> * log file.<BR>> *<BR>> *<BR>> * This program is free software; you can redistribute it and/or modify<BR>> * it under the terms of the GNU General Public License as published by<BR>> * the Free Software Foundation; either version 2 of the License, or<BR>> * (at your option) any later version.<BR>> *<BR>> * This program is distributed in the hope that it will be useful,<BR>> * but WITHOUT ANY WARRANTY; without even the implied warranty of<BR>> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<BR>> * GNU General Public License for more details.<BR>> *<BR>> * You should have received a copy of the GNU General Public License<BR>> * along with this program; if not, write to the Free Software<BR>> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.<BR>> *********************************************************************
 **/<BR>> <BR>> #include "../common/config.h"<BR>> #include "../common/locations.h"<BR>> #include "../common/common.h"<BR>> #include "../common/objects.h"<BR>> #include "../common/statusdata.h"<BR>> <BR>> #include "getcgi.h"<BR>> #include "cgiutils.h"<BR>> #include "auth.h"<BR>> #include "lifo.h"<BR>> <BR>> <BR>> #define HEALTH_WARNING_PERCENTAGE 90<BR>> #define HEALTH_CRITICAL_PERCENTAGE 75<BR>> <BR>> <BR>> /* HOSTOUTAGE structure */<BR>> typedef struct hostoutage_struct{<BR>> host *hst;<BR>> int affected_child_hosts;<BR>> struct hostoutage_struct *next;<BR>> }hostoutage;<BR>> <BR>> <BR>> extern char main_config_file[MAX_FILENAME_LENGTH];<BR>> extern char url_images_path[MAX_FILENAME_LENGTH];<BR>> extern char url_stylesheets_path[MAX_FILENAME_LENGTH];<BR>> extern char url_media_path[MAX_FILENAME_LENGTH];<BR>> <BR>> extern int refresh_rate;<BR>> <BR>> extern char *service_criti
 cal_sound;<BR>> extern char *service_warning_sound;<BR>> extern char *service_unknown_sound;<BR>> extern char *host_down_sound;<BR>> extern char *host_unreachable_sound;<BR>> extern char *normal_sound;<BR>> <BR>> extern hostgroup *hostgroup_list;<BR>> extern hoststatus *hoststatus_list;<BR>> extern servicestatus *servicestatus_list;<BR>> extern host *host_list;<BR>> extern service *service_list;<BR>> <BR>> extern int enable_notifications;<BR>> extern int execute_service_checks;<BR>> extern int accept_passive_service_checks;<BR>> extern int enable_event_handlers;<BR>> extern int enable_flap_detection;<BR>> <BR>> extern int nagios_process_state;<BR>> <BR>> <BR>> <BR>> void analyze_status_data(void);<BR>> void display_tac_overview(void);<BR>> <BR>> void find_hosts_causing_outages(void);<BR>> void calculate_outage_effect_of_host(host *,int *);<BR>> int is_route_to_host_blocked(host *);<BR>> i
 nt number_of_host_services(host *);<BR>> void add_hostoutage(host *);<BR>> void free_hostoutage_list(void);<BR>> <BR>> void document_header(int);<BR>> void document_footer(void);<BR>> int process_cgivars(void);<BR>> <BR>> authdata current_authdata;<BR>> <BR>> int embedded=FALSE;<BR>> int display_header=FALSE;<BR>> <BR>> hostoutage *hostoutage_list=NULL;<BR>> <BR>> int total_blocking_outages=0;<BR>> int total_nonblocking_outages=0;<BR>> <BR>> int total_service_health=0;<BR>> int total_host_health=0;<BR>> int potential_service_health=0;<BR>> int potential_host_health=0;<BR>> double percent_service_health=0.0;<BR>> double percent_host_health=0.0;<BR>> <BR>> int total_hosts=0;<BR>> int total_services=0;<BR>> <BR>> int total_active_checks=0;<BR>> int total_passive_checks=0;<BR>> <BR>> int min_execution_time=-1;<BR>> int max_execution_time=-1;<BR>> unsigned long total_execution_time
 =0L;<BR>> double average_execution_time=-1.0;<BR>> int min_latency=-1;<BR>> int max_latency=-1;<BR>> unsigned long total_latency=0L;<BR>> double average_latency=-1.0;<BR>> <BR>> int flapping_services=0;<BR>> int flapping_hosts=0;<BR>> int flap_disabled_services=0;<BR>> int flap_disabled_hosts=0;<BR>> int notification_disabled_services=0;<BR>> int notification_disabled_hosts=0;<BR>> int event_handler_disabled_services=0;<BR>> int event_handler_disabled_hosts=0;<BR>> int active_checks_disabled_services=0;<BR>> int active_checks_disabled_hosts=0;<BR>> int passive_checks_disabled_services=0;<BR>> <BR>> int hosts_pending=0;<BR>> int hosts_pending_disabled=0;<BR>> int hosts_up_disabled=0;<BR>> int hosts_up_unacknowledged=0;<BR>> int hosts_up=0;<BR>> int hosts_down_scheduled=0;<BR>> int hosts_down_acknowledged=0;<BR>> int hosts_down_disabled=0;<BR>> int hosts_down_unacknowledged=0;<BR>> int hosts_d
 own=0;<BR>> int hosts_unreachable_scheduled=0;<BR>> int hosts_unreachable_acknowledged=0;<BR>> int hosts_unreachable_disabled=0;<BR>> int hosts_unreachable_unacknowledged=0;<BR>> int hosts_unreachable=0;<BR>> <BR>> int services_pending=0;<BR>> int services_pending_disabled=0;<BR>> int services_ok_disabled=0;<BR>> int services_ok_unacknowledged=0;<BR>> int services_ok=0;<BR>> int services_warning_host_problem=0;<BR>> int services_warning_scheduled=0;<BR>> int services_warning_acknowledged=0;<BR>> int services_warning_disabled=0;<BR>> int services_warning_unacknowledged=0;<BR>> int services_warning=0;<BR>> int services_unknown_host_problem=0;<BR>> int services_unknown_scheduled=0;<BR>> int services_unknown_acknowledged=0;<BR>> int services_unknown_disabled=0;<BR>> int services_unknown_unacknowledged=0;<BR>> int services_unknown=0;<BR>> int services_critical_host_problem=0;<BR>> int services_critical_sc
 heduled=0;<BR>> int services_critical_acknowledged=0;<BR>> int services_critical_disabled=0;<BR>> int services_critical_unacknowledged=0;<BR>> int services_critical=0;<BR>> <BR>> <BR>> <BR>> int main(void){<BR>> int result=OK;<BR>> char *sound=NULL;<BR>> <BR>> <BR>> /* get the CGI variables passed in the URL */<BR>> process_cgivars();<BR>> <BR>> /* reset internal variables */<BR>> reset_cgi_vars();<BR>> <BR>> /* read the CGI configuration file */<BR>> result=read_cgi_config_file(DEFAULT_CGI_CONFIG_FILE);<BR>> if(result==ERROR){<BR>> document_header(FALSE);<BR>> cgi_config_file_error(DEFAULT_CGI_CONFIG_FILE);<BR>> document_footer();<BR>> return ERROR;<BR>> }<BR>> <BR>> /* read the main configuration file */<BR>> result=read_main_config_file(main_config_file);<BR>> if(result==ERROR){<BR>> document_header(FALSE);<BR>> main_config_file_error(main_config_file);<BR>> document_footer
 ();<BR>> return ERROR;<BR>> }<BR>> <BR>> /* read all object configuration data */<BR>> result=read_all_object_configuration_data(main_config_file,READ_ALL_OBJECT_DATA);<BR>> if(result==ERROR){<BR>> document_header(FALSE);<BR>> object_data_error();<BR>> document_footer();<BR>> return ERROR;<BR>> }<BR>> <BR>> /* read all status data */<BR>> result=read_all_status_data(DEFAULT_CGI_CONFIG_FILE,READ_ALL_STATUS_DATA);<BR>> if(result==ERROR){<BR>> document_header(FALSE);<BR>> status_data_error();<BR>> document_footer();<BR>> free_memory();<BR>> return ERROR;<BR>> }<BR>> <BR>> document_header(TRUE);<BR>> <BR>> /* get authentication information */<BR>> get_authentication_information(¤t_authdata);<BR>> <BR>> if(display_header==TRUE){<BR>> <BR>> /* begin top table */<BR>> printf(" \n");<BR>> printf(" \n");<BR>> <BR>> /* left column of top table - info box */<BR>> printf(" \n");<BR>
 > display_info_table("Tactical Status Overview",TRUE,¤t_authdata);<BR>> printf("\n");<BR>> <BR>> /* middle column of top table - log file navigation options */<BR>> printf(" \n");<BR>> printf("\n");<BR>> <BR>> /* right hand column of top row */<BR>> printf(" \n");<BR>> printf("\n");<BR>> <BR>> /* end of top table */<BR>> printf("\n");<BR>> printf("\n");<BR>> printf(" <BR>> <BR>> \n");<BR>> <BR>> }<BR>> <BR>> <BR>> /* analyze current host and service status data for tac overview */<BR>> analyze_status_data();<BR>> <BR>> /* find all hosts that are causing network outages */<BR>> find_hosts_causing_outages();<BR>> <BR>> <BR>> /* embed sound tag if necessary... */<BR>> if(hosts_unreachable_unacknowledged > 0 && host_unreachable_sound!=NULL)<BR>> sound=host_unreachable_sound;<BR>> else if(hosts_down_unacknowledged > 0 && host_down_sound!=NULL)<BR>> sound=host_
 down_sound;<BR>> else if(services_critical_unacknowledged > 0 && service_critical_sound!=NULL)<BR>> sound=service_critical_sound;<BR>> else if(services_warning_unacknowledged > 0 && service_warning_sound!=NULL)<BR>> sound=service_warning_sound;<BR>> else if(services_unknown_unacknowledged==0 && services_warning_unacknowledged==0 && services_critical_unacknowledged==0 && hosts_down_unacknowledged==0 && hosts_unreachable_unacknowledged==0 && normal_sound!=NULL)<BR>> sound=normal_sound;<BR>> if(sound!=NULL)<BR>> printf("",url_media_path,sound);<BR>> <BR>> <BR>> /**** display main tac screen ****/<BR>> display_tac_overview();<BR>> <BR>> document_footer();<BR>> <BR>> /* free memory allocated to the host outage list */<BR>> free_hostoutage_list();<BR>> <BR>> /* free allocated memory */<BR>> free_memory();<BR>> <BR>> return OK;<BR>> }<BR>> <BR>> 
 <BR>> <BR>> <BR>> void document_header(int use_stylesheet){<BR>> char date_time[MAX_DATETIME_LENGTH];<BR>> time_t current_time;<BR>> time_t expire_time;<BR>> <BR>> printf("Cache-Control: no-store\n");<BR>> printf("Pragma: no-cache\n");<BR>> printf("Refresh: %d\n",refresh_rate);<BR>> <BR>> time(¤t_time);<BR>> get_time_string(¤t_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME);<BR>> printf("Last-Modified: %s\n",date_time);<BR>> <BR>> expire_time=(time_t)0L;<BR>> get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME);<BR>> printf("Expires: %s\n",date_time);<BR>> <BR>> printf("Content-type: text/html\n\n");<BR>> <BR>> if(embedded==TRUE)<BR>> return;<BR>> <BR>> printf("\n");<BR>> printf("\n");<BR>> printf("\n");<BR>> <BR>> if(use_stylesheet==TRUE)<BR>> printf("<BR>> \n",url_stylesheets_path,TAC_CSS);<BR>> <BR>> printf("\n");<BR>> printf("\n");<BR>
 > <BR>> /* include user SSI header */<BR>> include_ssi_files(TAC_CGI,SSI_HEADER);<BR>> <BR>> return;<BR>> }<BR>> <BR>> <BR>> void document_footer(void){<BR>> <BR>> if(embedded==TRUE)<BR>> return;<BR>> <BR>> /* include user SSI footer */<BR>> include_ssi_files(TAC_CGI,SSI_FOOTER);<BR>> <BR>> printf("\n");<BR>> printf("\n");<BR>> <BR>> return;<BR>> }<BR>> <BR>> <BR>> int process_cgivars(void){<BR>> char **variables;<BR>> int error=FALSE;<BR>> int x;<BR>> <BR>> variables=getcgivars();<BR>> <BR>> for(x=0;variables[x]!=NULL;x++){<BR>> <BR>> /* do some basic length checking on the variable identifier to prevent buffer overflows */<BR>> if(strlen(variables[x])>=MAX_INPUT_BUFFER-1){<BR>> continue;<BR>> }<BR>> <BR>> /* we found the embed option */<BR>> else if(!strcmp(variables[x],"embedded"))<BR>> embedded=TRUE;<BR>> <BR>> /* we found the noheader option 
 */<BR>> else if(!strcmp(variables[x],"noheader"))<BR>> display_header=FALSE;<BR>> <BR>> /* we recieved an invalid argument */<BR>> else<BR>> error=TRUE;<BR>> <BR>> }<BR>> <BR>> /* free memory allocated to the CGI variables */<BR>> free_cgivars(variables);<BR>> <BR>> return error;<BR>> }<BR>> <BR>> <BR>> <BR>> void analyze_status_data(void){<BR>> servicestatus *temp_servicestatus;<BR>> service *temp_service;<BR>> hoststatus *temp_hoststatus;<BR>> host *temp_host;<BR>> int problem=TRUE;<BR>> <BR>> <BR>> /* check all services */<BR>> for(temp_servicestatus=servicestatus_list;temp_servicestatus!=NULL;temp_servicestatus=temp_servicestatus->next){<BR>> <BR>> /* see if user is authorized to view this service */<BR>> temp_service=find_service(temp_servicestatus->host_name,temp_servicestatus->description,NULL);<BR>> if(is_authorized_for_service(temp_service,¤t_authdata)==FALSE)<BR>&
 gt; continue;<BR>> <BR>> /******** CHECK FEATURES *******/<BR>> <BR>> /* check flapping */<BR>> if(temp_servicestatus->flap_detection_enabled==FALSE)<BR>> flap_disabled_services++;<BR>> else if(temp_servicestatus->is_flapping==TRUE)<BR>> flapping_services++;<BR>> <BR>> /* check notifications */<BR>> if(temp_servicestatus->notifications_enabled==FALSE)<BR>> notification_disabled_services++;<BR>> <BR>> /* check event handler */<BR>> if(temp_servicestatus->event_handler_enabled==FALSE)<BR>> event_handler_disabled_services++;<BR>> <BR>> /* active check execution */<BR>> if(temp_servicestatus->checks_enabled==FALSE)<BR>> active_checks_disabled_services++;<BR>> <BR>> /* passive check acceptance */<BR>> if(temp_servicestatus->accept_passive_service_checks==FALSE)<BR>> passive_checks_disabled_services++;<BR>> <BR>> <BR>> /********* CHECK STATUS ********/<BR>> <BR>> problem=TRUE;
 <BR>> <BR>> if(temp_servicestatus->status==SERVICE_OK || temp_servicestatus->status==SERVICE_RECOVERY){<BR>> if(temp_servicestatus->checks_enabled==FALSE)<BR>> services_ok_disabled++;<BR>> else<BR>> services_ok_unacknowledged++;<BR>> services_ok++;<BR>> }<BR>> <BR>> else if(temp_servicestatus->status==SERVICE_WARNING){<BR>> temp_hoststatus=find_hoststatus(temp_servicestatus->host_name);<BR>> if(temp_hoststatus!=NULL && (temp_hoststatus->status==HOST_DOWN || temp_hoststatus->status==HOST_UNREACHABLE)){<BR>> services_warning_host_problem++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->scheduled_downtime_depth>0){<BR>> services_warning_scheduled++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->problem_has_been_acknowledged==TRUE){<BR>> services_warning_acknowledged++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->checks_enabled==FALSE){<B
 R>> services_warning_disabled++;<BR>> problem=FALSE;<BR>> }<BR>> if(problem==TRUE)<BR>> services_warning_unacknowledged++;<BR>> services_warning++;<BR>> }<BR>> <BR>> else if(temp_servicestatus->status==SERVICE_UNKNOWN){<BR>> temp_hoststatus=find_hoststatus(temp_servicestatus->host_name);<BR>> if(temp_hoststatus!=NULL && (temp_hoststatus->status==HOST_DOWN || temp_hoststatus->status==HOST_UNREACHABLE)){<BR>> services_unknown_host_problem++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->scheduled_downtime_depth>0){<BR>> services_unknown_scheduled++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->problem_has_been_acknowledged==TRUE){<BR>> services_unknown_acknowledged++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->checks_enabled==FALSE){<BR>> services_unknown_disabled++;<BR>> problem=FALSE;<BR>> }<BR>> if(problem==TRUE)<BR>> services_u
 nknown_unacknowledged++;<BR>> services_unknown++;<BR>> }<BR>> <BR>> else if(temp_servicestatus->status==SERVICE_CRITICAL){<BR>> temp_hoststatus=find_hoststatus(temp_servicestatus->host_name);<BR>> if(temp_hoststatus!=NULL && (temp_hoststatus->status==HOST_DOWN || temp_hoststatus->status==HOST_UNREACHABLE)){<BR>> services_critical_host_problem++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->scheduled_downtime_depth>0){<BR>> services_critical_scheduled++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->problem_has_been_acknowledged==TRUE){<BR>> services_critical_acknowledged++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_servicestatus->checks_enabled==FALSE){<BR>> services_critical_disabled++;<BR>> problem=FALSE;<BR>> }<BR>> if(problem==TRUE)<BR>> services_critical_unacknowledged++;<BR>> services_critical++;<BR>> }<BR>> <BR>> else if(temp_servicestatus
 ->status==SERVICE_PENDING){<BR>> if(temp_servicestatus->checks_enabled==FALSE)<BR>> services_pending_disabled++;<BR>> services_pending++;<BR>> }<BR>> <BR>> <BR>> /* get health stats */<BR>> if(temp_servicestatus->status==SERVICE_OK)<BR>> total_service_health+=2;<BR>> <BR>> else if(temp_servicestatus->status==SERVICE_WARNING || temp_servicestatus->status==SERVICE_UNKNOWN)<BR>> total_service_health++;<BR>> <BR>> if(temp_servicestatus->status!=SERVICE_PENDING)<BR>> potential_service_health+=2;<BR>> <BR>> <BR>> /* calculate execution time and latency stats */<BR>> if(temp_servicestatus->check_type==SERVICE_CHECK_ACTIVE){<BR>> <BR>> total_active_checks++;<BR>> <BR>> if(min_latency==-1 || temp_servicestatus->latency min_latency=temp_servicestatus->latency;<BR>> if(max_latency==-1 || temp_servicestatus->latency>max_latency)<BR>> max_latency=temp_servicestatus->latency;<BR
 >> <BR>> if(min_execution_time==-1 || temp_servicestatus->execution_time min_execution_time=temp_servicestatus->execution_time;<BR>> if(max_execution_time==-1 || temp_servicestatus->execution_time>max_execution_time)<BR>> max_execution_time=temp_servicestatus->execution_time;<BR>> <BR>> total_latency+=temp_servicestatus->latency;<BR>> total_execution_time+=temp_servicestatus->execution_time;<BR>> }<BR>> else<BR>> total_passive_checks++;<BR>> <BR>> <BR>> total_services++;<BR>> }<BR>> <BR>> <BR>> <BR>> /* check all hosts */<BR>> for(temp_hoststatus=hoststatus_list;temp_hoststatus!=NULL;temp_hoststatus=temp_hoststatus->next){<BR>> <BR>> /* see if user is authorized to view this host */<BR>> temp_host=find_host(temp_hoststatus->host_name,NULL);<BR>> if(is_authorized_for_host(temp_host,¤t_authdata)==FALSE)<BR>> continue;<BR>> <BR>> /******** CHECK FEATURES *******/<BR>> <B
 R>> /* check flapping */<BR>> if(temp_hoststatus->flap_detection_enabled==FALSE)<BR>> flap_disabled_hosts++;<BR>> else if(temp_hoststatus->is_flapping==TRUE)<BR>> flapping_hosts++;<BR>> <BR>> /* check notifications */<BR>> if(temp_hoststatus->notifications_enabled==FALSE)<BR>> notification_disabled_hosts++;<BR>> <BR>> /* check event handler */<BR>> if(temp_hoststatus->event_handler_enabled==FALSE)<BR>> event_handler_disabled_hosts++;<BR>> <BR>> /* active check execution */<BR>> if(temp_hoststatus->checks_enabled==FALSE)<BR>> active_checks_disabled_hosts++;<BR>> <BR>> <BR>> /********* CHECK STATUS ********/<BR>> <BR>> problem=TRUE;<BR>> <BR>> if(temp_hoststatus->status==HOST_UP){<BR>> if(temp_hoststatus->checks_enabled==FALSE)<BR>> hosts_up_disabled++;<BR>> else<BR>> hosts_up_unacknowledged++;<BR>> hosts_up++;<BR>> }<BR>> <BR>> else if(temp_hoststatus->stat
 us==HOST_DOWN){<BR>> if(temp_hoststatus->scheduled_downtime_depth>0){<BR>> hosts_down_scheduled++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_hoststatus->problem_has_been_acknowledged==TRUE){<BR>> hosts_down_acknowledged++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_hoststatus->checks_enabled==FALSE){<BR>> hosts_down_disabled++;<BR>> problem=FALSE;<BR>> }<BR>> if(problem==TRUE)<BR>> hosts_down_unacknowledged++;<BR>> hosts_down++;<BR>> }<BR>> <BR>> else if(temp_hoststatus->status==HOST_UNREACHABLE){<BR>> if(temp_hoststatus->scheduled_downtime_depth>0){<BR>> hosts_unreachable_scheduled++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_hoststatus->problem_has_been_acknowledged==TRUE){<BR>> hosts_unreachable_acknowledged++;<BR>> problem=FALSE;<BR>> }<BR>> if(temp_hoststatus->checks_enabled==FALSE){<BR>> hosts_unreachable_disabled++;<BR>> problem=FALSE;<BR>> }<BR>> if(probl
 em==TRUE)<BR>> hosts_unreachable_unacknowledged++;<BR>> hosts_unreachable++;<BR>> }<BR>> <BR>> else if(temp_hoststatus->status==HOST_PENDING){<BR>> if(temp_hoststatus->checks_enabled==FALSE)<BR>> hosts_pending_disabled++;<BR>> hosts_pending++;<BR>> }<BR>> <BR>> /* get health stats */<BR>> if(temp_hoststatus->status==HOST_UP)<BR>> total_host_health++;<BR>> <BR>> if(temp_hoststatus->status!=HOST_PENDING)<BR>> potential_host_health++;<BR>> <BR>> total_hosts++;<BR>> }<BR>> <BR>> <BR>> /* calculate service health */<BR>> if(potential_service_health==0)<BR>> percent_service_health=0.0;<BR>> else<BR>> percent_service_health=((double)total_service_health/(double)potential_service_health)*100.0;<BR>> <BR>> /* calculate host health */<BR>> if(potential_host_health==0)<BR>> percent_host_health=0.0;<BR>> else<BR>> percent_host_health=((double)total_host_health/(double)potential_h
 ost_health)*100.0;<BR>> <BR>> /* calculate latency */<BR>> if(total_latency==0L)<BR>> average_latency=0.0;<BR>> else<BR>> average_latency=((double)total_latency/(double)total_active_checks);<BR>> <BR>> /* calculate execution time */<BR>> if(total_execution_time==0L)<BR>> average_execution_time=0.0;<BR>> else<BR>> average_execution_time=((double)total_execution_time/(double)total_active_checks);<BR>> <BR>> return;<BR>> }<BR>> <BR>> <BR>> <BR>> <BR>> /* determine what hosts are causing network outages */<BR>> void find_hosts_causing_outages(void){<BR>> hoststatus *temp_hoststatus;<BR>> hostoutage *temp_hostoutage;<BR>> host *temp_host;<BR>> <BR>> /* user must be authorized for all hosts in order to see outages */<BR>> if(is_authorized_for_all_hosts(¤t_authdata)==FALSE)<BR><BR>=== message truncated ===</BLOCKQUOTE><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Yahoo! Mail Plus</a> - Powerful. Affordable. <a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Sign up now</a>