Fresh apt-get install on debian, no graphs

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

Moderators: Developers, Moderators

nerdtalker
Posts: 25
Joined: Sat Jan 15, 2005 8:27 pm

Fresh apt-get install on debian, no graphs

Post by nerdtalker »

I installed cacti using apt-get on my debian system, and everything proceeded smoothly, but I see no graphs in the graph view window.

I went into graph management, and turned debug on, and I see the following:
RRDTool Says:

ERROR: opening '/usr/share/cacti/site/rra/m0n0wall_router_traffic_in_8.rrd': No such file or directory
I suspect that something is wrong with cron because of this. When I installed cacti, there wasn't any user on the system named "cacti". I suspect that it wants to run cacti under that user (cacti@localhost). I created it, but only after the autoconfiguration guide had already closed.

Running crontab -e under root or cacti shows nothing. Is that the problem?

Thank you in advance for your help, I really appreciate any suggestions.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

If I remember correctly, the poller isn't run as root on Debian. I think it's cacti or cactiuser.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
nerdtalker
Posts: 25
Joined: Sat Jan 15, 2005 8:27 pm

Post by nerdtalker »

rony wrote:If I remember correctly, the poller isn't run as root on Debian. I think it's cacti or cactiuser.
I think you're right.

How do I make sure the poller is running?

Remember, when I installed it, there wasn't a cacti user even created, so it obviously couldn't have installed it to cacti@localhosts's cron.

What should I edit it to say?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I don't know....

I really only support installs from source. I'm unsure of how the deb package has it installed.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
nerdtalker
Posts: 25
Joined: Sat Jan 15, 2005 8:27 pm

Post by nerdtalker »

I'm pretty sure that the poller just isn't running, since none of the users has anything if I run crontab -e while logged on as them.

What should that line be?
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

*/5 * * * * www-data /usr/share/cacti/site/poller.php >/dev/null 2>&1
nerdtalker
Posts: 25
Joined: Sat Jan 15, 2005 8:27 pm

Post by nerdtalker »

Exo7 wrote:*/5 * * * * www-data /usr/share/cacti/site/poller.php >/dev/null 2>&1
Thanks, I'm going to try giving that a try. :D
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

If you're using www-data, don't forget to change permissions on log/ and rra/ folders as requested by the installation guide. And remember the mysql user/permissions defined by include/config.php ...
Reinhard
nerdtalker
Posts: 25
Joined: Sat Jan 15, 2005 8:27 pm

Post by nerdtalker »

lvm wrote:If you're using www-data, don't forget to change permissions on log/ and rra/ folders as requested by the installation guide. And remember the mysql user/permissions defined by include/config.php ...
Reinhard
I'm obviously doing something really wrong here.

I've got:

Code: Select all

$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
And I've verified that that's right through phpmyadmin, and all the cacti stuff is there.

Crontab is set to:

Code: Select all

*/5 * * * * www-data php /usr/share/cacti/site/poller.php > /dev/null 2>&1
And /rra and /log are owned by "cacti", a user on the system. Or should they be owned by "www-data"?

The paths are all setup properly, yet I still don't see any graphs.
puma5k
Posts: 8
Joined: Mon Jan 23, 2006 12:26 pm

I'm running into a similar problems

Post by puma5k »

No graphs, no .rra files, used debian cacti package as well,
I ran the the poller.php file and it returns an error, what does your one do, do you get any feedback?

Code: Select all

XXXXXXXXXXX:/usr/share/cacti/site$ php poller.php

Notice: Undefined variable:  database_hostname in /usr/share/cacti/site/include/
config.php on line 149

Notice: Undefined variable:  database_username in /usr/share/cacti/site/include/
config.php on line 149

Notice: Undefined variable:  database_password in /usr/share/cacti/site/include/
config.php on line 149

Notice: Undefined variable:  database_default in /usr/share/cacti/site/include/c
onfig.php on line 149

Fatal error: Call to undefined function:  mysql_connect() in /usr/share/cacti/si
te/lib/adodb/drivers/adodb-mysql.inc.php on line 339
Also when i turn on "Graph debug" is get this
RRDTool Says:

ERROR: opening '/usr/share/cacti/site/rra/darraghs_computer_winxp_traffic_in_21.rrd': No such file or directory
all the permissions are setup for user www-data to write to log and rra folders, the log folder has a few log files in it but there is nothing in them about errors. i can post them up if it helps.

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

Post by gandalf »

nerdtalker wrote:And /rra and /log are owned by "cacti", a user on the system. Or should they be owned by "www-data"?
There's it, the nasty little bit. It is recommended to define a user for cacti to run the poller, cacti in your case. As to the installation instruction at http://www.cacti.net/downloads/docs/htm ... _unix.html, this user is needed for include/config.php (Step 5. The example uses cactiuser, but your user cacti will do as well). This seems to be ok. But crontab has the wrong user! The permissions for log/ and rra/ are ok. Make sure, that cacti has read access to the scripts directory in case you get any errors.
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: I'm running into a similar problems

Post by gandalf »

puma5k wrote:...

Code: Select all

Notice: Undefined variable:  database_hostname in /usr/share/cacti/site/include/
config.php on line 149
What does the first few lines of this file read? Did you configure it as stated by http://www.cacti.net/downloads/docs/htm ... _unix.html?
Reinhard
puma5k
Posts: 8
Joined: Mon Jan 23, 2006 12:26 pm

Post by puma5k »

What does the first few lines of this file read? Did you configure it as stated by http://www.cacti.net/downloads/docs/htm ... _unix.html?
Reinhard
The config.php file has this in it,

Code: Select all

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
@include('/etc/cacti/debian.php');
i go to debian.php (this was configured in setup)

Code: Select all

<?php
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "XXXXX";
?>
the poller.php command is in two cron's
debian installer put it in the etc/cron.d folder as cacti and i put it in the crontab file, not knowing that that debian installer had done it. running twice should still give me graphs tho.

crontab:

Code: Select all

*/5 *  * * * www-data php /usr/share/cacti/site/poller.php > /dev/null 2>&1
cron.d/cacti

Code: Select all

*/5 * * * * www-data /usr/share/cacti/site/poller.php >/dev/null 2>&1
i have looked thru that poller logs and cacti logs and see no errors, at this point i am lost in where to find more feedback from the poller that makes sence, and ideas

UPDATE:
OK just ran the poller.php again and got this:

Code: Select all

carnmore:/usr/share/cacti/site# php poller.php

Fatal error: Call to undefined function:  mysql_connect() in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339
carnmore:/usr/share/cacti/site#
I can log into the site no problem, which should mean that mysql is working.

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

Post by gandalf »

puma5k wrote:the poller.php command is in two cron's
That is often a mistake on rpm installs. You have to definitively choose ONE and only one crontab.

Code: Select all

*/5 *  * * * www-data php /usr/share/cacti/site/poller.php > /dev/null 2>&1
That's weird. Polling should be done using the cacti/cactiuser id, not the id of the web-server.
Fatal error: Call to undefined function: mysql_connect() in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339
carnmore:/usr/share/cacti/site#[/code]
I can log into the site no problem, which should mean that mysql is working.

thanks
puma5k
php-mysql seems to be missing
Reinhard
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

maybe a "dpkg-reconfigure php4-mysql" will do the job. answer yes to all questions.

extract from my script I use to install cacti automatically (as per /usr/share/doc/cacti/README.debian.gz):

Code: Select all

aptitude install php4-mysql php4-cli php4-snmp libapache2-mod-php4 apache2 -y
aptitude install cacti cacti-cactid -y
mysql -u root -e "create database cacti"
mysql -u root -e "grant all privileges on cacti.* to cacti@localhost identified by '$CACTIMYSQLPWD'; flush privileges"

zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u root cacti
grep -q mysql.so /etc/php4/apache2/php.ini || echo "extension=mysql.so">>php.ini
grep -q snmp.so /etc/php4/apache2/php.ini || echo "extension=snmp.so">>php.ini
dpkg-reconfigure php4-mysql
apache2ctl restart
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests