[HOWTO] RHEL4/Cacti-start to finish install instructions

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

bpowers7
Posts: 9
Joined: Tue Apr 04, 2006 10:32 am

[HOWTO] RHEL4/Cacti-start to finish install instructions

Post by bpowers7 »

:wink:
After wrestling with - not only the Linux, but Cacti installs - I decided to make this my first post to give back to the community.
You will find attached, 2 separate documents detailing the steps necessary for the Redhat and Cacti installations.
As this was my personal install, you may or may not agree with the path/subdirectory decisions - however keep in mind this was posted more as a template to follow rather than a 'Best Practices' document.

Hope this clears up some frustration for current/future Cacti installers...

4/26/2006 - Removed .doc files and reposted as .pdf files as requested...
Attachments
Cacti Install.pdf
(35.75 KiB) Downloaded 7824 times
RedHat Enterprise 4 Install.pdf
(12.49 KiB) Downloaded 4454 times
Last edited by bpowers7 on Wed Apr 26, 2006 10:01 am, edited 1 time in total.
- BP7
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Nice to see these, but I have to ask a favor...

Can you save these as a PDF or a Open Document?

Thanks,
[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]
bpowers7
Posts: 9
Joined: Tue Apr 04, 2006 10:32 am

Reposted files

Post by bpowers7 »

Reposted as .PDF's as requested.
- BP7
krap_rz
Posts: 26
Joined: Thu May 18, 2006 5:23 am
Location: Cyberjaya, Malaysia
Contact:

Thanks A bunCh

Post by krap_rz »

To Bpowers7,

I salute you on achieving RHEL4 installation. but why do you need all package to be installed? hehehe. anyway many thanks bro! :D
KeyBoarD Is MightieR ThaN ThE sWorD, iF onLy ConNecTed tO tHe InTernET..
krap_rz
Posts: 26
Joined: Thu May 18, 2006 5:23 am
Location: Cyberjaya, Malaysia
Contact:

Re: RedHat ES4/Cacti - start to finish install instructions

Post by krap_rz »

bpowers7 wrote::wink:
After wrestling with - not only the Linux, but Cacti installs - I decided to make this my first post to give back to the community.
You will find attached, 2 separate documents detailing the steps necessary for the Redhat and Cacti installations.
As this was my personal install, you may or may not agree with the path/subdirectory decisions - however keep in mind this was posted more as a template to follow rather than a 'Best Practices' document.

Hope this clears up some frustration for current/future Cacti installers...

4/26/2006 - Removed .doc files and reposted as .pdf files as requested...

Thanks for the note. Can you explain more at the 2nd page of your install cacti on RHEL. "You may need to edit the crontab for 'cactiuser' rather than for root for this to start working". I do not understand this line. can you help me on this.

i have followed your instruction and yet when i point my browser to http://myserveradds/cacti it showed the page cannot be displayed. Did i mest up somewhere. Apreciate on anybodys opinion...


:oops:
KeyBoarD Is MightieR ThaN ThE sWorD, iF onLy ConNecTed tO tHe InTernET..
bpowers7
Posts: 9
Joined: Tue Apr 04, 2006 10:32 am

Post by bpowers7 »

What I meant by editing "cactiuser's crontab" is that in my example, cactiuser is the user account which has the permissions setup to 'run' cacti. Since the polling for the RRDTOOL is done through linux crontab schedules - I made the adjustment to "cactiuser's" crontab rather than root's. The original instructions from Cacti indicate that you should setup the crontab file for the 'root' user, but I have had issues getting this to run successfully so I simply made the crontab adjustment to the user account which is actualy going to run the command.

If your unfamiliar with crontab setups, I suggest you google for 'crontab' and read-up on what that controls.

Hope this helps.
- BP7
krap_rz
Posts: 26
Joined: Thu May 18, 2006 5:23 am
Location: Cyberjaya, Malaysia
Contact:

Cronjob

Post by krap_rz »

bpowers7 wrote:What I meant by editing "cactiuser's crontab" is that in my example, cactiuser is the user account which has the permissions setup to 'run' cacti. Since the polling for the RRDTOOL is done through linux crontab schedules - I made the adjustment to "cactiuser's" crontab rather than root's. The original instructions from Cacti indicate that you should setup the crontab file for the 'root' user, but I have had issues getting this to run successfully so I simply made the crontab adjustment to the user account which is actualy going to run the command.

If your unfamiliar with crontab setups, I suggest you google for 'crontab' and read-up on what that controls.

Hope this helps.

Thanks for replying.

i am very new to RHEL and cacti, hope that you would understand.
Now here's my crontab settings:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=cactiuser
HOME=/home/cactiuser

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1


i have change MAILTO and HOME from root. ok or not ok? From my understading is that I should write this line as cactiuser not from root, is it?


:wink:
KeyBoarD Is MightieR ThaN ThE sWorD, iF onLy ConNecTed tO tHe InTernET..
bpowers7
Posts: 9
Joined: Tue Apr 04, 2006 10:32 am

Post by bpowers7 »

I'm not a pro on RHEL or Cacti either :wink:

They key to my statement about the crontab, is that you should edit cactiuser's crontab, NOT root's.

If you are at the shell prompt and type:
crontab -e (while logged in as root), you will see root's crontab.
I would delete the
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
line from here and resave root's crontab. Then type:
su - cactiuser
which will log you into the shell as 'cactiuser'. Then you should type:
crontab -e (which will open cactiuser's crontab for editing)
and add the following line there:
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
NOTICE THAT WE HAVE REMOVED 'CACTIUSER' FROM THE COMMAND SINCE CACTIUSER IS THE USER WHO'S CRONTAB WILL RUN THE 'PHP' COMMAND
After a successful save, you will now have the cactiuser's crontab setup to run the job on it's schedule and not rely on root's crontab to fire it off.

Hope this helps.
- BP7
krap_rz
Posts: 26
Joined: Thu May 18, 2006 5:23 am
Location: Cyberjaya, Malaysia
Contact:

Yet another dead end...

Post by krap_rz »

Thanks Bpowers7, now here another problem. i think i have done all the task you have told and here is another problem to be solved

Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:


mysql -u cactiuser -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.



I think i have read other thread regarding this problem but it all end up at the same page.Error... Question: should i be looking the permission of the database? How?....


Regards
Krap_rz
KeyBoarD Is MightieR ThaN ThE sWorD, iF onLy ConNecTed tO tHe InTernET..
krap_rz
Posts: 26
Joined: Thu May 18, 2006 5:23 am
Location: Cyberjaya, Malaysia
Contact:

Installation

Post by krap_rz »

now i have got it running. Thanks man

:D
KeyBoarD Is MightieR ThaN ThE sWorD, iF onLy ConNecTed tO tHe InTernET..
PernC
Posts: 7
Joined: Wed Jun 28, 2006 6:49 pm

Same error

Post by PernC »

How did you fix your problem with:
Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:

mysql -u cactiuser -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.

I'm getting the same error. I have checked DB permissions and they appear to be correct for the cacti user
PernC
Posts: 7
Joined: Wed Jun 28, 2006 6:49 pm

Post by PernC »

Got it working, had the wrong DB name in my configuration
ijeevan
Posts: 2
Joined: Thu Sep 14, 2006 6:05 am

Post by ijeevan »

I am having the same problem. Could you please be specific in what you changed in configuration? Pernc
mjunaidzafar
Posts: 1
Joined: Sun Jun 03, 2007 5:34 am
Location: Pakistan
Contact:

Cacti Installation error

Post by mjunaidzafar »

I am installaling Cacti on windows 2000 and facing following eror.

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:


mysql -u cactiuser -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.


Can anybody help me out to get rid of this issue because i am stuck here since last two weeks
peppermint
Cacti User
Posts: 58
Joined: Fri May 11, 2007 1:11 pm
Location: NY

database error

Post by peppermint »

I had the same problem when the FQN (fully qulify name) of the host has been changed, the short name has been remaining the same.

As it was a production server, I did following procedure to resue:
(Environment: Redhat4.0, cacti 0.8.6j, mysql4.1)

1. Backed up the database files underneath /var/lib/mysql/cacti

2. Run commands to recreate the database:

- mysqladmin -u root drop cacti
- mysqladmin -u root create cacti
- mysql cacti < /var/www/html/cacti/cacti.sql
- mysql -u root mysql
> GRANT ALL ON cacti.* TO cacti@"hostname" IDENTIFIED BY 'somepassword'; (hostname has to match the one defined in config.php file)
>flush privileges;
>exit;

3. Log onto http://<hostname>/cact, make sure the error is gone.

4. Stop mysql

5. Restore the database by simply copying the original cacti database files over.

6. Start mysql

7. Log onto http://<hostname>/cact again, make sure no errors occur.

I checked the user table of mysql, it cotains the correct hostname (short hostname) with the correct cacti user, permission looked ok to me. Not sure why changing the FQN could cause this problem...

Does not sound make sense, but I was able to get everything back (except missing few mins of the data by operating above procedures). And not sure if it'll work on a windows platform...
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests