cacti working on OSX!

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

Moderators: Developers, Moderators

Post Reply
rwilliams
Posts: 1
Joined: Tue Feb 08, 2005 4:16 pm

cacti working on OSX!

Post by rwilliams »

just FYI Cacti works great on my apple xserve server...looks great also!
keithbeeby
Posts: 1
Joined: Tue Feb 22, 2005 10:31 am

Cacti on Apple OS X How to?

Post by keithbeeby »

Hi,

Great to see you got Cacti running on OS X, how did you do it? Is there a How TO...anywhere? How about a Binary installer? I want to run Cacti on a new Mac mini running OS X 10.3.8. Thanks Keith
mduling
Posts: 39
Joined: Tue Mar 01, 2005 1:49 pm

Cacti on OS X

Post by mduling »

I am not a Cacti user, I always thought it was overly complex. But I now have a box that *only* supports SNMP v3 (really!) and the Cacti 0.8.7 from CVS is supposed to do that. So I just installed it and I pasted the instructions below. Their may be errors in it, please post any problems/corrections.

Now I just have to figure out how to use it. I normally use NRG which is perl-based and seems a lot simpler. http://homepage.mac.com/duling/halfdozen/#NRG If anyone should want to use NRG and Cacti on the same box, just install RRDtool according to my NRG HOWTO and it will work fine for Cacti as well.



Cacti On OS X


1 - Install RRDtool
--------------------------------------------------
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/
cd <download-dir>/rrdtool-1.0.xx
./configure
make
make install

RRDtool will install to /usr/local/rrdtool-1.0.xx. Remember this path because Cacti will ask for it the first time it runs.

2 - Turn off Apple's built-in Apache 1.x and turn on Apache 2.x
----------------------------------------------
Cacti requires PHP CLI support. I decided to get that by installing PHP CLI from Server Logistics, which requires their Apache2 bundle because the PHP install binary I had used previously (http://www.entropy.ch/software/macosx/php/) didn't seem to include PHP CLI and didn't work for Cacti. If you know how to get PHP and PHP CLI support installed with Apple's built-in Apache 1.3, then you can skip this step.

NOTE: Installing Apache 2 is non-destructive of Apache 1, you just can't run them both at the same time. So you must turn one version of Apache off before starting the other.

-Turn off Personal web sharing (Apache 1.x) if it is on
-Install Complete Apache from Server Logistics (http://www.serverlogistics.com/apache2.php)
-Drag the file Apache2prefPane from the Apache2 installer image to /Library/PreferencePanes
-Turn on Apache2 via the preference pane in System Settings

3 - Install Cacti
--------------------------------------
-Download Cacti from http://www.raxnet.net/products/cacti/ and unpack it
-Rename the unpacked Cacti folder to 'cacti' (remove version number)
-Copy the folder to /Library/Apache2/htdocs
-Perform:
cd /Library/Apache2/htdocs/cacti/include
sudo mv config.php.dist config.php
chown -R cactiuser rra/ log/ (set permissions)
chmod 666 rra/ log/
pico config.php (match mySQL info with step 5 below)

$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "root"; (not always a good idea to run as root)
$database_password = "cacti";

4 - Install MySQL
----------------------------------------------
-Download complete MySQL from Server Logistics (http://www.serverlogistics.com/mysql.php)
-Run the MySQL.pkg binary installer from the disk image
-Drag the MySQL.prefPane file to /Library/PreferencePanes (create the directory if it doesn't exist)
-Use the MySQL preferences pane to set a root MySQL password

-Add /usr/local/bin and the MySQL path to your environment
cd (change to your home directory)
sudo pico .bash_profile
export PATH="$PATH:/usr/local/bin:/Library/MySQL/bin"

5 - Create Cacti database in MySQL
---------------------------------------------------
mysqladmin --user=root create cacti
mysql -u root -p (login to MySQL as MySQL root user)
mysql> create database cacti;
mysql> exit;

cd /Library/Apache2/htdocs/cacti
cat cacti.sql | mysql -u root -p cacti

mysql -u root -p
mysql> show databases;
mysql> use cacti;
mysql> show tables; (view your database to verify)
mysql> exit;

6 - Install Complete PHP 4.3.9 and PHP CLI from Server Logistics
------------------------------------------------
-Download the PHP 4.3.9 binary and also the PHP 4.3.9 CLI from Server Logistics (http://www.serverlogistics.com/php4.php)
-Install the PHP 4.3.9 binary
-Copy the PHP 4.3.9 CLI files
cp ~/<download-dir>/PHP4-CLI/php /usr/local/bin
cp ~/<download-dir>/PHP4-CLI/php.1 /usr/local/man/man1

7 - Test PHP / MySQL integration
------------------------------------------------------
-Here is a script to test your PHP installation
-Here is a script to test if PHP is able to talk to MySQL.
http://www.macdevcenter.com/pub/a/mac/2 ... tml?page=3
This functionality must work for Cacti to work.

8 - crontab
----------------------------------------------
*/5 * * * * cactiuser php /Library/Apache2/htdocs/cacti/poller.php > /dev/null 2>&1

9 - Run Cacti and configure
----------------------------------------------
Point browser to http://127.0.0.1/cacti/index.php. If you get a file browser window, open the file index.php
-Login with user/pass of admin/admin and you will be forced to change the admin user's password. The first time you run Cacti you will be asked to configure it. Click Next and proceed to configuration with your Cacti paths.

snmpwalk binary path: /usr/bin/snmpwalk
snmpget binary path: /usr/bin/snmpget

RRDtool binary path: /usr/local/rrdtool-1.0.45/
PHP binary path: /usr/local/bin/php
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Well, first, please don't use 0.8.7, it's well, not finished... And still has a lot of changes partially done in it.

You will find your experience rather poor with 0.8.7. 0.8.6c does support SNMPv3, The Witness can help you more with configuring that than I can.
[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]
mduling
Posts: 39
Joined: Tue Mar 01, 2005 1:49 pm

Cacti on OS X

Post by mduling »

Ok, I guess I heard wrong that I needed 0.8.7 for SNMP v3. Thanks for letting me know. Fortunately the install instructions I posted for OS X don't depend on the version. I don't know who "The Witness" is, but I hope how to use it will be more clear after reading the docs. There are so few templates provided. I am wondering if I need to create my own templates even for common stuff like Ethernet switches (it appears so), but I suppose the docs will answer that.
irvinec
Posts: 1
Joined: Mon Feb 28, 2005 3:11 pm
Location: Portland, OR

Installing Cacti on OS X

Post by irvinec »

Based on the instructions listed above, I'm not sure that step #2 is actually necessary. I've been using cacti on OSX using the default Apache 1.3 for a few days without any noticeable problems.

Under the current Mac OS, 10.3, both client and server additions include PHP support in both Apache and on the CLI. In order to enable PHP for Apache 1.3 just uncomment these two lines from your /etc/httpd/httpd.conf. Then restart Web Sharing.
...
LoadModule php4_module libexec/httpd/libphp4.so
...
AddModule mod_php4.c
...

Otherwise the instructions posted above match my own install procedure very closely. I did run into one other glitch...

The MySQL binary package I downloaded and installed was for MySQL 4.1. Apparently the newer MySQL changed the password hash format. The PHP4 included with OSX has trouble connecting to these new database servers. To get around the problem replace the PASSWORD('somepass') hash function with OLD_PASSWORD('somepass') when you are creating the cactiuser account in your database.

When I get some time, I hope to construct so OSX specific templates, but that might not be any time soon.
Edwin
Posts: 7
Joined: Fri Oct 31, 2003 3:33 pm
Location: Orlando, FL

Post by Edwin »

Hi guys,

FYI. A few months ago I have written a little instruction on how to compile cactid on Mac OS X and install it on Mac OS X Server.

http://forums.cacti.net/viewtopic.php?t ... t=mac+os+x

Have fun....
Edwin
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest