No output returned from plugin

Stuart Browne stuart.browne at ausregistry.com.au
Thu Nov 25 00:50:04 CET 2010


> -----Original Message-----
> From: Alexander Haas [mailto:alex at geloet.de]
> Subject: Re: [Nagios-users] No output returned from plugin
> 
> Hi Stuart,
> 
> you got me on that one :)
> 
> The output did in fact contain a empty new line. I did not pay very much
> attention to this fact because my own error messages are all single
> lined. But in this actual case PHP clutters STDOUT with some error
> messages and a IMHO very disputable new line:
> > someserver:~# /usr/local/nagios/libexec/check_ftp_archived_backup -S
> > someserver -V somevolume
> >
> > Warning:
> > file(/opt/backup-sites-nagios/someserver/somevolume.sitecopyrc):
> > failed to open stream: No such file or directory in
> > /usr/local/nagios/libexec/check_ftp_archived_backup.php on line 18
> > Failed to load sitecopy config file
> > '/opt/backup-sites-nagios/someserver /somevolume.sitecopyrc'!
> Where the last line is my own and sole expected output.

Yay! Be careful of bare-lines and simple line feeds in your PHP code outside of the <?php ?> sections.

Also consider using @'s on your lines that are possibly going to fail (@file()) or wrapping the code with 'if (is_readable($file) === true&& ($string = file($file)) === true) {' type constructs.

Anyway, glad I could help :)

Stuart

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list