Skip to content

Commit 40bc6ed

Browse files
authored
Update Naemon libraries (#46)
1 parent 7ab7cca commit 40bc6ed

37 files changed

+5510
-90
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ jobs:
3939
sudo apt-get -y install \
4040
libjansson-dev \
4141
libcurl4-openssl-dev
42-
- name: Build artifacts
42+
- name: Build Nagios3 artifacts
4343
id: build-nagios3
4444
run: |
4545
make nagios3
4646
mv src/alerta-neb.o src/alerta-neb.o.nagios3
47-
- name: Build artifacts
47+
- name: Build Nagios4 artifacts
4848
id: build-nagios4
4949
run: |
5050
make nagios4
5151
mv src/alerta-neb.o src/alerta-neb.o.nagios4
52-
- name: Build artifacts
52+
- name: Build Naemon artifacts
5353
id: build-naemon
5454
run: |
5555
make naemon

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ jobs:
3838
sudo apt-get -y install \
3939
libjansson-dev \
4040
libcurl4-openssl-dev
41-
- name: Build artifacts
41+
- name: Build Nagios3 artifacts
4242
id: build-nagios3
4343
run: |
4444
make nagios3
4545
mv src/alerta-neb.o src/alerta-neb.o.nagios3
46-
- name: Build artifacts
46+
- name: Build Nagios4 artifacts
4747
id: build-nagios4
4848
run: |
4949
make nagios4
5050
mv src/alerta-neb.o src/alerta-neb.o.nagios4
51-
- name: Build artifacts
51+
- name: Build Naemon artifacts
5252
id: build-naemon
5353
run: |
5454
make naemon

include/naemon/broker.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "objects_contact.h"
1111
#include "objects_service.h"
1212
#include "nebmods.h"
13+
#include "macros.h"
1314

1415
/*************** EVENT BROKER OPTIONS *****************/
1516

@@ -27,7 +28,7 @@
2728
#define BROKER_COMMENT_DATA 256 /* DONE */
2829
#define BROKER_DOWNTIME_DATA 512 /* DONE */
2930
#define BROKER_SYSTEM_COMMANDS 1024 /* DONE */
30-
#define BROKER_OCP_DATA_UNUSED 2048 /* reusable */
31+
#define BROKER_VAULT_MACROS 2048 /* DONE */
3132
#define BROKER_STATUS_DATA 4096 /* DONE */
3233
#define BROKER_ADAPTIVE_DATA 8192 /* DONE */
3334
#define BROKER_EXTERNALCOMMAND_DATA 16384 /* DONE */
@@ -166,6 +167,7 @@
166167

167168
NAGIOS_BEGIN_DECL
168169

170+
struct kvvec *get_global_store(void);
169171
void broker_program_state(int, int, int);
170172
void broker_log_data(int, int, int, char *, unsigned long, time_t);
171173
int broker_event_handler(int, int, int, int, void *, int, int, struct timeval, struct timeval, double, int, int, int, char *, char *, char *);
@@ -191,6 +193,7 @@ void broker_aggregated_status_data(int, int, int);
191193
void broker_retention_data(int, int, int);
192194
void broker_acknowledgement_data(int, int, int, int, void *, char *, char *, int, int, int);
193195
void broker_statechange_data(int, int, int, int, void *, int, int, int, int);
196+
int broker_vault_macro(char *, char **, int *, nagios_macros *);
194197

195198
NAGIOS_END_DECL
196199
#endif

include/naemon/buildopts.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#ifndef NAEMON_BUILDOPTS_H__
22
#define NAEMON_BUILDOPTS_H__
3-
#define NAEMON_SYSCONFDIR "/usr/local/etc/naemon"
4-
#define NAEMON_LOCALSTATEDIR "/usr/local/var"
5-
#define NAEMON_LOGDIR "/usr/local/var/log/naemon"
6-
#define NAEMON_LOCKFILE "/usr/local/var/cache/naemon/naemon.pid"
7-
#define NAEMON_GROUP "naemon"
8-
#define NAEMON_USER "naemon"
3+
#define NAEMON_SYSCONFDIR "@@NAEMON_SYSCONFDIR@@"
4+
#define NAEMON_LOCALSTATEDIR "@@NAEMON_LOCALSTATEDIR@@"
5+
#define NAEMON_LOGDIR "@@NAEMON_LOGDIR@@"
6+
#define NAEMON_LOCKFILE "@@NAEMON_LOCKFILE@@"
7+
#define NAEMON_GROUP "@@NAEMON_GROUP@@"
8+
#define NAEMON_USER "@@NAEMON_USER@@"
99
#endif

include/naemon/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ NAGIOS_END_DECL
385385
#define CHECK_OPTION_NONE 0 /* no check options */
386386
#define CHECK_OPTION_FORCE_EXECUTION 1 /* force execution of a check (ignores disabled services/hosts, invalid timeperiods) */
387387
#define CHECK_OPTION_FRESHNESS_CHECK 2 /* this is a freshness check */
388-
/* 4 used to be CHECK_OPTION_ORPHAN_CHECK, but is no longer used */
388+
#define CHECK_OPTION_ORPHAN_CHECK 4 /* flag for scheduled checks from orphan event handler */
389389
#define CHECK_OPTION_DEPENDENCY_CHECK 8 /* dependency check. different scheduling rules apply */
390390
#define CHECK_OPTION_ALLOW_POSTPONE 16 /* allow the check to take precedence over an earlier (sooner) scheduled check */
391391

include/naemon/defaults.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define DEFAULT_MAX_CHECK_RESULT_AGE 3600 /* maximum number of seconds that a check result file is considered to be valid */
2424
#define DEFAULT_MAX_PARALLEL_SERVICE_CHECKS 0 /* maximum number of service checks we can have running at any given time (0=unlimited) */
2525
#define DEFAULT_RETENTION_UPDATE_INTERVAL 60 /* minutes between auto-save of retention data */
26+
#define DEFAULT_RETAINED_SCHEDULING_RANDOMIZE_WINDOW 60 /* number of seconds used for randomizing the re-scheduling of checks missed over a restart */
2627
#define DEFAULT_RETENTION_SCHEDULING_HORIZON 900 /* max seconds between program restarts that we will preserve scheduling information */
2728
#define DEFAULT_STATUS_UPDATE_INTERVAL 60 /* seconds between aggregated status data updates */
2829
#define DEFAULT_FRESHNESS_CHECK_INTERVAL 60 /* seconds between service result freshness checks */
@@ -86,6 +87,8 @@
8687

8788
#define DEFAULT_ALLOW_EMPTY_HOSTGROUP_ASSIGNMENT 2 /* Allow assigning to empty hostgroups by default, but warn about it */
8889
#define DEFAULT_ALLOW_CIRCULAR_DEPENDENCIES 0 /* Allow circular depdendencies */
90+
#define DEFAULT_HOST_DOWN_DISABLE_SERVICE_CHECKS 0 /* run service checks if the host is down */
91+
#define DEFAULT_SKIP_CHECK_STATUS -1 /* do not change status by default */
8992

9093
#define DEFAULT_HOST_PERFDATA_FILE_TEMPLATE "[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$"
9194
#define DEFAULT_SERVICE_PERFDATA_FILE_TEMPLATE "[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$"

include/naemon/globals.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ extern int retain_state_information;
110110
extern int retention_update_interval;
111111
extern int use_retained_program_state;
112112
extern int use_retained_scheduling_info;
113+
extern int retained_scheduling_randomize_window;
113114
extern int retention_scheduling_horizon;
114115
extern char *retention_file;
115116
extern unsigned long retained_host_attribute_mask;
@@ -144,6 +145,10 @@ extern unsigned long max_debug_file_size;
144145

145146
extern int allow_empty_hostgroup_assignment;
146147
extern int allow_circular_dependencies;
148+
extern int host_down_disable_service_checks;
149+
extern int service_skip_check_dependency_status;
150+
extern int service_skip_check_host_down_status;
151+
extern int host_skip_check_dependency_status;
147152

148153
extern time_t last_program_stop;
149154
extern time_t event_start;

include/naemon/lib/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
test-squeue
2+
test-iocache
3+
test-iobroker
4+
test-bitmap
5+
test-dkhash
6+
test-runcmd
7+
test-fanout
8+
test-nsutils
9+
wproc
10+
#snprintf.h
11+
core
12+
stamp-h2
13+
/test-*.log
14+
/test-*.trs

0 commit comments

Comments
 (0)