[Nagiosplug-devel] Debugging plugins: hack the command line with a ' 2>&1' to see the yelps.

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Tue May 13 17:05:02 CEST 2003


Dear Ladies and gentlemen

These are the times that try mens souls ..

After seeing quite a lot of noise about 'No output!' from plugins 
(frequently Perl plugins), perhaps it may help to patch checks.c and 
utils.c so that the command line passed to popen() has the string ' 
2>&1' appended to it, possibly under control of a compile time constant 
(#ifdef DEBUG6).

This may give the viewer any complaints/messages/bitches from the plugin
or from the plugin runtime (Perl, Java, TCL, Python, Ruby) when the
language processor can't find util.pm or something else goes wrong ...

I am posting this to nag plugin-dev also since the change could either
 
. be done there (in spopen()) instead

. a new coding guideline be added to recommend that plugin writers trap 
stderr (by dup'ing stdout, dup2(), *STDERR = *STDOUT etc etc)

Your comments are welcome. 

Yours sincerely.


-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.




More information about the Devel mailing list