mostafamemariani / mysql-cacti-templates

Automatically exported from code.google.com/p/mysql-cacti-templates
GNU General Public License v2.0
0 stars 0 forks source link

blank line insertion whith ss_get_by_ssh.php #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The script ss_get_by_ssh.php insert a blank line before returning results (see 
below). So the cacti pooler fails.

admin@ns61035 /var/www/admin/htdocs/cacti3/scripts $  /usr/bin/php  
/var/www/admin/htdocs/cacti3/scripts/ss_get_by_ssh.php --host www.example.net 
--type apache --items a2,a3 --nocache 1 --nocache 1

a2:220 a3:255admin@ns61035 /var/www/admin/htdocs/cacti3/scripts $

Original issue reported on code.google.com by ghislain...@gmail.com on 15 Nov 2010 at 8:02

GoogleCodeExporter commented 8 years ago
Thanks.  I have other servers running with this, and they don't insert a blank 
line, so I can't reproduce it.  Can you check your configuration file and 
ensure that it doesn't have any blank lines in it?  If it's not that, maybe you 
can find out where the blank line comes from?

Original comment by baron.schwartz on 15 Nov 2010 at 10:10

GoogleCodeExporter commented 8 years ago
Hello Baron

Thanks you for your reactivity.
I check the conf, and yes there were a blank line at the end. Removed it solved 
the problem.

Thanks again for this very usefull and great cacti-templates.

Cheers

Original comment by ghislain...@gmail.com on 16 Nov 2010 at 8:18

GoogleCodeExporter commented 8 years ago

Original comment by baron.schwartz on 16 Nov 2010 at 1:38

GoogleCodeExporter commented 8 years ago
I had this problem too and it took quiet long for me to figure out what is 
wrong. I suggest to not use PHP closing tag in configuration file to avoid this 
problem.

"For files that contain only PHP code, the closing tag ("?>") is never 
permitted. It is not required by PHP, and omitting it´ prevents the accidental 
injection of trailing white space into the response." (from: 
http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html)

Original comment by stefan.w...@gmail.com on 11 Aug 2011 at 7:45

GoogleCodeExporter commented 8 years ago
I did not know about that convention to avoid whitespace.  I'll fix this.

Original comment by baron.schwartz on 13 Aug 2011 at 8:00

GoogleCodeExporter commented 8 years ago
Marking for migration / fixing in a new project.

Original comment by baron.schwartz on 4 Jan 2012 at 6:21

GoogleCodeExporter commented 8 years ago
Fixed in new repository.

Original comment by baron.schwartz on 25 Jan 2012 at 1:44