No Graphs on new installation

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

Moderators: Developers, Moderators

bitnoise
Posts: 11
Joined: Thu May 18, 2006 4:43 am

Post by bitnoise »

I had this same issue when I had problems before... with username and pass ran for the cacti poller...

Check the permission on the rdd files in the rra folder... if they are root.. they it won't work..(normally your cacti user will poll and he doesn't have the right to update those files)

you can also just try emptying the content of the rra folder (maybe create a subfolder and throw all existing files in there)

then run php cmd.php again, but only as cactiuser..
hammerwalk
Posts: 24
Joined: Wed Mar 05, 2008 10:46 pm
Location: Fort Worth, TX

Post by hammerwalk »

thats the problem, there is nothing in the rra folder, there is nothing in the log folder either. here are the permissions...

-=(( root = Samba ))=-
( /var/www/html/cacti )
# ll
total 827
-rw-r--r-- 1 root root 6387 2008-02-11 18:57 about.php
-rw-r--r-- 1 root root 4612 2008-02-11 18:57 auth_changepassword.php
-rw-r--r-- 1 root root 11498 2008-02-11 18:57 auth_login.php
-rw------- 1 root root 124294 2008-02-11 18:57 cacti.sql
-rw-r--r-- 1 root root 12960 2008-02-11 18:57 cdef.php
drwxr-xr-x 2 root root 1024 2008-02-11 18:57 cli/
-rw-r--r-- 1 root root 18369 2008-02-11 18:57 cmd.php
-rw-r--r-- 1 root root 5765 2008-02-11 18:57 color.php
-rw-r--r-- 1 root root 23279 2008-02-11 18:57 data_input.php
-rw-r--r-- 1 root root 33923 2008-02-11 18:57 data_queries.php
-rw-r--r-- 1 root root 49265 2008-02-11 18:57 data_sources.php
-rw-r--r-- 1 root root 31304 2008-02-11 18:57 data_templates.php
drwxr-xr-x 4 root root 1024 2008-02-11 18:57 docs/
-rw-r--r-- 1 root root 5958 2008-02-11 18:57 gprint_presets.php
-rw-r--r-- 1 root root 3404 2008-02-11 18:57 graph_image.php
-rw-r--r-- 1 root root 11550 2008-02-11 18:57 graph.php
-rw-r--r-- 1 root root 7716 2008-02-11 18:57 graph_settings.php
-rw-r--r-- 1 root root 13828 2008-02-11 18:57 graphs_items.php
-rw-r--r-- 1 root root 37125 2008-02-11 18:57 graphs_new.php
-rw-r--r-- 1 root root 50544 2008-02-11 18:57 graphs.php
-rw-r--r-- 1 root root 9945 2008-02-11 18:57 graph_templates_inputs.php
-rw-r--r-- 1 root root 18482 2008-02-11 18:57 graph_templates_items.php
-rw-r--r-- 1 root root 25042 2008-02-11 18:57 graph_templates.php
-rw-r--r-- 1 root root 29052 2008-02-11 18:57 graph_view.php
-rw-r--r-- 1 root root 5758 2008-02-11 18:57 graph_xport.php
-rw-r--r-- 1 root root 50228 2008-02-11 18:57 host.php
-rw-r--r-- 1 root root 18045 2008-02-11 18:57 host_templates.php
drwxr-xr-x 2 root root 2048 2008-02-11 18:57 images/
drwxr-xr-x 5 root root 1024 2008-03-08 14:27 include/
-rw-r--r-- 1 root root 2242 2008-02-11 18:57 index.php
drwxr-xr-x 2 root root 1024 2008-02-11 18:57 install/
drwxr-xr-x 3 root root 1024 2008-02-11 18:57 lib/
-rw-r--r-- 1 root root 15141 2008-02-11 18:57 LICENSE
drwxr-xr-x 2 cactiuser cactiuser 1024 2008-03-08 12:13 log/
-rw-r--r-- 1 root root 2451 2008-02-11 18:57 logout.php
-rw-r--r-- 1 root root 4306 2008-02-11 18:57 poller_commands.php
-rw-r--r-- 1 root root 2243 2008-02-11 18:57 poller_export.php
-rw-r--r-- 1 root root 14960 2008-02-11 18:57 poller.php
-rw-r--r-- 1 root root 71 2008-02-11 18:57 README
drwxr-xr-x 5 root root 1024 2008-02-11 18:57 resource/
drwxr-xr-x 2 cactiuser cactiuser 1024 2008-02-11 18:57 rra/
-rw-r--r-- 1 root root 7084 2008-02-11 18:57 rra.php
drwxr-xr-x 2 root root 1024 2008-02-11 18:57 scripts/
-rw-r--r-- 1 root root 7304 2008-02-11 18:57 script_server.php
-rw-r--r-- 1 root root 353 2008-02-11 18:57 script_server.pl
-rw-r--r-- 1 root root 4996 2008-02-11 18:57 settings.php
-rw-r--r-- 1 root root 158 2008-03-08 15:43 snmp.conf
-rw-r--r-- 1 root root 6667 2008-02-11 18:57 templates_export.php
-rw-r--r-- 1 root root 6524 2008-02-11 18:57 templates_import.php
-rw-r--r-- 1 root root 17835 2008-02-11 18:57 tree.php
-rw-r--r-- 1 root root 41776 2008-02-11 18:57 user_admin.php
-rw-r--r-- 1 root root 48852 2008-02-11 18:57 utilities.php

-=(( root = Samba ))=-
( /var/www/html/cacti )
#
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1


here is what is in side of /rra
-=(( root = Samba ))=-
( /var/www/html/cacti/rra )
# ls

-=(( root = Samba ))=-
( /var/www/html/cacti/rra )
#

and /log (i have the highest level of log turned on btw...)
-=(( root = Samba ))=-
( /var/www/html/cacti/log )
# ll
total 0
-rw-r--r-- 1 cactiuser cactiuser 0 2008-03-08 00:11 cacti.log

-=(( root = Samba ))=-
( /var/www/html/cacti/log )
#


This looks like a kick ass monitoring tool, which i need dearly, if I could just get it to work. I greatly appreciate all of your help. I have also been consulting with some linux gurus that I know, but Cacti and snmp , and php is out of their relm.
bitnoise
Posts: 11
Joined: Thu May 18, 2006 4:43 am

Post by bitnoise »

Well.. the only thing I see is that it seems that you created a user cactiuser, who's in the group called cactiuser.

The user who runs the poll command should be this cactiuser...

so:
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
this par should be run by your cactiuser.. I think like this.. it errors sometimes..

If you got webmin, then go into the scheduled cron jobs and make sure this job runs with cactiuser..

else do a
su - cactiuser
crontab -e

and then paste that command line.. this way your cronjob will work at least correctly..

When you tried running "php cmd.php" did the script then create something? Coss if not, it seems that you're pointing to the wrong directory then...
hammerwalk
Posts: 24
Joined: Wed Mar 05, 2008 10:46 pm
Location: Fort Worth, TX

Post by hammerwalk »

ok, I am getting closer...

if i switch to cactiuser from a regulare user and run cmd.php i get this ...

-=(( xxxxx = Samba ))=-
( /var/www/html/cacti/rra )
$ su cactiuser
Password:

-=(( cactiuser = Samba ))=-
( /var/www/html/cacti/rra )
$ cd ..

-=(( cactiuser = Samba ))=-
( /var/www/html/cacti )
$ php cmd.php
X-Powered-By: PHP/5.2.1
Content-type: text/html


-=(( cactiuser = Samba ))=-
( /var/www/html/cacti )
$


but if i su to cactiuser from root and do the exact same , i get this...

-=(( root = Samba ))=-
( /var/www/html/cacti/rra )
# su cactiuser

-=(( cactiuser = Samba ))=-
( /var/www/html/cacti/rra )
$ cd ..

-=(( cactiuser = Samba ))=-
( /var/www/html/cacti )
$ php cmd.php
PHP Warning: PHP Startup: imap: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'snmp' already loaded in Unknown on line 0
ALERT - script tried to increase memory_limit to 67108864 bytes which is above the allowed value (attacker 'REMOTE_ADDR not set', file '/var/www/html/cacti/cmd.php', line 33)
03/09/2008 04:38:13 PM - CMDPHP: Poller[0] Time: 0.0940 s, Theads: N/A, Hosts: 1

-=(( cactiuser = Samba ))=-
( /var/www/html/cacti )
$


can some one make sense of this for me? I am now getting graphs, sort of.
bitnoise
Posts: 11
Joined: Thu May 18, 2006 4:43 am

Post by bitnoise »

I surely hope some expert will kick in now.. coss I don't know it any further now.. sorry..
hammerwalk
Posts: 24
Joined: Wed Mar 05, 2008 10:46 pm
Location: Fort Worth, TX

Post by hammerwalk »

It's all good, I greatly appreciate all of you help. Thanks!
saya
Cacti User
Posts: 58
Joined: Wed Jan 16, 2008 10:56 pm

Post by saya »

hello, I got the similar problem with you:

Code: Select all

SMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error: '1146', SQL: "SELECT name, file, function FROM plugin_hooks WHERE status=1 AND hook='poller_output'"
so I searched for error 1146. it's a mysql error that table not exist
so I go to mysql to run
mysql>SHOW TABLES FROM cacti;
to find that there's no table called plugin_hooks

but I dont know how to fix it
-----------
perhaps i am missing a perl package....

-=(( cactiuser = Samba ))=-
( /var/www/html/cacti/scripts )
$ perl linux_memory.pl
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
And how did you fix this?
----------------
and I run php cmd.php in cacti directory
I can only get like:
content-type:text/html
X-powered-by: php/4.3.9
03/10/2008 10:39:52AM -CMDPHP: Poller[0]Time: 29.5017s, Theads: N/A, hosts:53
is it a normal output?

Thanks a lot!!!
hammerwalk
Posts: 24
Joined: Wed Mar 05, 2008 10:46 pm
Location: Fort Worth, TX

Post by hammerwalk »

Honestly, I am not so sure, I found it by accident. There is some odd permissions issue going on from what I have experienced. I just so happened to go from a regular user login that i use for day to day stuff then went into root to do some editing, then from root su to cactiuser, and ran the php cmd.php and all of a sudden it worked, graphs came up and i started to see activity in my logs and .rrd's were being created and all that jazz. But since then i have lost it again and only the graph axis shows up with no data to show.

I am new to PHP and MySQL on all this so I dont understand fully where the root problem is. But for some odd reason if I go from normal login, to cactiuser , nothing happens, its only when i go from root to cacti user, go figure.

As soon as I get a for sure fix when I can duplicate the problem everytime I will definitly post it here. THere is something out of the norm that we are not seeing, thats the only thing I really dont care for in linux distro's, they can all be unique in some way or another to do the exact same thing.
hammerwalk
Posts: 24
Joined: Wed Mar 05, 2008 10:46 pm
Location: Fort Worth, TX

Differences in Distrobutions

Post by hammerwalk »

Well I said earlier that I would come back and post my findings of what went wrong.
First of all, things tend to get muddy in a forum, and as great of support I did get, I think some things were over looked and what I have found, I hope helps others that may have faced what I did.

I dont know if it is different in other distros, so I am going to inform people that are running off of Mandriva2008 with Apache 2.2.6, MySQL 5.0.45 , and php 5.2.4

If you are running that, skip everything in the beginning of the documentation and go straight to configuring the sql data base, skip the apache setup, because if you are running PHP 5.2.4, and you have the Apache-php mod already installed, then you do NOT need to add ...

"# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
LoadModule php5_module modules/libphp5.so
#
# Cause the PHP interpreter to handle files with a .php extension.
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
DirectoryIndex index.php"

If you do, you will get a php error by running php -m that stats you have two different php instances and they need to be the same. The "LoadModule php5_module modules/libphp5.so is actually the 50_mod_php.so under /etc/httpd/modulesd/ and that will be just the beginning of your problems.

If you run into this, i suggest you go through drakconf and one by one remove php modules and start all over from fresh when you can type php -m with no errors such as this ...

-=(( root = Samba ))=-
( /var/www/html/cacti )
# php -m
[PHP Modules]
ctype
date
dom
filter
ftp
gd
gettext
hash
json
libxml
mbstring
mcrypt
mysql
openssl
pcre
posix
Reflection
session
SimpleXML
snmp
SPL
standard
suhosin
sysvsem
sysvshm
timezonedb
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]
Suhosin

Nothing was wrong with my php, nothing was wrong with mysql, nothing was wrong with my apache httpd conf setups, it was simply the fact that mandriva can do the same thing, just a bit differently and with the added configurations for httpd, it crahsed it. I am willing to bet this has happened more than once and people have given up on an awesome program such as cacti.

As soon as I by passed all the special items and additions per the documentations request, all my graphs popped up with me doing basically nothing but telling cacti what it was that i wanted to graph and on what device.

I really hope this helps people out there because I know I am a bit balder, but also more wise about it.

8)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests