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

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

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

Postby Guest » Fri Dec 07, 2012 4:34 pm

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
Guest
 

Return to Community Support

Who is online

Users browsing this forum: anna.rodriguez, EugeneD2k20 and 26 guests