Xymon Mailing List Archive search

adding --hffile back to criticalview

list Andy Smith
Tue, 7 Jan 2014 16:25:57 +0000
Message-Id: <user-04477d7c4b7a@xymon.invalid>

Hi,

Any chance we could have this patch added please, it restores the --hffile
option so I can have customised headers and footers for my various critical
views..

*** web/criticalview.c.FCS      2012-07-14 17:32:11.000000000 +0100
--- web/criticalview.c  2014-01-05 19:36:19.000000000 +0000
***************
*** 445,450 ****
--- 445,451 ----
        int argi;
        char *envarea = NULL;
        char **critconfig = NULL;
+       char *hffile = "critical";
        int cccount = 0;

        critconfig = (char **)calloc(1, sizeof(char *));
***************
*** 476,481 ****
--- 477,486 ----
                        critconfig = (char **)realloc(critconfig, (1 +
cccount)*sizeof(char *));
                        critconfig[cccount] = NULL;
                }
+               else if (argnmatch(argv[argi], "--hffile=")) {
+                       char *p = strchr(argv[argi], '=');
+                       hffile = strdup(p+1);
+               }
        }

        if (!critconfig[0]) {
***************
*** 546,553 ****
                        }

                        generate_critpage(rbstate[i], hostsonpage[i],
stdout,
!                                         (i == 0) ? (critconfig[1] ?
"critmulti" : "critical") : "divider",
!                                         (critconfig[i+1] == NULL) ?
"critical" : "divider",
                                          partcolor[i], partprio[i]);
                }
        }
--- 551,558 ----
                        }

                        generate_critpage(rbstate[i], hostsonpage[i],
stdout,
!                                         (i == 0) ? (critconfig[1] ?
"critmulti" : hffile) : "divider",
!                                         (critconfig[i+1] == NULL) ?
hffile : "divider",
                                          partcolor[i], partprio[i]);
                }
        }


Thanks
-- 
Andy