Newbee: Cacti on Ubuntu not drawing graph

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

Moderators: Developers, Moderators

Post Reply
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

I had been using Cacti for sometime on VPS with basic function like CPU, Load, Network graph etc.

Lately I acquire a Dedicated Server with Full Version Ubuntu Server 10.04 LTS (LAMP) install by service provider and was going to install Cacti. Before I do it on the Dedicated Server, I create a virtual environment with the same version of Ubuntu to test run my installation. The virtual Ubuntu work flawlessly with Cacti so I start working on the Dedicated Server.

The only difference between the 2 installation was the Dedicated Server running with "root".

First I do a,
- apt-get install libsnmp-base snmp snmpd php5-mysql php5-cli php5-snmp (then I configure SNMP)
- apt-get install cacti

Everything was find and the installation doesn't gave any error message. But when I start Cacti page the first time after force password change I found error that wasn't on the simulated install on the virtual Ubuntu.

1. Cacti "Path" cannot find /var/log/cacti/cacti.log but it was actually there. I change the ownership of the file to root (0:0) then Cacti can read the file.

2. On the virtual install, the Path page display SNMP Utility Version as "NET-SNMP 5.X" and RRDTOOL Utility Version "RRDTOOL 1.3.X". But on the Dedicated Server it only show NET-SNMP 5.X and the RRDTOOL Version was totally not there.

So I ignore the problem and continue to Cacti page. Then I change the RRDTOOL Version on the "Setting" page to RRDTOOL 1.3.X. Then I configure the host with SNMP and it seem working fine. But when I click on the Graph it show the Graph name but not drawing any graph.

I was wondering why the same thing I did on the virtual installation doesn't work on the Dedicated Server. Could it be some permission problem on file access? Anyone with experience on this please gave me a hand.

Thanks in advance.
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

I just going thru Cacti page and found and RRDTOOL error in Technical Support page,

Technical Support
General Information
Date Sun, 29 Jan 2012 11:04:42 +0000
Cacti Version 0.8.7e
Cacti OS unix
SNMP Version net-snmp
RRDTool Version
ERROR: Installed RRDTool version does not match configured version.
Please visit the Configuration Settings and select the correct RRDTool Utility Version.

Hosts 1
Graphs 4
Data Sources Script/Command: 5
Total: 5

But I have the correct version in my Ubuntu Server.

/usr/bin/rrdtool
RRDtool 1.3.8 Copyright 1997-2009 by Tobias Oetiker <tobi@oetiker.ch>
Compiled Feb 23 2010 21:36:53
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by gandalf »

We had issues with rrdtool detection. Please upgrade to 087i
R.
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

I install Cacti from Ubuntu repository. Is there any instruction on how to install Cacti 0.87i.

Thank you very much.

Edit,

I test upgrade Cacti 0.8.7i using one of the thread on Cacti Forum but eventually that didn't works. It causes the setting inside Cacti page unable to save and lots of poller.php and database table error. I revert (undo) what even I did then I come out with an idea of using Ubuntu Precise Cacti Packages from "http://packages.ubuntu.com/precise/all/cacti/download" which include 0.8.7i. I install the packages via "dpkg -i cacti_0.8.7i-2ubuntu1_all.deb" which installed correctly.

(Reading database ... 45332 files and directories currently installed.)
Preparing to replace cacti 0.8.7e-2ubuntu0.2 (using cacti_0.8.7i-2ubuntu1_all.deb) ...
Unpacking replacement cacti ...
Setting up cacti (0.8.7i-2ubuntu1) ...
dbconfig-common: writing config to /etc/dbconfig-common/cacti.conf
Replacing config file /etc/cacti/debian.php with new version
dbconfig-common: flushing administrative password
Replacing config file /etc/cacti/apache.conf with new version

Creating config file /etc/cacti/lighttpd.conf with new version

And Cacti also worked correctly. Right now the test was conducted on my Virtual Version of Ubuntu and not the Dedicated Server. I wonder is this alright (correct) way to upgrade to 0.8.7i and would it causes any problem before I do it on the Dedicated Server.

Thanks again.
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

I can't wait and did the upgrade anyway. But it was the same,

Technical Support
General Information
Date Mon, 30 Jan 2012 17:33:20 +0000
Cacti Version 0.8.7i
Cacti OS unix
SNMP Version net-snmp
RRDTool Version
ERROR: Installed RRDTool version does not match configured version.
Please visit the Configuration Settings and select the correct RRDTool Utility Version.

Hosts 1
Graphs 7
Data Sources Script/Command: 2
SNMP: 9
SNMP Query: 2
Total: 13

And the graph was still empty,

Image
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by noname »

What did you specify for "RRDTool Binary Path" in 'Settings -> Paths' ?

If it's not wrong (and not empty), place this sample code (rrdver.php) in your Cacti directory
and access it via browser to make sure whether Cacti can execute rrdtool command properly.

Code: Select all

<?php

include("./include/global.php");
include_once("./lib/utility.php");

global $config;

$rrdtool_version = "Unknown";
if ((file_exists(read_config_option("path_rrdtool"))) && ((function_exists('is_executable')) && (is_executable(read_config_option("path_rrdtool"))))) {
        $out_array = array();
        exec(cacti_escapeshellcmd(read_config_option("path_rrdtool")), $out_array);

        if (sizeof($out_array) > 0) {
                $rrdtool_version = $out_array[0];
        }
}

echo $rrdtool_version . "\n";

?>
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

RRD Binary Path was /usr/bin/rrdtool

RRDtool 1.3.8 Copyright 1997-2009 by Tobias Oetiker <tobi@oetiker.ch>
Compiled Feb 23 2010 21:36:53

I create /usr/share/cacti/site/rrdver.php and paste the code inside. The permission was some as other file,

-rw-r--r-- 1 0 0 525 2012-01-31 09:42 rrdver.php

Then I access the page via a browser to http://myip/cacti/rrdver.php and it show,

Unknown

Does it mean my RRDTOOL was no working? BTW my provider wanted this options inside kernel boot parameter not to be remove,

If you want to use your own kernel, please make sure you don't touch the
kernel boot parameters (append) as some of our hardware requires the
parameters acpi=ht and/or noapic.

And they also put a raid monitoring software "mdadm".

I wonder could this thing messing with cacti to access RRDTOOL?

Thanks for the help.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by gandalf »

myandylai wrote:RRD Binary Path was /usr/bin/rrdtool.
Perhaps the name of that field is misleading. You will have to put /full/path/to/rrdtool-binary in: the file itself has to be entered
R.
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

/usr/bin was the full path to rrdtool. As the binary was rrdtool so the full path including the binary was /usr/bin/rrdtool.

Image

Thanks.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by noname »

What owner/group permission of your rrdtool is? (Please perform "ls -l /usr/bin/rrdtool")

Is it executable for web server's account? (e.g. www-data, apache, etc.)
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

ls -lrn rrdtool

-rwxr-xr-x 1 0 0 27160 2010-02-23 21:37 rrdtool

It was a clean install of Ubuntu official version as described by my service provider. I usually don't mess with binary file permission as I don't want to damage the box.

Thanks.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by noname »

myandylai wrote:-rwxr-xr-x 1 0 0 27160 2010-02-23 21:37 rrdtool
"0 0" means "owner=root, group=root" ? Anyway, that's not strange. Seems normal.

Then another question..
Does your service provider permit users (=you) to execute external command from web service?
Otherwise, isn't it chrooted Apache?
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

It was a Dedicated Server anyway. I ask my service provider to use the common ISO from Ubuntu and installed LAMP. This could make a easy day for me as I am a newbee on Linux.

BTW is there anyway I can check whether it was a chrooted Apache2?

Thanks.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by noname »

>> BTW is there anyway I can check whether it was a chrooted Apache2?

Sorry I'm not sure about chroot howto in detail.
But my main concern is "why rrdtool can't execute properly via web service". Please ask service provider about it if possible.
(Otherwise, perhaps I'm overlooking some simple or important thing...)
myandylai
Posts: 9
Joined: Sun Jan 29, 2012 4:38 am

Re: Newbee: Cacti on Ubuntu not drawing graph

Post by myandylai »

If I use a non-root account to reinstall again Cacti and RRDTOOL does it had any changes to fix the problem? I am thinking could it be some permission or security issue that I install cacti using a root account?

But last time when I was using VPS I did usually use root account to install Cacti and it works correctly.

Thanks.

Edit,

I testing install again with a normal user account. But it was the same result.

Something was really bordering me as I found that Cacti can't access /var/log/cacti/cacti.log with the original file permission which was,

-rw-r----- 1 33 33 0 2012-02-03 21:59 cacti.log
www-data:www-data

Cacti can access the cacti.log when I change the owner to root,

-rw-r----- 1 0 33 0 2012-02-03 21:59 cacti.log
root:www-data
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests