Xymon Mailing List Archive search

Config report(critical) not working with critical systems (nkview.cfg), but NK tags

2 messages in this thread

list Buchan Milne · Tue, 5 Feb 2008 18:25:56 +0200 ·
I am moving to the Critical Systems view, however, to ensure that all the critical systems are in fact on the Critical Systems view, I was hoping to use the Config report (critical), and refer teams to the reports for their pages/servers. However, I always get empty reports, while the normal Config report has the correct values (from nkview.cfg) in the NK column for the correct host/test.

The source code for hobbit-confreport.c shows that it filters based on the NK tag from bb-hosts when run with the --critical option.

This is quite a big issue, I can't give everyone edit access, and there's no other really feasible way to audit this at present.

OK, it looks like there's something wrong here:

if (!nkalerts || (strcmp(nkval(hname, tname, nkalerts), "No") == 0)) wanted = 0;

This change (beware line breaks) seems to do what I need (at least on the dev system I tested on):

--- web/hobbit-confreport.c.orig        2008-02-05 18:17:09.380998000 +0200
+++ web/hobbit-confreport.c     2008-02-05 18:17:29.161737419 +0200
@@ -742,7 +742,7 @@
                        namelist_t *hinfo = hostinfo(hname);
                        char *nkalerts = bbh_item(hinfo, BBH_NK);

-                       if (!nkalerts || (strcmp(nkval(hname, tname, nkalerts), "No") == 0)) wanted = 0;
+                       if (!nkalerts && (strcmp(nkval(hname, tname, nkalerts), "No") == 0)) wanted = 0;
                }

                if (wanted && hname && tname && strcmp(hname, "summary") && strcmp(tname, xgetenv("INFOCOLUMN")) && strcmp(tname, xgetenv("TRENDSCOLUMN"))) {


However, a host with NK tags in bb-hosts now appears in the report, with NK columns displaying "No". I can live with this though ...

Regards,
Buchan
list Buchan Milne · Wed, 6 Feb 2008 11:17:48 +0200 ·
quoted from Buchan Milne
On Tuesday 05 February 2008 18:25:56 Buchan Milne wrote:
I am moving to the Critical Systems view, however, to ensure that all the
critical systems are in fact on the Critical Systems view, I was hoping to
use the Config report (critical), and refer teams to the reports for their
pages/servers. However, I always get empty reports, while the normal Config
report has the correct values (from nkview.cfg) in the NK column for the
correct host/test.

The source code for hobbit-confreport.c shows that it filters based on the
NK tag from bb-hosts when run with the --critical option.

This is quite a big issue, I can't give everyone edit access, and there's
no other really feasible way to audit this at present.

OK, it looks like there's something wrong here:

if (!nkalerts || (strcmp(nkval(hname, tname, nkalerts), "No") == 0)) wanted
= 0;

This change (beware line breaks) seems to do what I need (at least on the
dev system I tested on):
[...]
However, a host with NK tags in bb-hosts now appears in the report, with NK
columns displaying "No". I can live with this though ...
The attached patch seems to be a better (and easier to read) fix.

Regards,
Buchan
Attachments (1)