I am trying to patch my hobbit installation and stop using extra-rrd.pl and
start using do_devmon.c. But when applying the patch I get these errors:
patching file hobbit-4.2.0/lib/hobbitrrd.c
patching file hobbit-4.2.0/lib/htmllog.c
Hunk #1 FAILED at 318.
Hunk #2 FAILED at 349.
Hunk #3 FAILED at 366.
3 out of 3 hunks FAILED -- saving rejects to file
hobbit-4.2.0/lib/htmllog.c.rej
patching file hobbit-4.2.0/hobbitd/etcfiles/hobbitserver.cfg.DIST
patching file hobbit-4.2.0/hobbitd/do_rrd.c
patching file hobbit-4.2.0/web/hobbitsvc.c
Here is the htmllog.c.rej output:
***************
*** 318,324 ****
}
if (rrd && graph) {
char *p, *multikey;
- if (multigraphs == NULL) multigraphs = ",disk,inode,qtree,";
/*
* Some reports (disk) use the number of lines as a rough
measure for how many
--- 318,326 ----
}
if (rrd && graph) {
char *p, *multikey;
+ int found_rrd = 1;
+ if (!strncmp(rrd->hobbitrrdname,"devmon",6)) found_rrd=0;
+ if (multigraphs == NULL) multigraphs =
",disk,inode,qtree,if_load,";
/*
* Some reports (disk) use the number of lines as a rough
measure for how many
***************
*** 347,352 ****
/* We found something that
is not blank, so one more line */
if (!netwarediskreport)
linecount++;
}
/* Then skip forward to the EOLN */
p = strchr(p, '\n');
}
--- 349,361 ----
/* We found something that
is not blank, so one more line */
if (!netwarediskreport)
linecount++;
}
+ if (strlen(p) > 10 && *p == '<' ) {
+ /* Check if this is a devmon
RRD header, reset the linecount to -2, as we will see a DS line and a Devmon
ban
ner*/
+ if(!strncmp(p,
"<!--DEVMON",10)) {
+ linecount = -2;
+ found_rrd=1;
+ }
+ }
/* Then skip forward to the EOLN */
p = strchr(p, '\n');
}
***************
*** 357,364 ****
}
xfree(multikey);
fprintf(output, "<!-- linecount=%d -->\n", linecount);
fprintf(output, "%s\n", hobbit_graph_data(hostname,
displayname, service, color, graph, linecount, HG_WITHOUT_STALE_RRDS,
HG_PLAIN_LINK));
}
if (histlocation == HIST_BOTTOM) {
--- 366,376 ----
}
xfree(multikey);
+ /* Avoid graph icons if a specific host has no rrd data */
+ if (found_rrd ==1 ) {
fprintf(output, "<!-- linecount=%d -->\n", linecount);
fprintf(output, "%s\n", hobbit_graph_data(hostname,
displayname, service, color, graph, linecount, HG_WITHOUT_STALE_RRDS,
HG_PLAIN_LINK));
+ }
}
if (histlocation == HIST_BOTTOM) {
Thanks
Josh
|