1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
cacti for Debian
----------------
originally written by Thorsten Sauter <tsauter@gmx.net>
Fri, 3 Sep 2004 11:25:28 +0200
last edited by sean finney <seanius@debian.org>
Fri, 06 Jan 2006 08:07:46 +0100
----------------
* viewing graphs causing zombie mysql processes?
If this happens, take a look at the solutions given in
http://bugs.debian.org/344519.
* ERROR: Garbage ':33:09 To 2005/10/27 08:33:09\c' after command:
If you get this, it's probably because you just upgraded rrdtool,
which changed its output format between versions and cacti is still
trying to parse it using the old versions' output. If you go into
your cacti settings, you will see an option to change the version
of rrdtool you have installed, which should solve your problem.
* installation
note that cacti now uses automatic configuration via dbconfig-common.
however, if you've chosen to go the manual route, the following
information may be helpful.
using the username and password you provided in debconf (and stored
in the cacti config file /etc/cacti/debian.php), create a database
and load up the cacti skeleton. assuming you chose a database and
user both named 'cacti':
mysql -u root -p -e "create database cacti"
mysql -u root -p -e "grant all privileges on cacti.* to cacti@localhost identified by 'yourpasswordhere'; flush privileges"
zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u cacti -p cacti
next, go to http://$yourhost/cacti/, and follow the on-screen directions.
the default login is admin/admin. once automagical configuration is
brought back into cacti, this will probably change to something better.
* Upgrading from recent versions of cacti (>= 0.8.x)
There is a special directory install/ available, which contains some
basic php scripts to upgrade your current database to the new version
of cacti.
Normally, this should happen automatically. If not, simply point your
browser to your cacti installation:
http://$yourhost/cacti/install
At some point the automatic upgrade feature will return, but not now.
* Upgrading from old cacti versions (<= 0.6.x)
The database structure has changed between version 0.6.x and 0.8.x. To make
cacti working again, you must create a new database, and import the cacti
database configuration. You can do this with the following commands. Please
replace "cacti" with your database name. Maybe you must also specify an
host name (-h host).
# backup the old database
$ mysqldump -u root -p cacti | gzip -9 - >/tmp/cacti-old.gz
# delete and create the database again
$ mysqladmin -u root -p drop cacti
$ mysqladmin -u root -p create cacti
# import the database structure
$ zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u root -p cacti
optionally, if you have lots and lots of data and it's critically important
to keep it, you can try the following, which i've had work on smaller test
installations:
- downgrade to the previous 0.6.x version of cacti in woody.
- download version 0.6.8a from the old cacti repository:
http://www.cacti.net/downloads/archive/
- extract the tarball in /usr/local/cacti, configure config.php.
- change your Alias to point /cacti/ at this directory
- go to http://$yourhost/cacti/install/ and do the 0.6.7->0.6.8a upgrade
- turn off cron (or at least the cronjob for cacti)
- back up your current database, load a copy into a database
called cacti-old. truncate the old database.
- repeat the described upgrade process to go from 0.6.8a to 0.8.
you'll be asked for an "old database" and a "new database". this
is where things will either work or not work.
- remove these two cacti directories in /usr/local
- install the latest version of cacti from sarge/sid
- point your apache config back where it should
- go to http://$yourhost/cacti/install/ and cacti should take you
the rest of the way to the current version.
- turn the cronjob back on
note that i haven't tried this on a large scale, it takes quite a bit
of effort, and i can't guarantee it will work. sorry :/
i would like at some point to offer some automated (or at least cmdline)
programs to help automate this, but my first priority is to get the next
upstream release out the door. i've already done some work on this, if
you're interested in helping out, send me an email.
* PHP command line scripts:
If you install the php4-{cli,cgi} package _after_ the php4-mysql package,
there will be no entry for the mysql extension in this file.
To fix this, you can run the following command and select the cgi
interface also:
# dpkg-reconfigure php4-mysql
You need to enable mysql support for apache, cli and/or cgi. Depending
on your configuration.
* Apache2 support
If you would like to use cacti with apache2 you need to install the php4
package for apache2: libapache2-mod-php4. After this you need to enable
the mysql and snmp extension for php4.
# cd /etc/php4/apache2/
# grep -q mysql.so php.ini || echo "extension=mysql.so">>php.ini
# grep -q snmp.so php.ini || echo "extension=snmp.so">>php.ini
(Please note the two ">>" signs)
* PHP short tags problem in /etc/cacti/debian.php
Previous versions of cacti create the debian.php file with short php
tags '<?'. This can make problems on systems which only allows the login
php tags. (This should be the default IMHO). This version should fix
the debian.php automatically during install. The relevant PHP option
is: short_open_tag
If the automatic update doesn't work or you have moved/replaced the
file please make sure you are using only long php4 tags in this file.
Long tags are: <?php
* Custom local scripts
if you've written your own scripts for monitoring various things in cacti,
i strongly recommend that you not place them under /usr, as package
maintainers like myself will sometimes wrongly assume that we have
total control over the filespace there. instead, you should consider using
an alternate location, such as somewhere under /usr/local/share/cacti,
which should be already created for you when you install this package.
* Cacti doesn't gather any data???
here's a collection of tips observations that might help if you can't
figure out why cacti isn't gathering any data (assuming you're using
the standard poller and not cacti-cactid).
cacti's poller is a pure php script located at
/usr/share/cacti/site/poller.php
because it's normally a rather noisy script, the stderr is redirected
to an error logfile in
/var/log/cacti/poller-error.log
it's also possible something may be in
/var/log/cacti/cacti.log
cacti depends on a couple different php libraries/modules, which can
be satisfied by packages from either php4 or php5 (to which i will
ambiguously refer as phpN). thus, it's possible that some of the
installed php packages come from one version of phpN and others from
the other. if cacti isn't gathering any data, take a look to see if
this is the case, and then install the missing modules for one of the
versions of phpN and ensure that cacti is configured to exclusively
use that version.
also, it's possible that the phpN-mysql library isn't configured
for the cmdline phpN program. check the contents of /etc/phpN/cli/php.ini
for the lines:
extension=snmp.so
extension=mysql.so
it's also been reported that phpN-cli requires safe mode to be turned off.
if you get errors like:
sh: line 1: /php: No such file or directory
sh: line 1: /rrdtool: No such file or directory
then try disabling safe mode for your phpN-cli in /etc/phpN/cli/php.ini.
* Default initial username/password
is admin/admin. probably not the most secure, so please change it
as soon as you're done reading this sentence. did it? good, thanks :)
at some point i'll make this part of the installation process, but
in the meantime at least we have this note.
|