Page 1 of 1

[Nagios-devel] Soft states skipped in reports

Posted: Mon Dec 13, 2004 6:31 am
by Guest
This is a multi-part message in MIME format.
--------------010100090902020501080506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

In avail.c and trends.c, soft states are skipped from reporting.

I know this is by design, but it seems a bit illogical to me, since I
would expect network hiccups to be marked as "bad" in the reports (the
service/host is after all unavailable during the hiccup).

The proper way to do it would probably be to add an option and let the
user choose if he/she wants to include soft states, but for now I've
just removed the continue; code from the log-parsing loops.

Apply with patch -p1.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer

--------------010100090902020501080506
Content-Type: text/plain;
name="nagios-cgi_softstates.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-cgi_softstates.diff"

diff -urN ../nagios.orig/cgi/avail.c ./cgi/avail.c
--- ../nagios.orig/cgi/avail.c Fri Dec 3 13:06:24 2004
+++ ./cgi/avail.c Mon Dec 13 15:20:47 2004
@@ -2897,10 +2897,6 @@
if(temp_subject==NULL)
continue;

- /* skip soft states */
- if(strstr(input,";SOFT;"))
- continue;
-
/* get the plugin output */
temp_buffer=my_strtok(NULL,";");
temp_buffer=my_strtok(NULL,";");
@@ -2961,10 +2957,6 @@
/* see if there is a corresponding subject for this service */
temp_subject=find_subject(SERVICE_SUBJECT,entry_host_name,entry_svc_description);
if(temp_subject==NULL)
- continue;
-
- /* skip soft states */
- if(strstr(input,";SOFT;"))
continue;

/* get the plugin output */
diff -urN ../nagios.orig/cgi/trends.c ./cgi/trends.c
--- ../nagios.orig/cgi/trends.c Mon Nov 15 13:47:21 2004
+++ ./cgi/trends.c Mon Dec 13 15:21:26 2004
@@ -2445,10 +2445,6 @@
if(strcmp(host_name,entry_host_name))
continue;

- /* skip soft states */
- if(strstr(input,";SOFT;"))
- continue;
-
/* get the plugin output */
temp_buffer=my_strtok(NULL,";");
temp_buffer=my_strtok(NULL,";");
@@ -2488,10 +2484,6 @@
entry_svc_description[sizeof(entry_svc_description)-1]='\x0';

if(strcmp(svc_description,entry_svc_description))
- continue;
-
- /* skip soft states */
- if(strstr(input,";SOFT;"))
continue;

/* get the plugin output */

--------------010100090902020501080506--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]