[racktables-users] Re: Cacti support

  • From: Jonathan Thurman <jonathan@xxxxxxxxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Thu, 1 Sep 2011 19:49:14 -0700

On Tue, Aug 30, 2011 at 9:04 PM, Sander Klein <roedie@xxxxxxxxx> wrote:

Hello Sander,
  I know you started on 0.19.8 and applied the patch, but have you
upgraded to 0.19.9?  If you could, then I can test on the same known
version that you are using.  I have a few other questions (feel free
to message me directly if you want):

 - OS and version?
 - PHP version?
 - cURL PHP plugin version?
 - Version of Cacti?

> The href is correct in the page source. When clicking/entering the URL I get
> the cacti login page, I then fill in the credentials of the account I
> created for racktables and then I see the graphs.

Good.

> The img src tag says: <img
> src='index.php?module=image&img=cactigraph&object_id=38&graph_id=699'
> alt='Cacti Graph ID: 699'>
>
> When pasting this in my browser like:
> https://racktables.xx.xx/index.php?module=image&img=cactigraph&object_id=38&graph_id=699

These looks correctly formatted.

> I get a page saying:
>
> https://racktables.xx.xx/index.php?module=image&img=cactigraph&object_id=38&graph_id=699
>
> Nothing more... see http://www.roedie.nl/downloads/misc/racktables-3.jpg

That is definitely not correct.

> When requesting the cacti tab of the object I see the following in the
> access.log of the cacti server:
>
> 2001:67c:xxx:xx::x - - [31/Aug/2011:05:30:46 +0200] "GET
> /graph_image.php?action=view&local_graph_id=1 HTTP/1.1" 200 4171 "-" "-"
> 2001:67c:xxx:xx::x - - [31/Aug/2011:05:30:46 +0200] "POST
> /graph_image.php?action=view&local_graph_id=1 HTTP/1.1" 302 85 "-" "-"
> 2001:67c:xxx:xx::x - - [31/Aug/2011:05:30:46 +0200] "POST
> /graph_image.php?action=view&local_graph_id=1 HTTP/1.1" 200 15358 "-" "-"

These look correct, and the last one shows a response size of 15358,
which looks right for an image.

> So it does resolve the host and makes the connection. There's nothing in the
> cacti error log neither in the racktables error log.

One thing that I see in the RackTables code is that the ContentType
defaults to 'text/plain' if the curl_getinfo function does not return
a content type.  Depending on your version of Cacti, maybe the
ContentType header is not being set correctly.

You seem to be using FireFox, so to check this:
 - Right-Click on the page and select "View Page Info"
 - Select the Media tab
 - Look for the image URL in the Address list
 - Click on the URL

It should tell you what type of image it is (PNG Image in my case).
What does yours say?

-Jonathan

Other related posts: