[Nagiosplug-devel] printf calls in library functions

Matthias Eble matthias.eble at mailing.kaufland-informationssysteme.com
Mon Jul 23 15:18:54 CEST 2007


> My initial feeling is to not use stderr at all and all errors go to  
> stdout.
Makes sense to me, too - If the output is guaranteed to be formated 
properly.

> Usually when you have errors in the library, it is left to the  
> calling program can decide what to do with the error.

Problem is, that the return value needs to be a struct with a numeric 
and a string value in that case.

> But in our  
> case, I think we could always exit with UNKNOWN and the error  
> message. This would also have the advantage of having a consistent  
> error message and simpler programming at the plugin level.
If I got it right, the definition of UNKNOWN in the guidelines won't let 
us do so in every case(strictly speaking).
We could introduce a global variable containing the short upper case 
service name (eg DISK)to also print it in library functions.
This might, but hopefully won't affect translation strings.

> For warnings type messages, it would make sense to use the verbosity  
> flag (though I'm not sure of any examples right now).

I can't remember to having seen some cases where this would be needed, too.

>> Btw: Why are the sslutils, etc located in the plugin directory?
> 
> Historical. We had issues compiling from an external directory  
> before. I'm happy to have them moved to lib/ now that the  
> infrastructure is in place to allow this easily.

Fine. Let's move them after switching to svn.

Matthias





More information about the Devel mailing list