-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nagios plugin doesn't really work with --enable-debug #105
Comments
|
IMHO when debug mode is enabled, all corresponding data should go to STDERR instead of STDIN. diff -ru collectd-5.1.0.ori/src/libcollectdclient/client.c collectd-5.1.0/src/libcollectdclient/client.c
--- collectd-5.1.0.ori/src/libcollectdclient/client.c 2012-04-17 13:50:04.000000000 +0200
+++ collectd-5.1.0/src/libcollectdclient/client.c 2012-04-17 13:55:42.000000000 +0200
@@ -87,7 +87,7 @@
} while (0)
#if COLLECT_DEBUG
-# define LCC_DEBUG(...) printf (__VA_ARGS__)
+# define LCC_DEBUG(...) fprintf (stderr, __VA_ARGS__)
#else
# define LCC_DEBUG(...) /**/
#endif |
|
On Thu, Jul 19, 2012 at 04:20:37AM -0700, Fabien Wernli wrote:
Thanks; the point is that it should be the upstream behaviour. ---- WBR, Michael Shigorin mike@altlinux.ru |
|
Point taken, let's see what ff and sh comment about this. As they are quite busy, I usually add a pull request, and patches to my packages until it's accepted upstream. |
|
Hi Michael, good point. I don't really like having debugging output on STDERR, but then libraries shouldn't print to STDOUT either. What do you think about this compromise: Write debug output to STDOUT only when there is a controlling terminal. @tokkee Do you have another clever idea how to handle this? Best regards, |
|
On Mon, Sep 10, 2012 at 12:50:19PM -0700, Florian Forster wrote:
Meaning "write debug to stdout at tty, otherwise don't write ---- WBR, Michael Shigorin mike@altlinux.ru |
|
Hi, On Mon, Sep 10, 2012 at 12:50:20PM -0700, Florian Forster wrote:
Any other reason apart from "I don't like"? my 2 cents here |
|
On Tue, Sep 11, 2012 at 07:35:01AM -0700, Fabien Wernli wrote:
A prefix like [debug] or module name might help with that either. ---- WBR, Michael Shigorin mike@altlinux.ru |
|
You could do something like open a new debug file handle, which may or may not be the same as /dev/null, stderr, etc. Looks like x264 just prefixes it. |
|
using an environment variable is quite elegant too, e.g. COLLECTD_TRACE=1 or COLLECTD_TRACE=/tmp/collectd-debug.log |
|
Hi, I think I like the idea of using an environment variable better than my previous idea of testing for a controlling terminal. The terminal check has the problem, that users might want to grep for some debugging message they see and end up with empty results, which is a hard situation to debug if you're not aware of the behavior. The environment variable, on the other hand, is easy to look up if you want to know how to enable debugging … Best, |
|
On Fri, Nov 09, 2012 at 11:47:20PM -0800, Florian Forster wrote:
The same here :) ---- WBR, Michael Shigorin mike@altlinux.ru |
|
COLLECTD_TRACE it shall be then |
I'm packaging collectd for ALT Linux; a user reported an issue with nagios plugin in 5.1.0, the brief translation follows:
Nagios interface (particularly the service status cell) shows:
send: --> GGETVAL "host.node/load/load"
instead of
0 critical, 0 warning, 1 okay
The fix was to configure
--disable-debugbut it's not a really great fix I guess.The original bugreport in Russian is here: https://bugzilla.altlinux.org/27548
The text was updated successfully, but these errors were encountered: