[SOLVED] Permissions/ownership and rrd creation

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

cirrhus9
Posts: 30
Joined: Thu Apr 28, 2011 7:23 am

Re: Permissions/ownership and rrd creation

Post by cirrhus9 »

I found this "hint" of what may have been deployed incorrectly...
http://forums.cacti.net/viewtopic.php?p=130491#p130491

I imported the cacti.sql from terminal as root user. Could that be an/the issue?

and now I can find no trace of the cacti.sql file that I may have imported the first time.
Can I re-deploy and 0.8.7g cacti.sql into the db as the correct user and not lose anything?

I hope I am not rambling here and that some of this gibberish actually makes sense.

Thank you.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Permissions/ownership and rrd creation

Post by noname »

Hicupping now resolved, it was permissions, but I still can't create new graphs, and a handful of previously existing graphs are coming up NaN.
Please perform this and post its result:

Code: Select all

% ls -ld /var/lib/cacti/rra/
% ls -l /var/lib/cacti/rra/xxxx.rrd
% rrdtool info /var/lib/cacti/rra/xxxx.rrd
('xxxx.rrd' is the file which has problem)
Prerequisites (I think):
- It's better that poller runs as certain normal user (e.g. cactiuser)
- Poller user must have write permission to rra/ & log/ directory & files within
- Web server user (e.g. www-data) must have write permission to log/cacti.log
I have to ask if setting/changing the system timezone last week, could have had an effect on these entities?
See this topic: http://forums.cacti.net/viewtopic.php?p=135298#p135298
Can I create .rrd files via c-line and then "encourage" cacti to use those?
1) 'Console' -> 'Data Sources' -> (your datasource)
2) Click "Turn Off Data Source Debug Mode"
3) See "Data Source Debug"

But probably it doesn't solve root cause even if you can create RRD in this way.
Can I backup my rra/*.rrd files, purge and re-install Cacti and/or rrdtool and put them back and still have the populated graphs?
Please follow to this document: Upgrading Cacti - Cacti Docs

It is like as upgrading from one version to the same version.
I imported the cacti.sql from terminal as root user. Could that be an/the issue?

and now I can find no trace of the cacti.sql file that I may have imported the first time.
Can I re-deploy and 0.8.7g cacti.sql into the db as the correct user and not lose anything?
Which is "root user" you mentioned, local user (in /etc/passwd) or database user (in include/config.php) ?
I think, database user should be consistent with include/config.php,
but maybe it's not big matter when the user has valid privileges to cacti database.
cirrhus9
Posts: 30
Joined: Thu Apr 28, 2011 7:23 am

Re: Permissions/ownership and rrd creation

Post by cirrhus9 »

ls -ld /var/lib/cacti/rra/

Code: Select all

drwxrwxrwx 2 www-data www-data 20480 2011-06-29 11:40 /var/lib/cacti/rra/
ls -1 /var/lib/cacti/rra/norveld_cpupercentpriv_404.rrd /var/lib/cacti/rra/norveld_sinfmemsysdrvtotb_413.rrd

Code: Select all

/var/lib/cacti/rra/norveld_cpupercentpriv_404.rrd
/var/lib/cacti/rra/norveld_sinfmemsysdrvtotb_413.rrd
Which is "root user" you mentioned, local user (in /etc/passwd) or database user (in include/config.php) ?
root system user.
I think, database user should be consistent with include/config.php
but maybe it's not big matter when the user has valid privileges to cacti database.
It's not with a "grant all privileges" statement to the correct user.

I changed this to the root system account as a test and no change.

Should "Data Source Path" be blank when adding a new ds?
but under debug|output it shows
/var/lib/cacti/rra/xxx.rrd

but the "Data Source Path" box is completely empty?
Only after Save and then re-opening is it populated with "<path_rra>/xxx.rrd"
although they don't actually exist.

NOTE: the instructions at http://docs.cacti.net/manual:087:1_inst ... _upgrading are inaccurate. There is no cacti "table" but there is a cacti database, neither is there a cacti.cacti table.
It says "Backup the old Cacti database." but gives instructions for backing up/dumping a table.

If the cacti database only had 1 table, I believe those instructions need a review. :)
Reinhard/Gandalf knows his stuff and he appears to be the author judging by the footer. "2010/09/18 04:58 by gandalf"
Perhaps it references an older version of mysql or a method I am not totally familiar with? I dunno.
I can backup/dump a db/table with the best of them.

mysqldump -uroot -p cacti > /path/to/output.sql is sufficient as is
cp -pr /var/lib/mysql/cacti /var/lib/mysql/cacti.backup

Thank you.
cirrhus9
Posts: 30
Joined: Thu Apr 28, 2011 7:23 am

Re: Permissions/ownership and rrd creation

Post by cirrhus9 »

Installed a parallel copy from Source and all my issues went away.

Ubuntu sucks. I think it's Vulcan for "Windows" personally.

Thank you for all your help with this issue. I really appreciate it.
I owe you one iBeer. :wink:
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Permissions/ownership and rrd creation

Post by noname »

>> Installed a parallel copy from Source and all my issues went away.

Cheers.

Only about this point,
cirrhus9 wrote:NOTE: the instructions at http://docs.cacti.net/manual:087:1_inst ... _upgrading are inaccurate. There is no cacti "table" but there is a cacti database, neither is there a cacti.cacti table.
It says "Backup the old Cacti database." but gives instructions for backing up/dumping a table.
I think the 1st argument of mysqldump means "database"...
http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html

>> I owe you one iBeer. :wink:

Sorry, I'm using Android. 8)
cirrhus9
Posts: 30
Joined: Thu Apr 28, 2011 7:23 am

Re: [SOLVED] Permissions/ownership and rrd creation

Post by cirrhus9 »

and I googled "mysql +"--add-drop-table"" too!

My google skills must be rusty.

Peace.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: [SOLVED] Permissions/ownership and rrd creation

Post by noname »

Oops, (probably) I've understood what you mean.

>> It says "Backup the old Cacti database." but gives instructions for backing up/dumping a table.

Certainly it will dump tables of given database. (Yes, the database cannot be created by the dumped query itself)
When restoring, it needs to create target database (cacti) beforehand by using mysqladmin command... :wink:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest