Change request: FNPATTERN matching string

Francesco Duranti fduranti at q8.it
Sat Sep 30 19:45:38 CEST 2006


Hi Henrik, just another little request.
The FNPATTERN is matched as a regular expression and this could is some
situation cause problems matching the right file.
For example I'm creating some rrd named xtradisk,diskname.rrd and they
get matched with the normal disk test and I start to not get any disk
graphs from disk and trend column.
The simple solution is to put a "^" in front of the disk in the
hobbitgraph.cfg. This is good for this test until the next one that will
try to get wrong data.
>From how the rrd are organized it make (at least to me) sense to have
the FNPATTERN match directly against ^somedefinition because all graphs
defined until now have the pattern in the form of
testname_followed_by_something_else.

The line responsible for the FNPATTERN is line 286 of web/hobbitgraph.c
and changing it from:
                        newitem->fnpat = strdup(p);

To 

                        newitem->fnpat=malloc(strlen(p)+2);
                        strcpy(newitem->fnpat,"^");
                        strcat(newitem->fnpat,p);
 

Will do the trick (at least it seem to work).

If in the future there's the necessity to define a pattern in the middle
of the file it will be simply matched with a FNPATTER .*something so it
should not create problems to other tests/graphs but will definitely
create less problem with disk or data having something like disk inside
of them.

Francesco



More information about the Xymon mailing list