Cacti and 10.4

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

Moderators: Developers, Moderators

Post Reply
jamiebah
Posts: 15
Joined: Wed Aug 13, 2003 5:32 pm
Location: Litchfield, MN
Contact:

Cacti and 10.4

Post by jamiebah »

I did a search, (not real in depth) but was not able to find a guide to getting cacti going on 10.4 server.

So, here is a quick intro to getting it running.
First things first, go to this webpage
http://people.ee.ethz.ch/~oetiker/webto ... ld.en.html
and follow the instructions. I had used fink to install wget so I could just copy and paste. MAKE SURE that you do your make install (all of them) with a sudo in front. If you copy/paste, highlight from the last L in the make install command upto the first letter of the section your are copying, that way you can go to the beginning of the line and put sudo in front of the make install command.

Enough rambling about the simple stuff. After doing everything on that page, and installing cacti, you should have a working cacti setup.

I had problems using cron, pings would not return a usable number so use Launchd.

Here is a tutorial on Launchd:
http://www.afp548.com/article.php?story ... 0071558293

Read it, understand it.

Next, get launchd editor from here:
http://www.codepoetry.net/products/launchdeditor
Then copy and paste the code into a text file, save it, and open it with launchd editor so you can see what goes where.

Here is a sample launchd file from the machine I got cacti running on.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>com.jamiebah.cacti.launcher</string>
        <key>LowPriorityIO</key>
        <true/>
        <key>Program</key>
        <string>/Users/admin/launch_cacti.sh</string>
        <key>ProgramArguments</key>
        <array>
                <string>launch_cacti.sh</string>
        </array>
        <key>ServiceDescription</key>
        <string>Launches Cacti's cmd.php and poller.php</string>
        <key>StartInterval</key>
        <integer>300</integer>
</dict>
</plist>
This will cause the script launch_cacti.sh to run.
Here is the contents of the script: (I did a chmod 755 on the script)

Code: Select all

#!/bin/bash

/usr/bin/php /Library/WebServer/Documents/cacti/cmd.php && /usr/bin/php /Library/Webserver/Documents/cacti/poller.php

exit 0
(The line staring with /usr/bin/php and ending with /poller.php code is all one line)
For some strange reason, cacti never worked until I manually called poller.php, then the graphs would update.

Tips:
I put the above xml file in the /Library/LaunchAgent folder rather than the local user like the webpage stated.
When you load the launchd file, make sure to use sudo so that it runs as root.

This was a fresh install on 10.4, cacti version is 0.8.6f as of this writeup.

Well, I hope that this helps someone.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests