Realtime (graph), v0.33

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
GZH
Posts: 1
Joined: Wed Jul 02, 2008 2:28 am

mm

Post by GZH »

Hum ... ;)

I can't modify the cache directory via "Settings->Misc" ..

Cacti version : 0.8.6i
Realtime version : 0.34


*********
François
Attachments
cacti problem.jpeg
cacti problem.jpeg (35.68 KiB) Viewed 17835 times
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

For fix error like this:

Code: Select all

....
PHP Warning:  include(./include/config.php): failed to open stream: No such file or directory in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 37
PHP Warning:  include(): Failed opening './include/config.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 37
PHP Notice:  Undefined variable: config in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 39
PHP Warning:  include_once(/lib/snmp.php): failed to open stream: No such file or directory in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 39
PHP Warning:  include_once(): Failed opening '/lib/snmp.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 39
PHP Notice:  Undefined variable: config in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 40
....

Change cmd_rt.php and poller_rt.php:
before:

Code: Select all

/* we are not talking to the browser */
$no_http_headers = true;

/* start initialization section */
chdir("../../");
if (file_exists("./include/global.php")) {
	include("./include/global.php");
} else {
	include("./include/config.php");
}
after:

Code: Select all

/* we are not talking to the browser */
$no_http_headers = true;

/* start initialization section */

$dir = dirname(__FILE__);
chdir($dir);

if (strpos($dir, 'realtime') !== false) {
	chdir('../../');
}

if (file_exists("./include/global.php")) {
	include("./include/global.php");
} else {
	include("./include/config.php");
}
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Post by gthe »

May be one more fix.
In my FF 3 realtime window don't open popup, but just like simple page.
I change setup.php, line 140:
before:
echo "<a href='#' onclick=\"window.open('".$config['url_path']."plugins/realtime/graph_popup_rt.php?local_graph_id=".$local_graph_id."', 'popup_".$local_graph_id."', 'toolbar=no, menubar=no, location=no, scrollbars=no, statusbar=no, titlebar=no, width=650, height=350')\"><img src='".$config['url_path']."plugins/realtime/monitor_rt.gif' border='0' alt='Realtime' title='Realtime' style='padding: 3px;'></a><br/>";
after:
echo "<a href='#' onclick=\"window.open('".$config['url_path']."plugins/realtime/graph_popup_rt.php?local_graph_id=".$local_graph_id."', 'popup_".$local_graph_id."', 'toolbar=no, menubar=no, location=no, scrollbars=no, statusbar=no, titlebar=no, dialog=yes, width=650, height=350')\"><img src='".$config['url_path']."plugins/realtime/monitor_rt.gif' border='0' alt='Realtime' title='Realtime' style='padding: 3px;'></a><br/>";
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Hmm, that's new. It seems to work on my ff3 box running on windows.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Post by chrisgapske »

I have installed Realtime and created a temp dir giving RW access to all. when I go to the settings I can see that the DIR has been found.

The Realtime button does not show up .. But I can see in the plugin management it is there.

Any Idea.. I don't see any errors.
dononeil
Cacti User
Posts: 194
Joined: Wed Aug 06, 2008 4:45 pm

Post by dononeil »

I'm not able to get graphs to show up with v.34 (the official v.34) version under cacti 0.8.7b...

At one point it was working, and then I updated a bunch of libs, rrd, etc.. and it stopped working, but I don't know why. Everything else works great, just not the realtime.

Here are the symptoms:

You click on the realtime icon and the window comes up, but the graph is just a red X.

There are no files being generated in /cache - Cacti is being run as ROOT, and directory perms are 777 for debug.

When you run debug logging, alot of SQL queries are being made, and a call to rrdtool for the cache file that wasn't generated, no errors anywhere that looks obvious.

It seems that the issue is just that the cache files aren't being created, possibly due to a path issue? Here's the output from the apache logs:

PHP Warning: include(./include/config.php): failed to open stream: No such file or directory in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 32
PHP Warning: include(): Failed opening './include/config.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 32
PHP Notice: Undefined variable: config in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 34
PHP Warning: include_once(/lib/poller.php): failed to open stream: No such file or directory in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 34
PHP Warning: include_once(): Failed opening '/lib/poller.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 34
PHP Notice: Undefined variable: config in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 35
PHP Warning: include_once(/lib/data_query.php): failed to open stream: No such file or directory in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 35
PHP Warning: include_once(): Failed opening '/lib/data_query.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 35
PHP Notice: Undefined variable: config in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 36
PHP Warning: include_once(/lib/graph_export.php): failed to open stream: No such file or directory in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 36
PHP Warning: include_once(): Failed opening '/lib/graph_export.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 36
PHP Notice: Undefined variable: config in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 37
PHP Warning: include_once(/lib/rrd.php): failed to open stream: No such file or directory in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 37
PHP Warning: include_once(): Failed opening '/lib/rrd.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 37
PHP Fatal error: Call to undefined function read_config_option() in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 102
ERROR: opening '/www/cacti/cache/realtime_647_5.rrd': No such file or directory

Anyone have any clues?
dononeil
Cacti User
Posts: 194
Joined: Wed Aug 06, 2008 4:45 pm

Post by dononeil »

Ok... I fixed the path issue by changing the includes to be this:

if (file_exists("../../include/global.php")) {
include("../../include/global.php"); }

if (file_exists("../../include/config.php")) {
include("../../include/config.php"); }

However, the rrd files are still not being created in the cache directory:

PHP Fatal error: Call to undefined function read_config_option() in /srv/www/htdocs/cacti/plugins/realtime/poller_rt.php on line 102
ERROR: opening '/www/cacti/cache/realtime_647_5.rrd': No such file or directory

When I changed the other paths, I get that it can't find the libraries, so I hard coded the paths... now I get:

PHP Notice: Undefined variable: colors in /srv/www/htdocs/cacti/lib/graph_export.php on line 1741
PHP Fatal error: Call to undefined function read_config_option() in /srv/www/htdocs/cacti/lib/graph_export.php on line 1742
ERROR: opening '/www/cacti/cache/realtime_647_5.rrd': No such file or directory

Any thoughts where to go from here? The line 1741 is referencing $colors["header_panel"]. I have no idea where that is defined, or what it should be... Maybe this is a bug in Cacti?
gworg
Posts: 2
Joined: Tue Aug 12, 2008 5:13 pm

Access Denied

Post by gworg »

I have looked at this whole list, but I can't seem to find my issue....all I get is this, in the popup window....

You are not permitted to access this section of Cacti. If you feel that you need access to this particular section, please contact the Cacti administrator.

It looks like this is coming from auth.php, but I can't figure it out. I set all of directory perms, correctly, and nothing is showing up in any logs....anyone?
gworg
Posts: 2
Joined: Tue Aug 12, 2008 5:13 pm

Re: Access Denied

Post by gworg »

gworg wrote:I have looked at this whole list, but I can't seem to find my issue....all I get is this, in the popup window....

You are not permitted to access this section of Cacti. If you feel that you need access to this particular section, please contact the Cacti administrator.

It looks like this is coming from auth.php, but I can't figure it out. I set all of directory perms, correctly, and nothing is showing up in any logs....anyone?

Sorry....I found it. I just notice the perm that I need to apply for users...Thanks.
khufure
Cacti User
Posts: 203
Joined: Wed Oct 24, 2007 5:47 pm
Location: San Francisco, CA
Contact:

Post by khufure »

gthe wrote:For fix error like this:

Code: Select all

....
PHP Warning:  include(./include/config.php): failed to open stream: No such file or directory in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 37
PHP Warning:  include(): Failed opening './include/config.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 37
PHP Notice:  Undefined variable: config in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 39
PHP Warning:  include_once(/lib/snmp.php): failed to open stream: No such file or directory in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 39
PHP Warning:  include_once(): Failed opening '/lib/snmp.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 39
PHP Notice:  Undefined variable: config in /var/www/html/cacti/plugins/realtime/cmd_rt.php on line 40
....

Change cmd_rt.php and poller_rt.php:
before:

Code: Select all

/* we are not talking to the browser */
$no_http_headers = true;

/* start initialization section */
chdir("../../");
if (file_exists("./include/global.php")) {
	include("./include/global.php");
} else {
	include("./include/config.php");
}
after:

Code: Select all

/* we are not talking to the browser */
$no_http_headers = true;

/* start initialization section */

$dir = dirname(__FILE__);
chdir($dir);

if (strpos($dir, 'realtime') !== false) {
	chdir('../../');
}

if (file_exists("./include/global.php")) {
	include("./include/global.php");
} else {
	include("./include/config.php");
}
This fix worked for me. Realtime-0.34, 0.87b + PIA2.1, running on Linux.

Edit : btw, I had to turn off ajax to make firefox3 like it.

Great plug-in, thanks all!
danwdoo
Cacti User
Posts: 50
Joined: Thu Oct 26, 2006 11:42 pm

Fixed mine too

Post by danwdoo »

khufure's change fixed my realtime that was having the same issues. I have all the same versions as well except mine is running on Windows.

Thanks!
Danny
dononeil
Cacti User
Posts: 194
Joined: Wed Aug 06, 2008 4:45 pm

Post by dononeil »

I'm running realtime v.35 (from the SVN on 8/15/08, the last time I updated it) and it's working great EXCEPT that my graphs are being cut off on the bottom (see attached).

Any way to fix this so it scales the window correctly? Seems like it's always cutting off 50 pixels or so.

This is with IE7. Mozilla doesn't seem to have this problem.
Attachments
realtime.PNG
realtime.PNG (30.03 KiB) Viewed 16657 times
abdulcc
Cacti User
Posts: 52
Joined: Fri Jul 14, 2006 7:06 am

I keep on getting this sql error when using realtime

Post by abdulcc »

cmd_rt.php

9/26/2008 05:58:58 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1054', SQL:"select graph_templates_item.id as graph_templates_item_id, graph_templates_item.cdef_id, graph_templates_item.text_format, graph_templates_item.value, graph_templates_item.hard_return, graph_templates_item.consolidation_function_id, graph_templates_item.graph_type_id, graph_templates_gprint.gprint_text, colors.hex, graph_templates_item.alpha, data_template_rrd.id as data_template_rrd_id, data_template_rrd.local_data_id, data_template_rrd.rrd_minimum, data_template_rrd.rrd_maximum, data_template_rrd.data_source_name, data_template_rrd.local_data_template_rrd_id from graph_templates_item left join data_template_rrd on (graph_templates_item.task_item_id=data_template_rrd.id) left join colors on (graph_templates_item.color_id=colors.id) left join graph_templates_gprint on (graph_templates_item.gprint_id=graph_templates_gprint.id) where graph_templates_item.local_graph_id=617 order by graph_templates_item.sequence"
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

dononeil wrote:I'm running realtime v.35 (from the SVN on 8/15/08, the last time I updated it) and it's working great EXCEPT that my graphs are being cut off on the bottom (see attached).

Any way to fix this so it scales the window correctly? Seems like it's always cutting off 50 pixels or so.

This is with IE7. Mozilla doesn't seem to have this problem.
It's the status bar. The differences between IE and everyone else drive me absolutely nuts. I think I detected the browser version and changed the size of the window depending on it. You need to look at that JS code and simply enlarge the palying field a little more.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
kokkers
Posts: 16
Joined: Thu Feb 16, 2006 6:00 am

Post by kokkers »

I am successfully running v34, on 8.7b with Plugin architeture 2.1.
The plugin would not run without altering cmd_rt.php and poller_rt.php as specified by user gthe.

I really like this plug-in! It is very usable when alot more 'accuracy' is required. Like 'live STG' but with Cacti flexibility.

Kudo's for the effort!

I am no coder myself but what would be nice to see in this plug-in:
- It takes around 4 seconds to load an updated graph image. Would it be possible to load the new graph in the background and replacing the old graph only when the new version is available? This would minimize the 'blank' time in between graphs. The progess bar could then be placed below the graph indicating loading time. I think this would make the plug-in look and feel alot more responsive.
- The auto-resize on reload is a bit annoying
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests