[Nagios-devel] [PATCH] base/nagios: Handle failures creating

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH] base/nagios: Handle failures creating

Post by Guest »

I suspect that some weird, random errors I've been seeing is actually
due to this call failing, but I can't tell if it does, because it's not
logged anywhere.

Because an error here is catastrophic, we really shouldn't ignore it.

Signed-off-by: Robin Sonefors
---
base/nagios.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/base/nagios.c b/base/nagios.c
index 1836217..edbb58f 100644
--- a/base/nagios.c
+++ b/base/nagios.c
@@ -447,6 +447,11 @@ int main(int argc, char **argv, char **env) {

nagios_iobs = iobroker_create();

+ if (nagios_iobs == NULL) {
+ logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Couldn't create iobroker set: %s", strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
/* keep monitoring things until we get a shutdown command */
do {

--
1.7.11.7






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: robin.sonefors@op5.com
Locked