Graphs aren't showing

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
jon_k
Posts: 5
Joined: Fri May 18, 2007 4:03 pm
Location: Texas, United States

Graphs aren't showing

Post by jon_k »

I've got cacti installed but graphs don't appear to be working. This is the first time I've installed cacti.

I've tried updating the graphs manually by running
php /var/www/cacti/poller.php

I installed the GDlib for PHP just in case.

My phpinfo(); can be found here: http://ecogaea.com/nfo.php

Please let me know if there are any further requirements I've failed to meet. Thanks.

I've tried looking in tree and list view.

I've peeked at the HTML source and found stuff like this:

Code: Select all

<img src='graph_image.php?action=view&local_graph_id=9&rra_id=1' border='0' alt='Local Linux - Disk Space - /dev/sda1'>
						</td>
I assume this is the code that links to the graphs. I've entered one of these URL's manually in my browser and it says:

Code: Select all

The image cannot be displayed [link to the image here], because it contains errors.
jon_k
Posts: 5
Joined: Fri May 18, 2007 4:03 pm
Location: Texas, United States

Post by jon_k »

An update here;

RRDTool Says:

ERROR: opening '/var/www/cacti/rra/localhost_load_1min_5.rrd': No such file or directory

It appears I have no files in my rra directory which is what makes graphs work.

Here is my attempt to generate graph files.

Code: Select all

root@dallas:/var/www/cacti# chmod 777 rra
root@dallas:/var/www/cacti# chown www-data: rra
root@dallas:/var/www/cacti# php poller.php
root@dallas:/var/www/cacti# ls -la rra/
total 8
drwxrwxrwx  2 www-data www-data 4096 2007-05-18 15:45 .
drwxr-xr-x 11 root     root     4096 2007-05-18 15:45 ..
-rw-r--r--  1 root     root        0 2007-05-18 15:45 .placeholder
root@dallas:/var/www/cacti#
Any idea why graphs aren't being generated? With these permissions it should work!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please make sure to follow http://docs.cacti.net/node/5 for installing. Especially the crontab things is important because that's where rrd files are created.
Reinhard
jon_k
Posts: 5
Joined: Fri May 18, 2007 4:03 pm
Location: Texas, United States

Post by jon_k »

gandalf wrote:Please make sure to follow http://docs.cacti.net/node/5 for installing. Especially the crontab things is important because that's where rrd files are created.
Reinhard
OK. Done. I created a user called 'cacti' for this.
cacti@dallas:/var/www/cacti$ chown cacti:cacti rra/ log/
cacti@dallas:/var/www/cacti$ php /var/www/cacti/poller.php
cacti@dallas:/var/www/cacti$ ls -la rra
total 8
drwxrwxrwx 2 cacti cacti 4096 2007-05-18 15:45 .
drwxr-xr-x 11 root root 4096 2007-05-18 15:45 ..
-rw-r--r-- 1 root root 0 2007-05-18 15:45 .placeholder
cacti@dallas:/var/www/cacti$

Still no output.

I still created the crontab entry */5 * * * * cacti php /var/www/cacti/poller.php > /dev/null 2>&1

However, what's the chances the crontab will work since manually executing php /var/www/cacti/poller.php won't populate the rra/ directory?

We'll see though. I'll monitor it.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

What's the result of calling poller.php manually? Did you configure include/config.php to setup database access?
Reinhard
jon_k
Posts: 5
Joined: Fri May 18, 2007 4:03 pm
Location: Texas, United States

Post by jon_k »

gandalf wrote:What's the result of calling poller.php manually? Did you configure include/config.php to setup database access?
Reinhard
First off let me thank you for the help you're providing. It's very appreciated! ;-)

Here's my efforts in calling poller.php manually.

root@dallas:/var/www/cacti# php /var/www/cacti/poller.php
root@dallas:/var/www/cacti#

As you can see above, there is no output from calling poller.php. In addition, no files have appeared in /var/www/cacti/rra/.

I do have the include/config.php file configured for my DB information.

Here's the relevant lines from include/config.php

Code: Select all

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "NOT_PUTTING_MY_PWD_ON_THE_NET";
$database_port = "3306";
I can verify the database is created and working correctly with the credentials above by using the mysql command line with the following method:

Code: Select all

root@dallas:/var/www/cacti/include# mysql -u cacti -pNOT_PUTTING_MY_PWD_ON_THE_NET
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 178 to server version: 5.0.22-Debian_0ubuntu6.06.3-log

mysql> use cacti;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------+
| Tables_in_cacti           |
+---------------------------+
| cdef                      |
| cdef_items                |
| colors                    |
| data_input                |
| data_input_data           |
| data_input_fields         |
| data_local                |
| data_template             |
| data_template_data        |
| data_template_data_rra    |
| data_template_rrd         |
| graph_local               |
| graph_template_input      |
| graph_template_input_defs |
| graph_templates           |
| graph_templates_gprint    |
| graph_templates_graph     |
| graph_templates_item      |
| graph_tree                |
| graph_tree_items          |
| host                      |
| host_graph                |
| host_snmp_cache           |
| host_snmp_query           |
| host_template             |
| host_template_graph       |
| host_template_snmp_query  |
| poller                    |
| poller_command            |
| poller_item               |
| poller_output             |
| poller_reindex            |
| poller_time               |
| rra                       |
| rra_cf                    |
| settings                  |
| settings_graphs           |
| settings_tree             |
| snmp_query                |
| snmp_query_graph          |
| snmp_query_graph_rrd      |
| snmp_query_graph_rrd_sv   |
| snmp_query_graph_sv       |
| user_auth                 |
| user_auth_perms           |
| user_auth_realm           |
| user_log                  |
| version                   |
+---------------------------+
48 rows in set (0.00 sec)

mysql>
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please check /etc/php.ini for extension

Code: Select all

extension=mysql.so
It may even reside in php.d/mysql.ini
If it was not enabled, please make sure to restart httpd to take effect for web usage
Reinhard
jon_k
Posts: 5
Joined: Fri May 18, 2007 4:03 pm
Location: Texas, United States

Post by jon_k »

gandalf wrote:Please check /etc/php.ini for extension

Code: Select all

extension=mysql.so
It may even reside in php.d/mysql.ini
If it was not enabled, please make sure to restart httpd to take effect for web usage
Reinhard
That wasn't /exactly/ the problem although it was very close.

phpinfo(); showed MySQL module was loaded.

Here's what I did to fix it.

I recompiled PHP with MySQL support built in and it seems to have taken care of the problem.

I really appreciate your guidance and help! Now stats /do/ appear to be generating!

Thanks!
arminp
Posts: 6
Joined: Sat May 19, 2007 10:24 pm

Post by arminp »

Hi Jon,

say since a few days I am fighting the very exact symptoms. How did you "recompile" PHP? (like what configue type switches)

Thanks a million ... trust you know how it goes if one is so close on beeing able to use this great system.


Armin :D
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests