Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
IssueID #28 - Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 2f847c0b810772080afe1a6829b0bbeb91cec5b9
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Tue May 5 22:00:05 2009 +0200

    typo fixing and nagios_pid replacements

commit 2e25f6ccf0b16d057ac522c9b0ea5264a3cae049
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Tue May 5 21:22:17 2009 +0200

    dos2unix html/main.php and some more minor whitespace fixes

commit 1391c294554bb39f774d2ae8f10d5c793e776f5c
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Tue May 5 21:17:18 2009 +0200

    some minor whitespace fixes

commit 211347ede1d7f86f6958aaa0e6ca718b20fc3c23
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Tue May 5 21:05:20 2009 +0200

    CGI Name fixing

    It's a bulk search and replace to get Icinga's Name
    into the CGIs but leaving the Copyrights untouched.

commit 375423a4f4a7fa2921360371369c1536c575636e
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Tue May 5 21:04:14 2009 +0200

    Change ENV Macro Prefix

    Environment vars will be called ICINGA_*

commit cbabd00ba9f1cb2347481fd1c2b4539ea067a2f6
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Tue May 5 19:12:52 2009 +0200

    Changed HTML Files

    Deleted PHP Part against update checks
    changed page title and header to icinga
    fix different links and logos to icinga

commit afd6a2b015c94d23b8e8baa2c05dc6e8675bd28a
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Tue May 5 18:58:02 2009 +0200

    Change name of logfiles

commit 4ad7117284745c1f195037db39063a1e26e38420
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sun May 3 18:28:32 2009 +0200

    Fix segfault cause of wrong var order

commit c8d1367cece17e5c14031982bea1e012eed8c81a
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sun May 3 18:12:19 2009 +0200

    more renaming

commit e941e37fc1335f2df34a5095ca62a36f21f82879
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sun May 3 18:10:57 2009 +0200

    Renamed nagiostatos->icingastats

commit 1c30516e5c8a8277fda616034863b182705ca3a2
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sun May 3 13:00:53 2009 +0200

    Rename: nagios.c->icinga.c

commit 169cb2fa92c99e4a0ffe9457698eeb34b08791be
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sun May 3 12:38:40 2009 +0200

    more small changes to .gitignore cause of renaming

commit 346d044ba139f4faacab22b6e7b53d3b886f42eb
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sun May 3 12:29:15 2009 +0200

    Use precompiler PROGRAM_NAME in program

commit 826109499cf07d059b3378451a93e18bc828f2c1
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sat May 2 20:30:50 2009 +0200

    add new PROGRAM_NAME pragma

commit 07d87fd6c1eec05be41d5a04105e587ff04308c5
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sat May 2 20:29:58 2009 +0200

    accept 'icinga.cfg' as not suspicious main config file

commit 72f2fc5da0014e04e38358c3f38cf2ad3ad24793
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sat May 2 19:27:53 2009 +0200

    config option renaming: nagios_user|group -> icinga_user|group

commit 8a135c7455a1ce55c587391a17e18862fea16948
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sat May 2 19:12:39 2009 +0200

    Renamed epn_nagios.h -> epn_icinga.h

commit eb2018cfaf75c8c82147554a88c8f8d531054400
Author: Hendrik Baecker <andurin@process-zero.de>
Date:   Sat May 2 19:04:04 2009 +0200

    Renamed include/nagios.h -> include/icinga.h
  • Loading branch information
andurin committed May 7, 2009
1 parent c953e08 commit 7e1bcbc
Show file tree
Hide file tree
Showing 62 changed files with 351 additions and 349 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ pkg
subst
pkginfo
Prototype
nagios.SPARC.pkg.tar.gz
icinga.SPARC.pkg.tar.gz
autom4te.cache

config.log
config.status
daemon-init
/Makefile
Debug
.cproject
.project
.settings
8 changes: 4 additions & 4 deletions base/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ xretention-base.o: $(SRC_XDATA)/$(XRDC) $(SRC_XDATA)/$(XRDH)

########## NAGIOS ##########

icinga: nagios.c $(OBJS) $(OBJDEPS) $(SRC_INCLUDE)/nagios.h $(SRC_INCLUDE)/locations.h
$(CC) $(CFLAGS) -o $@ nagios.c $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(MATHLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)
icinga: icinga.c $(OBJS) $(OBJDEPS) $(SRC_INCLUDE)/icinga.h $(SRC_INCLUDE)/locations.h
$(CC) $(CFLAGS) -o $@ icinga.c $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(MATHLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)

icingastats: nagiostats.c $(SRC_INCLUDE)/locations.h
$(CC) $(CFLAGS) -o $@ nagiostats.c $(LDFLAGS) $(MATHLIBS) $(LIBS)
icingastats: icingastats.c $(SRC_INCLUDE)/locations.h
$(CC) $(CFLAGS) -o $@ icingastats.c $(LDFLAGS) $(MATHLIBS) $(LIBS)

$(OBJS): $(SRC_INCLUDE)/locations.h

Expand Down
2 changes: 1 addition & 1 deletion base/broker.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "../include/config.h"
#include "../include/common.h"

#include "../include/nagios.h"
#include "../include/icinga.h"
#include "../include/broker.h"
#include "../include/nebcallbacks.h"
#include "../include/nebstructs.h"
Expand Down
4 changes: 2 additions & 2 deletions base/checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "../include/statusdata.h"
#include "../include/downtime.h"
#include "../include/macros.h"
#include "../include/nagios.h"
#include "../include/icinga.h"
#include "../include/broker.h"
#include "../include/perfdata.h"

Expand All @@ -37,7 +37,7 @@


#ifdef EMBEDDEDPERL
#include "../include/epn_nagios.h"
#include "../include/epn_icinga.h"
#endif

#ifdef USE_EVENT_BROKER
Expand Down
2 changes: 1 addition & 1 deletion base/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "../include/perfdata.h"
#include "../include/sretention.h"
#include "../include/broker.h"
#include "../include/nagios.h"
#include "../include/icinga.h"

extern char *config_file;
extern char *log_file;
Expand Down
6 changes: 3 additions & 3 deletions base/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/macros.h"
#include "../include/nagios.h"
#include "../include/icinga.h"
#include "../include/broker.h"
#include "../include/nebmods.h"
#include "../include/nebmodules.h"
Expand Down Expand Up @@ -489,12 +489,12 @@ int read_main_config_file(char *main_config_file){
ochp_command=(char *)strdup(value);
}

else if(!strcmp(variable,"nagios_user")){
else if(!strcmp(variable,"icinga_user")){
my_free(nagios_user);
nagios_user=(char *)strdup(value);
}

else if(!strcmp(variable,"nagios_group")){
else if(!strcmp(variable,"icinga_group")){
my_free(nagios_group);
nagios_group=(char *)strdup(value);
}
Expand Down
4 changes: 2 additions & 2 deletions base/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "../include/downtime.h"
#include "../include/comments.h"
#include "../include/statusdata.h"
#include "../include/nagios.h"
#include "../include/icinga.h"
#include "../include/broker.h"
#include "../include/sretention.h"

Expand Down Expand Up @@ -626,7 +626,7 @@ void display_scheduling_info(void){

printf("Projected scheduling information for host and service checks\n");
printf("is listed below. This information assumes that you are going\n");
printf("to start running Nagios with your current config files.\n\n");
printf("to start running %s with your current config files.\n\n", PROGRAM_NAME);

printf("HOST SCHEDULING INFORMATION\n");
printf("---------------------------\n");
Expand Down
2 changes: 1 addition & 1 deletion base/flapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "../include/objects.h"
#include "../include/comments.h"
#include "../include/statusdata.h"
#include "../include/nagios.h"
#include "../include/icinga.h"
#include "../include/broker.h"

extern int interval_length;
Expand Down
37 changes: 19 additions & 18 deletions base/nagios.c → base/icinga.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "../include/downtime.h"
#include "../include/statusdata.h"
#include "../include/macros.h"
#include "../include/nagios.h"
#include "../include/icinga.h"
#include "../include/sretention.h"
#include "../include/perfdata.h"
#include "../include/broker.h"
Expand Down Expand Up @@ -326,7 +326,7 @@ int main(int argc, char **argv){
break;

switch(c){

case '?': /* usage */
case 'h':
display_help=TRUE;
Expand Down Expand Up @@ -383,8 +383,9 @@ int main(int argc, char **argv){
#endif

if(daemon_mode==FALSE){
printf("\nNagios %s\n",PROGRAM_VERSION);
printf("\n%s %s\n", PROGRAM_NAME ,PROGRAM_VERSION);
printf("Copyright (c) 1999-2009 Ethan Galstad (http://www.nagios.org)\n");
printf("Copyright (c) 2009 Hendrik Baecker (http://www.icinga.org)\n");
printf("Last Modified: %s\n",PROGRAM_MODIFICATION_DATE);
printf("License: GPL\n\n");
}
Expand Down Expand Up @@ -424,11 +425,11 @@ int main(int argc, char **argv){
printf(" -x, --dont-verify-paths Don't check for circular object paths - USE WITH CAUTION!\n");
printf(" -p, --precache-objects Precache object configuration - use with -v or -s options\n");
printf(" -u, --use-precached-objects Use precached object config file\n");
printf(" -d, --daemon Starts Nagios in daemon mode, instead of as a foreground process\n");
printf(" -d, --daemon Starts %s in daemon mode, instead of as a foreground process\n", PROGRAM_NAME);
printf("\n");
printf("Visit the Nagios website at http://www.nagios.org/ for bug fixes, new\n");
printf("Visit the %s website at http://www.icinga.org/ for bug fixes, new\n", PROGRAM_NAME);
printf("releases, online documentation, FAQs, information on subscribing to\n");
printf("the mailing lists, and commercial support options for Nagios.\n");
printf("the mailing lists, and commercial support options for %s.\n", PROGRAM_NAME);
printf("\n");

exit(ERROR);
Expand Down Expand Up @@ -503,19 +504,19 @@ int main(int argc, char **argv){
if(result!=OK){

/* if the config filename looks fishy, warn the user */
if(!strstr(config_file,"nagios.cfg")){
if(!strstr(config_file,"nagios.cfg") || !strstr(config_file,"icinga.cfg")){
printf("\n***> The name of the main configuration file looks suspicious...\n");
printf("\n");
printf(" Make sure you are specifying the name of the MAIN configuration file on\n");
printf(" the command line and not the name of another configuration file. The\n");
printf(" main configuration file is typically '/usr/local/nagios/etc/nagios.cfg'\n");
printf(" main configuration file is typically '/usr/local/icinga/etc/icinga.cfg'\n");
}

printf("\n***> One or more problems was encountered while processing the config files...\n");
printf("\n");
printf(" Check your configuration file(s) to ensure that they contain valid\n");
printf(" directives and data defintions. If you are upgrading from a previous\n");
printf(" version of Nagios, you should be aware that some variables/definitions\n");
printf(" version of %s, you should be aware that some variables/definitions\n", PROGRAM_NAME);
printf(" may have been removed or modified in this version. Make sure to read\n");
printf(" the HTML documentation regarding the config files, as well as the\n");
printf(" 'Whats New' section to find out what has changed.\n\n");
Expand All @@ -536,7 +537,7 @@ int main(int argc, char **argv){
printf("\n");
printf(" Check your configuration file(s) to ensure that they contain valid\n");
printf(" directives and data defintions. If you are upgrading from a previous\n");
printf(" version of Nagios, you should be aware that some variables/definitions\n");
printf(" version of %s, you should be aware that some variables/definitions\n", PROGRAM_NAME);
printf(" may have been removed or modified in this version. Make sure to read\n");
printf(" the HTML documentation regarding the config files, as well as the\n");
printf(" 'Whats New' section to find out what has changed.\n\n");
Expand Down Expand Up @@ -652,7 +653,7 @@ int main(int argc, char **argv){
#endif

/* this must be logged after we read config data, as user may have changed location of main log file */
logit(NSLOG_PROCESS_INFO,TRUE,"Nagios %s starting... (PID=%d)\n",PROGRAM_VERSION,(int)getpid());
logit(NSLOG_PROCESS_INFO, TRUE, "%s %s starting... (PID=%d)\n", PROGRAM_NAME, PROGRAM_VERSION, (int)getpid() );

/* log the local time - may be different than clock time due to timezone offset */
now=time(NULL);
Expand All @@ -679,18 +680,18 @@ int main(int argc, char **argv){

/* there was a problem reading the config files */
if(result!=OK)
logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_CONFIG_ERROR,TRUE,"Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=%d)",(int)getpid());
logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_CONFIG_ERROR,TRUE,"Bailing out due to one or more errors encountered in the configuration files. Run %s from the command line with the -v option to verify your config before restarting. (PID=%d)", PROGRAM_NAME ,(int)getpid());

else{

/* run the pre-flight check to make sure everything looks okay*/
if((result=pre_flight_check())!=OK)
logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_VERIFICATION_ERROR,TRUE,"Bailing out due to errors encountered while running the pre-flight check. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=%d)\n",(int)getpid());
logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_VERIFICATION_ERROR,TRUE,"Bailing out due to errors encountered while running the pre-flight check. Run %s from the command line with the -v option to verify your config before restarting. (PID=%d)\n", PROGRAM_NAME ,(int)getpid());
}

/* an error occurred that prevented us from (re)starting */
if(result!=OK){

/* if we were restarting, we need to cleanup from the previous run */
if(sigrestart==TRUE){

Expand Down Expand Up @@ -778,16 +779,16 @@ int main(int argc, char **argv){

/* initialize comment data */
initialize_comment_data(config_file);

/* initialize scheduled downtime data */
initialize_downtime_data(config_file);

/* initialize performance data */
initialize_performance_data(config_file);

/* initialize the event timing loop */
init_timing_loop();

/* initialize check statistics */
init_check_stats();

Expand Down Expand Up @@ -877,7 +878,7 @@ int main(int argc, char **argv){

/* log a shutdown message */
logit(NSLOG_PROCESS_INFO,TRUE,"Successfully shutdown... (PID=%d)\n",(int)getpid());
}
}

/* clean up after ourselves */
cleanup();
Expand Down
43 changes: 22 additions & 21 deletions base/nagiostats.c → base/icingastats.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
*
* NAGIOSTATS.C - Displays Nagios Statistics
* ICINGASTATS.C - Displays Nagios Statistics
*
* Program: Nagiostats
* Version: 3.1.0
Expand Down Expand Up @@ -28,7 +28,7 @@

#include "../include/config.h"
#include "../include/common.h"
#include "../include/nagios.h"
#include "../include/icinga.h"
#include "../include/locations.h"

#define STATUS_NO_DATA 0
Expand Down Expand Up @@ -154,7 +154,7 @@ int active_hosts_checked_last_1hour=0;

int active_host_checks_last_1min=0;
int active_host_checks_last_5min=0;
int active_host_checks_last_15min=0;
int active_host_checks_last_15min=0;
int active_ondemand_host_checks_last_1min=0;
int active_ondemand_host_checks_last_5min=0;
int active_ondemand_host_checks_last_15min=0;
Expand All @@ -176,7 +176,7 @@ int serial_host_checks_last_15min=0;

int active_service_checks_last_1min=0;
int active_service_checks_last_5min=0;
int active_service_checks_last_15min=0;
int active_service_checks_last_15min=0;
int active_ondemand_service_checks_last_1min=0;
int active_ondemand_service_checks_last_5min=0;
int active_ondemand_service_checks_last_15min=0;
Expand Down Expand Up @@ -248,7 +248,7 @@ int main(int argc, char **argv){
break;

switch(c){

case '?':
case 'h':
display_help=TRUE;
Expand Down Expand Up @@ -284,8 +284,9 @@ int main(int argc, char **argv){
}

if(mrtg_mode==FALSE){
printf("\nNagios Stats %s\n",PROGRAM_VERSION);
printf("\n%s Stats %s\n", PROGRAM_NAME, PROGRAM_VERSION);
printf("Copyright (c) 2003-2008 Ethan Galstad (www.nagios.org)\n");
printf("Copyright (c) 2009 Hendrik Baecker (andurin@process-zero.de)\n");
printf("Last Modified: %s\n",PROGRAM_MODIFICATION_DATE);
printf("License: GPL\n\n");
}
Expand Down Expand Up @@ -318,8 +319,8 @@ int main(int argc, char **argv){
printf(" -h, --help display usage information and exit.\n");
printf("\n");
printf("Input file:\n");
printf(" -c, --config=FILE specifies location of main Nagios config file.\n");
printf(" -s, --statsfile=FILE specifies alternate location of file to read Nagios\n");
printf(" -c, --config=FILE specifies location of main %s config file.\n", PROGRAM_NAME);
printf(" -s, --statsfile=FILE specifies alternate location of file to read %s\n", PROGRAM_NAME);
printf(" performance data from.\n");
printf("\n");
printf("Output:\n");
Expand All @@ -331,13 +332,13 @@ int main(int argc, char **argv){
printf(" Defaults to a newline.\n");
printf("\n");
printf("MRTG DATA VARIABLES (-d option):\n");
printf(" PROGRUNTIME string with time Nagios process has been running.\n");
printf(" PROGRUNTIMETT time Nagios process has been running (time_t format).\n");
printf(" PROGRUNTIME string with time %s process has been running.\n", PROGRAM_NAME);
printf(" PROGRUNTIMETT time %s process has been running (time_t format).\n", PROGRAM_NAME);
printf(" STATUSFILEAGE string with age of status data file.\n");
printf(" STATUSFILEAGETT string with age of status data file (time_t format).\n");
printf(" NAGIOSVERSION string with Nagios version.\n");
printf(" NAGIOSPID pid number of Nagios deamon.\n");
printf(" NAGIOSVERPID string with Nagios version and PID.\n");
printf(" %sVERSION string with %s version.\n", PROGRAM_NAME_UC, PROGRAM_NAME);
printf(" %sPID pid number of %s deamon.\n", PROGRAM_NAME_UC, PROGRAM_NAME);
printf(" %sVERPID string with %s version and PID.\n", PROGRAM_NAME_UC, PROGRAM_NAME);
printf(" TOTCMDBUF total number of external command buffer slots available.\n");
printf(" USEDCMDBUF number of external command buffer slots currently in use.\n");
printf(" HIGHCMDBUF highest number of external command buffer slots ever in use.\n");
Expand Down Expand Up @@ -473,12 +474,12 @@ int display_mrtg_values(void){
time_difference=(current_time-status_creation_date);
printf("%lu%s",time_difference,mrtg_delimiter);
}
else if(!strcmp(temp_ptr,"NAGIOSVERSION"))
else if(!strcmp(temp_ptr,"ICINGAVERSION"))
printf("%s%s",status_version,mrtg_delimiter);
else if(!strcmp(temp_ptr,"NAGIOSPID"))
else if(!strcmp(temp_ptr,"ICINGAPID"))
printf("%lu%s",nagios_pid,mrtg_delimiter);
else if(!strcmp(temp_ptr,"NAGIOSVERPID"))
printf("Nagios %s (pid=%lu)%s",status_version,nagios_pid,mrtg_delimiter);
else if(!strcmp(temp_ptr,"ICINGAVERPID"))
printf("%s %s (pid=%lu)%s", PROGRAM_NAME, status_version, nagios_pid, mrtg_delimiter);


else if(!strcmp(temp_ptr,"TOTCMDBUF"))
Expand Down Expand Up @@ -788,7 +789,7 @@ int display_stats(void){
time_difference=(current_time-program_start);
get_time_breakdown(time_difference,&days,&hours,&minutes,&seconds);
printf("Program Running Time: %dd %dh %dm %ds\n",days,hours,minutes,seconds);
printf("Nagios PID: %lu\n",nagios_pid);
printf("%s PID: %lu\n", PROGRAM_NAME, nagios_pid);
printf("Used/High/Total Command Buffers: %d / %d / %d\n",used_external_command_buffer_slots,high_external_command_buffer_slots,total_external_command_buffer_slots);
printf("\n");
printf("Total Services: %d\n",status_service_entries);
Expand Down Expand Up @@ -889,7 +890,7 @@ int read_config_file(void){
free(status_file);
status_file=strdup(val);
}

}

fclose(fp);
Expand Down Expand Up @@ -1222,7 +1223,7 @@ int read_status_file(void){
used_external_command_buffer_slots=atoi(val);
else if(!strcmp(var,"high_external_command_buffer_slots"))
high_external_command_buffer_slots=atoi(val);
else if(!strcmp(var,"nagios_pid"))
else if(!strcmp(var,"icinga_pid"))
nagios_pid=strtoul(val,NULL,10);
else if(!strcmp(var,"active_scheduled_host_check_stats")){
if((temp_ptr=strtok(val,",")))
Expand Down Expand Up @@ -1418,7 +1419,7 @@ int read_nagiostats_file(void){
used_external_command_buffer_slots=atoi(val);
else if(!strcmp(var,"high_external_command_buffer_slots"))
high_external_command_buffer_slots=atoi(val);
else if(!strcmp(var,"nagios_pid"))
else if(!strcmp(var,"icinga_pid"))
nagios_pid=strtoul(val,NULL,10);
else if(!strcmp(var,"active_scheduled_host_check_stats")){
if((temp_ptr=strtok(val,",")))
Expand Down
Loading

0 comments on commit 7e1bcbc

Please sign in to comment.