Home URL :http://www.cacti.net/

Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

Admin username : admin

Admin pasword :admin

Base : Turnkey LAMP Lucid

Forum: 
Tags: 

Working !

Liraz Siri's picture

Took a look at the patch. The only thing that stands out is that here too we should look into redirecting HTTP to HTTPS. Can't think of a legitimate reason to access monitoring infrastructure over an unencrypted link.

default virtualhost need to be changed to


<VirtualHost *:80>
        RewriteEngine On
        RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
        ServerAdmin webmaster@localhost
        DocumentRoot /usr/share/cacti/site
</VirtualHost>

Tested, working !!

Liraz Siri's picture

Thanks Basil, this takes care of it. For others who are reading the thread I'm including the diff to show how this is done:

diff --git a/cacti/overlay/etc/apache2/sites-available/default b/cacti/overlay/etc/apache2/sites-available/default
index 9948396..edbe470 100755
--- a/cacti/overlay/etc/apache2/sites-available/default
+++ b/cacti/overlay/etc/apache2/sites-available/default
@@ -1,4 +1,6 @@
 <VirtualHost *:80>
+        RewriteEngine On
+        RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
         ServerAdmin webmaster@localhost
         DocumentRoot /usr/share/cacti/site
 </VirtualHost>

TuxSax's picture

Ok, so here I am, trying to patch for my first time, I've downloaded the LAMP appliance ISO and then I've made:

tklpatch turnkey-lamp-2009.10-2-hardy-x86.iso Cacti.tar.gz

This is the output:

 

# extracting root filesystem and isolinux from ISO
Parallel unsquashfs: Using 1 processor
27489 inodes (28728 blocks) to write
 
[===============================================================================================================-] 28728/28728 100%
created 25431 files
created 2545 directories
created 1630 symlinks
created 41 devices
created 0 fifos
TKLPATCH_ISOLABEL: Cacti
# extracting patch Cacti.tar.gz to /tmp/tmp.67Eh14Gns8
# applying patch /tmp/tmp.67Eh14Gns8/Cacti
# applying overlay /tmp/tmp.67Eh14Gns8/Cacti/overlay
cp: not writing through dangling symlink `turnkey-lamp-2009.10-2-hardy-x86.rootfs/etc/apache2/sites-available/phpmyadmin'
 
I don't like the last line, what does it mean? Was the patch applied successfully or not?

Two things I love: Linux and my sax

Jeremy Davis's picture

So you'll need to get the TKL-Core-Lucid, patch it with Basil's LAMP TKLPatch. The resulting ISO will in effect be TKL-LAMP-Lucid and you may wish to keep a copy of that somewhere if you plan on trying some of the other patches (many of them - especially Basil's ones, rely on TKL-LAMP-Lucid). Then patch that ISO with this patch.

A little bit of mucking around but hopefully worth it! Another option is to patch the file system rather than the ISO. Personally I don't really recommend that as problems can sometimes occur (it will error if any of the services the patch patches are running) but its an option. Have a look at the bottom of this page for details.

TuxSax's picture

I see now, well, sounds a bit f a hassle to "patch the patched" but I'm trying it now with the right versions.

I've successfully patched the lucid beta core ISO with the LAMP patch, now I have the LAMP ISO and I've also saved it aside for future use.

Now I'm trying to apply the Cacti patch to the LAMP ISO and this is what I've got:

		root@core ~# tklpatch turnkey-LAMP-lucid-x86.iso Cacti.tar.gz 

# extracting root filesystem and isolinux from ISO

Parallel unsquashfs: Using 1 processor

29995 inodes (31997 blocks) to write


[================================================================-  ] 31629/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/run/mysqld/mysqld.sock ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/anvil ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/bounce ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/bsmtp ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/defer ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/discard ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/error ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/ifmail ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/lmtp ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/local ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/maildrop ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/mailman ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/proxymap ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/proxywrite ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/relay ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/retry ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/rewrite ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/scache ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/scalemail-backend ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/smtp ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/tlsmgr ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/trace ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/uucp ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/verify ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/virtual ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/public/cleanup ignored

[================================================================\  ] 31651/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/public/flush ignored

[================================================================\  ] 31653/31997  98%

create_inode: socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/public/showq ignored

[=================================================================| ] 31969/31997  99%

created 27554 files

created 3146 directories

created 1924 symlinks

created 86 devices

created 2 fifos

TKLPATCH_ISOLABEL: Cacti

# extracting patch Cacti.tar.gz to /tmp/tmp.lw81hTrHeb

# applying patch /tmp/tmp.lw81hTrHeb/Cacti

# applying overlay /tmp/tmp.lw81hTrHeb/Cacti/overlay

# executing config script /tmp/tmp.lw81hTrHeb/Cacti/conf

Adding `local diversion of /sbin/initctl to /sbin/initctl.distrib'

# chroot execute: /tmp/tklpatch/conf

+ apt-get update

Hit http://archive.turnkeylinux.org lucid-security Release.gpg

Hit http://archive.turnkeylinux.org lucid Release.gpg

Hit http://archive.turnkeylinux.org lucid-security Release

Hit http://archive.turnkeylinux.org lucid Release                                                                   

Ign http://archive.turnkeylinux.org lucid-security/main Packages                                                    

Ign http://archive.turnkeylinux.org lucid-security/universe Packages                           

Ign http://archive.turnkeylinux.org lucid/main Packages     

Ign http://archive.turnkeylinux.org lucid/universe Packages 

Hit http://archive.turnkeylinux.org lucid-security/main Packages

Hit http://archive.turnkeylinux.org lucid-security/universe Packages                           

Hit http://archive.turnkeylinux.org lucid/main Packages                                        

Hit http://archive.turnkeylinux.org lucid/universe Packages                                    

Hit http://archive.ubuntu.com lucid-security Release.gpg                                       

Hit http://archive.ubuntu.com lucid Release.gpg

Hit http://archive.ubuntu.com lucid-updates Release.gpg

Hit http://archive.ubuntu.com lucid-security Release

Hit http://archive.ubuntu.com lucid Release

Hit http://archive.ubuntu.com lucid-updates Release

Ign http://archive.ubuntu.com lucid-security/main Packages

Ign http://archive.ubuntu.com lucid-security/universe Packages

Ign http://archive.ubuntu.com lucid/main Packages

Ign http://archive.ubuntu.com lucid/universe Packages

Ign http://archive.ubuntu.com lucid-updates/main Packages

Ign http://archive.ubuntu.com lucid-updates/universe Packages

Hit http://archive.ubuntu.com lucid-security/main Packages

Hit http://archive.ubuntu.com lucid-security/universe Packages

Hit http://archive.ubuntu.com lucid/main Packages

Hit http://archive.ubuntu.com lucid/universe Packages

Hit http://archive.ubuntu.com lucid-updates/main Packages

Hit http://archive.ubuntu.com lucid-updates/universe Packages

Reading package lists... Done

+ HOSTNAME=cacti

+ echo cacti

+ sed -i 's|127.0.1.1 \(.*\)|127.0.1.1 cacti|' /etc/hosts

+ /etc/init.d/hostname stop

Rather than invoking init scripts through /etc/init.d, use the service(8)

utility, e.g. service hostname stop


Since the script you are attempting to invoke has been converted to an

Upstart job, you may also use the stop(8) utility, e.g. stop hostname

+ /etc/init.d/hostname start

Rather than invoking init scripts through /etc/init.d, use the service(8)

utility, e.g. service hostname start


Since the script you are attempting to invoke has been converted to an

Upstart job, you may also use the start(8) utility, e.g. start hostname

+ /etc/init.d/mysql start

Rather than invoking init scripts through /etc/init.d, use the service(8)

utility, e.g. service mysql start


Since the script you are attempting to invoke has been converted to an

Upstart job, you may also use the start(8) utility, e.g. start mysql

 * Starting MySQL database server mysqld

   ...fail!

Removing `local diversion of /sbin/initctl to /sbin/initctl.distrib'

root@core ~# 

Sooo, what now?

BTW, how can I attach a file here? I saw others did...

Two things I love: Linux and my sax

Jeremy Davis's picture

I'm guessing from what you've posted that something went wrong.

We really need Basil here to have a look at this, he'd be in a much better position to offer useful suggestions. Some of the stuff towards the end suggests to me that there may be some issues with his patch (rather than other possible issues) but I'm too much of a LInux newb to be sure.

Out of interest what is your patching environment? Are you running TKLPatch inside a VM of TKL-Core-Lucid? Or have you got it installed in something else?

You need to start a new thread to attach a file (only first posts in a new thread allow attachments).

>> socket turnkey-LAMP-lucid-x86.rootfs/var/spool/postfix/private/uucp ignored

This kind of warning occurs in some machines when a patch consisting of postfix package (in lucid), is executed. We can ignore this warning, the ISO creation will be successfull. All the patches which i submitted is tested only in this scenario

tklpatch lucid-core.iso LAMP_patch

or

tklpatch LAMP.iso cacti_patch 

I never tried any patch in running instances by

tklpatch / LAMP_patch.iso

These days I'm too busy with a project in my company :(

Jeremy Davis's picture

If you have 5 mins to spare, perhaps try installing from your new (Cactii) ISO and see if it works. You never know your luck?!

Keep us posted on how you go.

root@core ~# tklpatch turnkey-LAMP-lucid-x86.iso Cacti.tar.gz

shows that you are patching the ISO so we can rule that out as an issue. Also the above line answers my last question too ("root@core" - suggests to me that you're working inside TKL-Core-Lucid - which is good).

Ok good to know that the warnings at the top can be safely ignored then.

The last few warnings seem almost like the startup scripts in the patch aren't upstart compliant? I can't check that without lookng at the patch (which I don't have time for at the moment either). But if you want to get your hands dirty TuxSax then have a look at the conf file in the patch and do some research around upstart in Ubuntu 10.04 (some services now use a different way of starting and stopping called Upstart). Be warned though I'm only guessing really, hopefully I'm not sending you off on a wild goose chase :)

TuxSax's picture

I've forgotten to point that there is no patched ISO at the end of the process, actually the process didn't end successfully. It's just quitting on me like that, all I have after that is the unpacked folders but no ISO file is created.

I'm running a VirtualBox machine installed w/ tkl core, inside this box I'm trying to perform all the patching, the first one went fine, I have a LAMP ISO, now I've only tried to patch that LAMP with the Cacti patch.

Perhaps I need to run it on a real box instead of a VM?

Two things I love: Linux and my sax

Jeremy Davis's picture

Sorry I missed that bit! From what I can gather, you're doing everything fine...

I'm pretty sure that some of the commands in this patch are incompatible with Lucid (due to upstart). I've just had a quick look and despite the fact that Basil said this patch is for Lucid, I think it may be for TKL-LAMP stable (so you were on the right track initially - although I still have no idea about your original error).

This leaves you with a number of possible ways forward (not sure which is best, or even if any/all of them will actually work):

  1. Backtrack go with your original plan of patching TKL-LAMP stable. Note that this has to be done inside TKL-Core stable (Or Ubuntu Hardy - not TKL-Core-Lucid). Not sure about the error you had, perhaps try install and see what happens.
  2. Install the TKL-LAMP-Lucid ISO (patched with Basil's LAMP patch) that you have and patch the file system using the tklpatch-apply command. You'll need to stop the LAMP services from running first. service apache2 stop and service mysql stop
  3. Get your hands dirty and manually create the ISO. If you look in the TKLPatch Documentation (scroll down to Command Syntax) and take each step at a time. After extracting the root filesystem, copy the contents of overlay from the patch over your root folder. Run the command apt-get update && apt-get install cacti and then build the ISO.
  4. Install and configure Cacti yourself (on top of TKL-LAMP stable, or the TKL-LAMP-Lucid ISO you've made).
  5. Wait for Basil to have time to have a closer look.
  6. Wait for the TKL devs to produce the official TKL-Cacti appliance.
  7. Some other option I haven't thought of...

In my case , though inclusion of postfix package produced some warning during patching , the patching was sucessfull.... I don't know what went wrong in your case :( It would be nice, if someone else also try that patch. ..

Adrian Moya's picture

Hi, I can see the errors and I'll try to help here:

What's happening is a problem of not stoping services in the patches. As mysql was not stoped in the previous patch, it's unable to start in the Cacti patch. 

In the LAMP_lucid patch, Basil forgot to stop services. You must add at the end of the patch:

service apache2 stop
service mysql stop
service postfix stop

That way, those services are stoped and you won't get the initial errors. 

To prevent this warning:

Rather than invoking init scripts through /etc/init.d, use the service(8)

Is easy, insted of calling services using "/etc/init.d/servicename action", in Ubuntu 10.04 you should use the more standarized form "service servicename action". This is a safe error to skip, but it's nice to start using the standar way of doing things, to be sure that in the future everything would work. 

So instead of "/etc/init.d/mysql start" use "service mysql start" and so on. 

Also, a recommendation: it's not a good practice to create files directly in /etc/apache2/sites-enabled. You should create or symlink files in /etc/apache2/sites-available, and then use the apache commands to enable/disable sites: "aeensite nameofsite" to enable and "a2dissite nameofsite" to disable. 

You shouldn't ignore any errors in the patching process, as this could lead to future problems in the appliance. So be sure to stop the services again in the cacti patch at the end. (only the one started, mysql in this case)

Basil, what's that hostname service you use in LAMP patch? I also noted that you added mod_rails to the LAMP, I think LAMP should only include PHP, but as the official also includes Python and Pearl support, maybe the name should change to something like "Apache application server" or something like that.

That's my 2 cents...

TuxSax's picture

Then it should be named LAMPPP, maybe...

Two things I love: Linux and my sax

Changes applied on both LAMP and Cacti patches. Thanks !

Jeremy Davis's picture

Considering that this is a community developed appliance TKLPatch (produced by an unpaid volunteer) then I don't think that Basil (or anyone else) should do anything for you!

Perhaps it would be nice if he did or helpful for you if he did, but IMO if you want more information you need to make a polite request rather than what appears to be a demand, or at least an expectation of minimum requirements. Is that you you speak to others that give you gifts? If someone gave you a birthday present that you didn't know how to work would you tell them that they should have provided better instructions? Or would you politely ask them for help?

Besides, if you read the full thread (above) I think that there is enough information for you to have a search (top right) and you will find the documentation for TKLPatch (and how to apply them). Although bottom line is, considering this patch is two and a half years old and applies to a beta version of a previous TKL appliance (which is no longer even available) I suspect that it is too out of date to be applied as is anyway. I strongly suspect that it would need some serious tweaks before being immediately usable...

Add new comment