Nrpe and reiserfs
Gerhard Lausser
Gerhard.Lausser at consol.de
Thu Apr 6 22:06:20 CEST 2006
Hi Ethan,
i stumbled over a bug in reiserfs, when i was desperately trying to find out
why an include_dir= statement in my nrpe.cfg was ignored.
In the read_config_dir function you wrote:
#ifdef _DIRENT_HAVE_D_TYPE
/* only process normal files */
if(dirfile->d_type!=DT_REG)
continue;
#endif
which is completely correct.
BUT:
- Linux defines _DIRENT_HAVE_D_TYPE
- readdir for a reiserfs ALWAYS returns DT_UNKNOWN as d_dtype
so always the continue statement will be executed and the configfile will be
ignored.
I made a patch which uses stat and the S_ISREG and S_ISDIR macros instead of
d_type, which also should work on systems without _DIRENT_HAVE_D_TYPE.
Greetings from Munich,
Gerhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nrpe-2.5.reiserfs.patch
Type: application/octet-stream
Size: 1864 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060406/6c6f9493/attachment.obj>
More information about the Developers
mailing list