bbcombotest patch (child service color)
Daniel Hartmeier
daniel at benzedrine.cx
Fri Jul 27 13:18:55 CEST 2007
I noticed that when you build services upon services (like
bbcombotest.cfg(5) suggests you may), the parent services don't properly
show the children's color in the status data part, i.e. instead of
showing "&green" or "&red", they always show up as "&unknown".
The patch below fixes this for me here.
Also, allow unescaped underscores, they are not used in operators.
Daniel
--- hobbitd/bbcombotest.c.orig 2007-07-27 13:09:57.000000000 +0200
+++ hobbitd/bbcombotest.c 2007-07-27 12:53:07.000000000 +0200
@@ -249,6 +249,8 @@
errptr = errtext;
*errptr = '\0';
+ *color = gethobbitdvalue(hostname, testname, &errptr);
+
/* First check if it is one of our own tests */
for (walk = testhead; (walk && ( (strcmp(walk->reshostname, hostname) != 0) || (strcmp(walk->restestname, testname) != 0) ) ); walk = walk->next);
if (walk != NULL) {
@@ -256,8 +258,6 @@
return walk->result;
}
- *color = gethobbitdvalue(hostname, testname, &errptr);
-
/* Save error messages */
if (strlen(errtext) > 0) {
if (*errbuf == NULL)
@@ -293,7 +293,8 @@
if (!insymbol) { insymbol = 1; symp = symbol; }
*symp = *inp; symp++;
}
- else if (insymbol && (isdigit((int) *inp) || (*inp == '.'))) {
+ else if (insymbol && (isdigit((int) *inp) || (*inp == '.') ||
+ (*inp == '_'))) {
*symp = *inp; symp++;
}
else if (insymbol && ((*inp == '\\') && (*(inp+1) > ' '))) {
More information about the Xymon
mailing list