Debian - installed cacti on two servers - none will graph

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

Moderators: Developers, Moderators

Post Reply
Grimnar
Posts: 8
Joined: Sat Mar 31, 2012 11:49 am

Debian - installed cacti on two servers - none will graph

Post by Grimnar »

Hi

So I installed Cacti on two servers, one of them are production and one is a fresh one to allow me to fool around with.

Anyways, I started off on the prodserver using aptitude install cacti and that one worked like a charm. But cacti on debian came without PIA so
I decided to install using the tarballs.

Fixed me a cacti.domain.tld in /var/www/cacti and installed from there. Fixed the mysql stuff as well using phpmyadmin to setup the cacti user and to import the sql-file. No problems so far.

Did the install with green lights all over. And I use www-data to run the crontab since since it's the apache user and stuff.

Code: Select all

*/5 * * * * www-data php /var/www/cacti-0.8.7i-PIA-3.1/poller.php > /dev/null 2>&1
See attached image for what I mean about not graphing:


But after I added a device, no graph was showing up. I have read many pages on this forum but still nothing. I have read gandalfs signature over and over but still have no cluet to what can be wrong.

There is no error reporting going on either when I turn on debuggin in the cacti system. Only this as far as I can tell from syslog:

Code: Select all

 suhosin[23276]: ALERT - script tried to disable memory_limit by setting it to a negative value -1 bytes which is not allowed (attacker 'REMOTE_ADDR not set', file 'unknown')

So after beginning to loose some serious hair, I decided to install a fresh debian system. So doing everything above -except installing the debian cacti package. And I did it to be sure there was no problems with snmp/snmpd.

Eventually after installing rrdtool,mysql, php5-gd, snmp/snmpd I still see no graphs on none of the servers.

By the way, this is from the syslog on the "toy-around-server"

Code: Select all

Mar 31 19:05:01 debianmac /USR/SBIN/CRON[2893]: (www-data) CMD (www-data php /www/cacti/poller.php > /dev/null 2>&1)
Mar 31 19:05:01 debianmac /USR/SBIN/CRON[2891]: (CRON) error (grandchild #2893 failed with exit status 127)


So can the problem be with the user www-data?
What have I overlooked?!

There has to be some simple stuff...
Let me know if I should post some stuff from the servers. Lets use the toy server since I can do whatever without being afraid of breaking some production stuff ;)
Attachments
Skjermbilde 2012-03-31 kl. 19.13.00.png
Skjermbilde 2012-03-31 kl. 19.13.00.png (11.91 KiB) Viewed 1119 times
Grimnar
Posts: 8
Joined: Sat Mar 31, 2012 11:49 am

Re: Debian - installed cacti on two servers - none will gra

Post by Grimnar »

This is from the debug version of the logfile:

Code: Select all

03/31/2012 08:00:49 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1333130448 --end=1333216848 --title='Localhost - Memory Usage' --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2012/03/30 20\:00\:48 To 2012/03/31 20\:00\:48\c" COMMENT:" \n" --vertical-label='kilobytes' --slope-mode --font TITLE:10: --font AXIS:7: --font LEGEND:8: --font UNIT:7: DEF:a="/var/www/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105FF:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73BFF:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"

:roll:
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Debian - installed cacti on two servers - none will gra

Post by gandalf »

Grimnar wrote: And I use www-data to run the crontab since since it's the apache user and stuff.

Code: Select all

*/5 * * * * www-data php /var/www/cacti-0.8.7i-PIA-3.1/poller.php > /dev/null 2>&1
Please route output to /tmp/some/file and see what you get there
R.
Grimnar
Posts: 8
Joined: Sat Mar 31, 2012 11:49 am

Re: Debian - installed cacti on two servers - none will gra

Post by Grimnar »

Thank you for the reply

Here is the output so far:

Code: Select all

*/5 * * * * www-data php /var/www/cacti/poller.php > /tmp/cacti

After a few minutes..

Code: Select all

Sun Apr  1 21:56:24 CEST 2012
www-data@domain.tld:/tmp/cacti$ ls
www-data@domain.tld:/tmp/cacti$ 

lmouly
Posts: 10
Joined: Fri Jan 29, 2010 6:16 am
Location: France

Re: Debian - installed cacti on two servers - none will gra

Post by lmouly »

this
/var/www/cacti/poller.php > /tmp/cacti
redirects to a file, but you created the "/tmp/cacti" directory.

Delete your "/tmp/cacti" directory, the file "cacti" will be created in the "/tmp/" directory
Grimnar
Posts: 8
Joined: Sat Mar 31, 2012 11:49 am

Re: Debian - installed cacti on two servers - none will gra

Post by Grimnar »

Yeah, I noticed when I got about 300 mails from Cron that there was something wrong today when I came home from work ;)

Anyways.

I noticed in my earlier crontabs (as the user www-data) that I had */5 * * * * www-data php /var/www/cacti/poller.php and cron was not happy about this. "www-data could not be opened) So I removed the www-data and are now running:

Code: Select all

*/5 * * * * www-data php /var/www/poller.php > /tmp/cacti 
So I think Im going somewhere at least. But then this mail shows up from cron:

Code: Select all

To: www-data@debianmac
Subject: Cron <www-data@debianmac> /usr/bin/php5 /www/cacti/poller.php > /tmp/cacti (failed)
Content-Type: text/plain; charset=UTF-8
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/var/www>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=www-data>

Could not open input file: /www/cacti/poller.php
I even tried to chmod 777 and chmod +x the poller.php and chown it to www-data but still the same result.

Code: Select all

-rwxrwxrwx 1 www-data www-data 17938 Dec 12 03:09 /var/www/cacti/poller.php

Code: Select all

www-data@debianmac:/tmp$ cat cacti 
www-data@debianmac:/tmp$ 
Grimnar
Posts: 8
Joined: Sat Mar 31, 2012 11:49 am

Re: Debian - installed cacti on two servers - none will gra

Post by Grimnar »

Latest update:

On the production server I now get this from cat /tmp/cacti

Code: Select all

04/02/2012 03:50:02 PM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '301', Max Runtime '298', Poller Runs: '1'
04/02/2012 03:50:02 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/cacti-0.8.7i-PIA-3.1/cmd.php" 0 17]
04/02/2012 03:50:02 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/cacti-0.8.7i-PIA-3.1/cmd.php" 18 18]
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
Waiting on 1 of 2 pollers.
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.02
OK u:0.01 s:0.00 r:0.02
OK u:0.01 s:0.00 r:0.02
OK u:0.01 s:0.00 r:0.02
OK u:0.01 s:0.00 r:0.03
OK u:0.01 s:0.00 r:0.03
OK u:0.01 s:0.00 r:0.03
OK u:0.01 s:0.00 r:0.03
OK u:0.01 s:0.00 r:0.04
OK u:0.01 s:0.00 r:0.04
OK u:0.01 s:0.00 r:0.04
OK u:0.01 s:0.00 r:0.04
OK u:0.01 s:0.00 r:0.04
OK u:0.01 s:0.00 r:0.05
OK u:0.01 s:0.00 r:0.06
04/02/2012 03:50:02 PM - SYSTEM STATS: Time:0.3231 Method:cmd.php Processes:5 Threads:N/A Hosts:3 HostsPerProcess:1 DataSources:31 RRDsProcessed:20
OK u:0.01 s:0.00 r:0.08
OK u:0.01 s:0.00 r:0.08
OK u:0.01 s:0.01 r:0.08
OK u:0.01 s:0.01 r:0.08
Loop  Time is: 0.33
Sleep Time is: 299.67
Total Time is: 0.33 
Using this crontab :

Code: Select all

*/5 * * * * php /var/www/cacti-0.8.7i-PIA-3.1/poller.php > /tmp/cacti

And from the test server I get this:

Code: Select all

www-data@debianmac:/tmp$ cat cacti 
www-data@debianmac:/tmp$ 
And using this crontab:

Code: Select all

*/5 * * * * php /www/cacti/poller.php > /tmp/cacti
Grimnar
Posts: 8
Joined: Sat Mar 31, 2012 11:49 am

Re: Debian - installed cacti on two servers - none will gra

Post by Grimnar »

Final update I guess:

It is now working! :D

My production server running Debian 6.0 is now graphing again!

So for future Debian users who are using the official tarballs from this site:

Version: cacti-0.8.7i-PIA-3.1.tar.gz
My cactiuser = www-data
And I`m running everything from /var/www/cacti/ so chmod/chown that folder so www-data can use it properly.
This is the correct crontab syntax to make it work:

Code: Select all

*/5 * * * * php /var/www/cacti/poller.php > /dev/null 2>&1
as the user www-data


And remember, Im using the tarballs since the debian version is not supporting the plugin archive as of early April 2012.

Thanks for the help everybody 8)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests