Cacti on Solaris 10

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

Moderators: Developers, Moderators

Post Reply
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Cacti on Solaris 10

Post by msw1970 »

Hi

I'm in the process of migrating our cacti installation from an old Linux server to a SunFire V120 server running Solaris 10 and I was wondering if anyone has an idiots guide to getting everything working. I'd like to run SPINE and Boost to ensure good poll times as on the Linux machine with boost running the poll time is still around 280 seconds.

Any help greatly appreciated!!
SexyBoy
Posts: 7
Joined: Fri Mar 28, 2008 11:31 am
Contact:

Post by SexyBoy »

Hi,

I wanna do a same thing.
I would be very glad if somebody have some good advice.
I tried to move form debian to solaris 10 but it didn't work.


Cheers
windsor
Posts: 24
Joined: Fri May 07, 2004 5:26 pm
Location: Texas!

Post by windsor »

I've done it several times, both sparc and i386.

The hardest part is getting apache+php+rrdtool built with all of the goodies.

Here's a dump of my notes:

Code: Select all

# add cacti user, put in html group
sudo groupadd -g 73 html
sudo useradd -s /bin/sh -d /data/html/cacti/htdocs \
        -c "Cacti Pseudo-User" -g 73 -u 75 cacti
# unlock account by giving some random password
sudo passwd cacti

populate cacti web area
 (download from http://www.cacti.net/downloads )

add virtualhost entry
bring/restart up apache

mysqladmin --user=root -p create cacti

mysql --user=root -p cacti < /data/html/cacti/htdocs/cacti.sql

mysql --user=root -p mysql
mysql> GRANT ALL on cacti.* TO cactiuser@localhost IDENTIFIED BY 'mypass';
mysql> flush privileges;

sudo nvi ~cacti/include/config.php
==== ====
--- config.php.FCS      2008-05-01 19:34:18.220920000 -0400
+++ config.php  2008-05-01 19:34:33.134819000 -0400
@@ -27,7 +27,7 @@
 $database_default = "cacti";
 $database_hostname = "localhost";
 $database_username = "cactiuser";
-$database_password = "cactiuser";
+$database_password = "mypass";
 $database_port = "3306";

 /* Default session name - Session name must contain alpha characters */
==== ====

sudo chown -R cacti ~cacti/{rra,log}

verify memory_limit=128M in php.ini (/opt/webserver/etc/php.ini for me)

sudo nvi ~cacti/poller.php
==== ====
--- poller.php.FCS      2008-05-01 20:04:08.569064000 -0400
+++ poller.php  2008-05-01 20:04:18.927736000 -0400
@@ -1,3 +1,4 @@
+#!/opt/webserver/bin/php -q
 <?php
 /*
  +-------------------------------------------------------------------------+
==== ====

sudo chmod a+x /data/html/cacti/htdocs/poller.php

hit the cacti site with browser
change all /usr/local entries to new location (/opt/webserver for me )

log into cacti

settings tab
 general
  rrdtool utility version = 1.2.x
  snmp version = version 2
  [save]
 poller
  downed host detection = ping and snmp
  [save]
 visual
  default rrd 1.2 fonts
   title font size = 10
   legend font size = 8
   axis font size = 8
   unit font size = 8

# make test pass
sudo -u cacti ~cacti/poller.php
cat ~cacti/log/cacti.log

set up crontab entry for cacti
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /data/html/cacti/htdocs/poller.php > /dev/null 2>&1

import Solaris and/or other unix templates
( see http://forums.cacti.net/about11634.html )
( I built my own, but ones in this thread should suffice )

devices tab
  whack localhost entry
 (too linux-specific to be useful)

new graphs tab
  enter local machine info (use snmp)
  create graphs for this host
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

Thanks for that.... I've kinda got it working.. However, the poller doesn't run from the crontab job.... I can run it manually. Also, when I view a graph in debug mode I get Permission Denied on the rrd file even though I've got read access for all users??
windsor
Posts: 24
Joined: Fri May 07, 2004 5:26 pm
Location: Texas!

Post by windsor »

If the cacti account is locked (both *LK* and *NP* in the shadow file will do this), the OS will not run crontabs for that account. That would be the first place to check.

I'm not sure what the problem would be on the permissions problem. Are the perms on the dir ok?
windsor
Posts: 24
Joined: Fri May 07, 2004 5:26 pm
Location: Texas!

Post by windsor »

Oh, another thing. If you're used to linux/*BSD and put */5 in the crontab file, it won't work. Yours needs to look like this:

Code: Select all

: myserver; sudo crontab -l cacti
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /data/html/cacti/htdocs/poller.php > /dev/null 2>&1
To debug, you can get creative:

Code: Select all

: myserver; touch /tmp/cacti.out
: myserver; chmod a+rw /tmp/cacti.out
(edit your crontab to look like):
: myserver; sudo crontab -l cacti
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /data/html/cacti/htdocs/poller.php >> /tmp/cacti.out 2>&1
(Note the >> in the redirect)
msw1970
Cacti User
Posts: 206
Joined: Tue Jan 09, 2007 8:28 am
Location: London, UK

Post by msw1970 »

I fixed the permission problem by changing the user and group that apache was running as to my cacti user.... I'll try the cron stuff tomorrow..
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest