[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] Config report(critical) not working with critical systems (nkview.cfg), but NK tags



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
--- web/hobbit-confreport.c.orig	2008-02-05 18:17:09.000000000 +0200
+++ web/hobbit-confreport.c	2008-02-06 11:13:52.192590208 +0200
@@ -742,7 +742,11 @@
 			namelist_t *hinfo = hostinfo(hname);
 			char *nkalerts = bbh_item(hinfo, BBH_NK);
 
-			if (!nkalerts || (strcmp(nkval(hname, tname, nkalerts), "No") == 0)) wanted = 0;
+			if (newnkconfig) {
+				if (strcmp(nkval(hname, tname, nkalerts), "No") == 0 ) wanted = 0;
+			} else {
+				if (!nkalerts) wanted = 0;
+			}
 		}
 
 		if (wanted && hname && tname && strcmp(hname, "summary") && strcmp(tname, xgetenv("INFOCOLUMN")) && strcmp(tname, xgetenv("TRENDSCOLUMN"))) {