[Nagiosplug-devel] printf calls in library functions

Matthias Eble matthias.eble at mailing.kaufland-informationssysteme.com
Sun Jul 22 19:08:18 CEST 2007


Hi list,

we have an item in the Bugtracker (#1681516) that claims, that the 
output for various checks is too verbose due to printf statements in 
some library functions (for example netutils and sslutils).

Example:
 > ./check_http -H foo -S
 >Name or service not known
 >HTTP CRITICAL - Unable to open TCP socket


I'd like to know what you think about printing to stdout/stderr in a 
library. I see two possibilities to solve the issue:

1st: Always die on an error in a library (accepting the lack of the 
plugin name string in the output.
2nd: Add a verbosity argument to the library functions

Maybe both could be combined and written down in the guidelines. What do 
you think? Btw: Why are the sslutils, etc located in the plugin directory?

Matthias







More information about the Devel mailing list