Add Cacti to Groundwork
#22
Posted 13 February 2009 - 03:52 AM
Hope you can help me out with this one (although there is no doubt in my mind).
Following the instructions listed above I was able to install cacti. However when I go to the menu option Cacti I get the error:
Error
The following PHP extensions are missing:
* sockets
Please install those PHP extensions and retry
from Cacti.
Since it seems that php is installed as part of Groundwork I don't know how I can add extensions.
Could you please help me out on this one?
Thanks in advance,
Eric
#23
Posted 13 February 2009 - 08:33 AM
Something in your mysql install is not right.
#24
Posted 14 February 2009 - 02:08 PM
#25
Posted 16 February 2009 - 02:41 AM
This is the output:
operador@srvnagios:~$ ps -ef | grep mysql
root 2518 1 0 Feb13 ? 00:00:00 /bin/sh /usr/local/groundwork/mysql/bin/mysqld_safe --defaults-file=/usr/local/groundwork/mysql/my.cnf --port=3306 --socket=/usr/local/groundwork/mysql/tmp/mysql.sock --old-passwords --datadir=/usr/local/groundwork/mysql/data --log-error=/usr/local/groundwork/mysql/data/mysqld.log --pid-file=/usr/local/groundwork/mysql/data/srvnagios.pid --default-table-type=InnoDB
mysql 2581 2518 0 Feb13 ? 00:18:39 /usr/local/groundwork/mysql/bin/mysqld.bin --defaults-file=/usr/local/groundwork/mysql/my.cnf --basedir=/usr/local/groundwork/mysql --datadir=/usr/local/groundwork/mysql/data --user=mysql --pid-file=/usr/local/groundwork/mysql/data/srvnagios.pid --skip-external-locking --open-files-limit=8192 --port=3306 --socket=/usr/local/groundwork/mysql/tmp/mysql.sock --old-passwords --default-table-type=InnoDB
operador 5611 5525 0 11:51 pts/0 00:00:00 grep mysql
The my.cnf file doesn't exist in /etc
operador@srvnagios:~$ cat /etc/my.cnf
cat: /etc/my.cnf: No such file or directory
but does in /usr/local/groundwork (standard install of groundwork)
operador@srvnagios:~$ cat /usr/local/groundwork/mysql/my.cnf
#
# Copyright 2008 GroundWork Open Source, Inc. ("GroundWork")
# All rights reserved. Use is subject to GroundWork commercial license terms.
#
#
# Tuning of the MYSQL database for best performance on system conform with Systems described in the System planning Guide
# Last Update: July 2008
#
[mysqladmin]
user=root
port=3306
socket=/usr/local/groundwork/mysql/tmp/mysql.sock
[mysqld]
basedir=/usr/local/groundwork/mysql
datadir=/usr/local/groundwork/mysql/data
port=3306
socket=/usr/local/groundwork/mysql/tmp/mysql.sock
tmpdir=/usr/local/groundwork/mysql/tmp
max_connections = 125
innodb_buffer_pool_size=100M
innodb_log_buffer_size=5M
innodb_log_file_size=256M
key_buffer_size=64M
sort_buffer_size=2M
read_buffer_size=1M
join_buffer_size=8M
read_rnd_buffer_size=4M
innodb_flush_log_at_trx_commit=0
#disable double buffer on file sync
innodb_flush_method=O_DIRECT
# Maximum size for internal (in-memory) temporary tables. If a table
# grows larger than this value, it is automatically converted to disk
# based table This limitation is for a single table. There can be many
# of them.
tmp_table_size = 16M
max_heap_table_size=16M
max_tmp_tables=64
query_cache_size=128M
query_cache_type=1
thread_cache_size=20
#optimize or alter command
myisam_sort_buffer_size=256M
table_cache=4096
[mysqld_safe]
mysqld=mysqld.bin
# Increase the amount of open files allowed per process. Warning: Make
# sure you have set the global system limit high enough! The high value
# is required for a large number of opened tables
open-files-limit = 8192
[mysql]
port=3306
socket=/usr/local/groundwork/mysql/tmp/mysql.sock
Dave99,
I believe you when you say that Cacti doesn't need the sockets but I can't get past that error screen. Do I need to disable something in a config file?
Thanks guys for any assistance,
Sincerely,
Eric
#26
Posted 16 February 2009 - 08:34 AM
If you want to recompile php, it's pretty straightfoward:
You need to see what the current configure options are for php, so in /usr/local/groundwork/apache2/htdocs, create a file called pinfo.php. In that file put this:
phpinfo(); ?>
Then pull that page up in your browser. Right at the top it should give you your configure command. Copy that into notepad or similar, and at the end of it, add:
--enable-sockets
just like all the other stuff there.
download the source tar.gz from php.net (5.2.8), and put it in /usr/local/src
tar -xzvf php-5.2.8.tar.gz
cd into the folder it creates
run the new configure command you have.
Assuming that runs without errors, then do a make, then a make install. You should then have the new version of php w/ sockets.
#27
Posted 16 February 2009 - 09:05 AM
When compiling PHP (following your indications, getting the command from the phpinfo page) I get the following error:
configure: error: Cannot find MySQL header files under /usr/local/groundwork/mysql.
Note that the MySQL client library is not bundled anymore!
Hence I cannot 'make' or 'make install'.
Do you know how to solve this error?
Sincerely,
Eric
#28
Posted 16 February 2009 - 11:30 AM
#29
Posted 17 February 2009 - 02:53 AM
Sincerely,
Eric
#30
Posted 17 February 2009 - 04:07 AM
Thanks to you pointing me in a certain direction I got it up and running. Now I can start configuring it.
Thanks again for your support and patience.
Kind regards,
Eric
#31
Posted 17 February 2009 - 05:03 AM
Back again with another 'problem'. I got Cacti installed thanks to your help but now my server is running three instances of agent.bin and those three combined take up 99% of the CPU. Is this something that looks familiar to you in regards to the Cacti installation? What am I missing in my config? I don't assume it's normal.
Thanks for your reactions and help.
Kind regards,
Eric
#32
Posted 17 February 2009 - 08:24 AM
An additional problem in Cacti/Groundwork combination:
I'm not getting any graphs. Been browsing in forums and on the internet, tried a lot of 'solutions' but without results.
this is what Cacti says when I debug it:
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Localhost - Disk Space - /dev/sda1" \
--rigid \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
DEF:a="/usr/local/groundwork/apache2/htdocs/cacti/rra/localhost_hdd_free_8.rrd":hdd_used:AVERAGE \
DEF:b="/usr/local/groundwork/apache2/htdocs/cacti/rra/localhost_hdd_free_8.rrd":hdd_free:AVERAGE \
CDEF:cdefa=a,1024,* \
CDEF:cdefe=b,1024,* \
CDEF:cdefi=TIME,1234888204,GT,a,a,UN,0,a,IF,IF,TIME,1234888204,GT,b,b,UN,0,b,IF,IF,+,1024,* \
AREA:cdefa#F51D30:"Used" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
STACK:cdefe#002A97:"Available" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
LINE2:cdefi#000000:"Total" \
GPRINT:cdefi:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
ERROR: opening '/usr/local/groundwork/apache2/htdocs/cacti/rra/localhost_hdd_free_8.rrd': No such file or directory
Ring any bells? I'm really lost out here.
Hoping you guys can help out.
Kind regards,
Eric
#33
Posted 17 February 2009 - 09:17 AM
I think I might have found a problem in my configuration that's causing Cacti not to render the graphs.
When I look at the include/config.php it states that the MySQL server is localhost, but don't I have to mention the socket there also in some way? Thing is I can only connect to MySQL using the -S option that points to the socket.
If so can you tell me how I can mention the socket in the php file?
Kind regards,
Eric
#34
Posted 17 February 2009 - 11:17 AM
As for your config.php, there should be a an entry in there like:
$database_port = "3306";
you might double check and make sure nothing got deleted in there.
Double check your permissions on the RRD files & folders, make sure they are readable by the nagios user. Some things have changed with the 5.3 release of groundwork, I'm still on 5.2, so the instructions for cacti installation might not be the same.
#35
Posted 18 February 2009 - 12:38 AM
I'm not sure what I've done but I got my graphs!!! When I went to Graph Management and put it in Debug mode, I could copy/paste the command used to make the graph in the console as a regular user. Doing this the graph was created perfectly. So I started checking versions and in the Setting of Cacti the version was set to 1.0 and I have 1.2 installed.
After changing that one setting all at once the graphs are showing as should.
That leaves me only with one problem. I've been watching at my screen for something to happen but the graphs stay empty. So I checked the poller which runs as a root cronjob:
*/5 * * * * root /usr/local/groundwork/php/bin/php /usr/local/groundwork/apache2/htdocs/cacti/poller.php > /dev/null 2>&1
When I try to run that command manually as root I get the error:
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'. I've checked and double-checked those settings and they are correct.
Logged in as root I can access the MySQL only with password (mysql -p --user=root). When I use the cactiuser with password (mysql -p --user=cactiuser). I can also connect (only having cacti database). I even changed the config.php of cacti to use root as mysql user with the correct password but still no result.
When running the poller.php or cmd.php from the command line I always get the same error that the user cannot connect to MySQL server on 'localhost'.
Any suggestions how I might be able to solve this, since I think that's the only thing missing to have my graphs showing actual data.
Thanks in advance.
Kind regards,
Eric
#36
Posted 02 March 2009 - 02:20 AM
I had similar problem, but after i changed my database_hostname values in config.php, it works!
$database_hostname = "localhost";
to
$database_hostname = "127.0.0.1";
#37
Posted 02 March 2009 - 02:28 AM
Thanks for your reply, I've tried that and it didn't provide a solution to my problem. At this time I have given up on integrating Cacti into Groundwork. I've installed MRTG and it's working like a charm. The only thing I'm looking for is how to show that page in the Groundwork site. I have the link but nothing gets shown, I get an error. Any idea how to link to a webpage in Groundwork (the mrtg page is on the same server). I've posted this question but apparently it's quite a problem since I haven't received an answer yet :-)
Kind regards,
Eric
#38
Posted 02 March 2009 - 07:42 AM
mysql -u cactiuser -p -h localhost
if that doesn't work you might have to assign rights to explitely to the cactiuser at localhost, something like;
mysql
> grant all on cactidb.* to 'cactiuser'@'localhost' identified by 'cactiuserps';
#39
Posted 13 March 2009 - 08:14 AM
Waiting on 1/1 pollers. Waiting on 1/1 pollers. Waiting on 1/1 pollers. 03/13/2009 04:29:33 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceed 03/13/2009 04:29:33 PM - SYSTEM STATS: Time:293.4382 Method:cmd.php Processes:1 Warning: pclose(): 48 is not a valid stream resource in /usr/local/groundwork/ap real 4m53.810s user 0m0.176s sys 0m0.588s
I found out that the binary paths differ in GW 5.3. I changed them in the Cacti settings to:
/usr/local/groundwork/common/bin/snmpwalk /usr/local/groundwork/common/bin/snmpget /usr/local/groundwork/common/bin/snmpbulkwalk /usr/local/groundwork/common/bin/snmpgetnext /usr/local/groundwork/common/bin/rrdtool /usr/local/groundwork/share/rrdtool/fonts /usr/local/groundwork/php/bin /usr/local/groundwork/apache2/htdocs/cacti/log/cacti.log
#40
Posted 24 March 2009 - 10:28 PM
There is also a /usr/local/groundwork/apache2/htdocs/rrd path that doesn't contain anything.
Any help would be appreciated. I'll probably try and run this by the folks in the Cacti forums as well.
I am using GWMCE 5.3 and Cacti 0.87.d. I did set the paths to use the tools in the Groundworks paths (i.e. /usr/local/groundwork/common/bin/snmpwalk, etc.). I'm using the rrdtool that was installed with GWMCE 5.3, although it appears I also have rrdtool installed in /usr/bin
I went in and changed ownership of all the directories related to cacti (i.e. /usr/local/groundwork/apache2/htdocs/cacti/) to the nagios user
This didn't seem to correct the problem.
I'm also not getting anything in the cacti.log file.
All of this is running on Suse Linux Enterprise Server 10.
Thank you in advance.
Regards,
Chris

Help











