How do I get my graphs to work?

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

Moderators: Developers, Moderators

Post Reply
eraser
Posts: 8
Joined: Thu Sep 11, 2003 5:40 am

How do I get my graphs to work?

Post by eraser »

Hi

I am looking for some help , and I need alot of it fast.
I have been struggling almost 3 weeks to get
CACTI running so that we can start monitoring a
high availablity system.

My problem is I have no clue as to how to get
the graphs to work.
Over the weekend I heard that it
could be a PHP/browser related problem.
Now here is some details about the system.

Details
-images not showing - red crosses
-can get images if I export them to a directory
-graph debug in graph management gives me
red cross and these statements

Warning: fopen("/opt/cacti-0.8.3a/log/rrd.log", "a") - Permission denied in /opt/cacti-0.8.3a/include/functions.php on line 242

Warning: fclose(): supplied argument is not a valid File-Handle resource in /opt/cacti-0.8.3a/include/functions.php on line 244

The above is all generate from localhost(linux 127.0.0.1)
& if I run the source code from the command line & output it to file.png
and try & view it through the browser , it comes out fine.

plz can someone help me?
eraser
Coeus
Cacti User
Posts: 51
Joined: Mon Aug 04, 2003 8:46 pm
Location: Perth - Western Australia

Post by Coeus »

Hi Eraser,

First check the permissions on the log and rra directory. They should be cactiuser:root or similar.

chown -R cactiuser:root <pathtocacti>/log
chown -R cactiuser:root <pathtocacti>/rra

Afte that post the output of
php cmd.php
When run as cactiuser

Thanks

Carl
eraser
Posts: 8
Joined: Thu Sep 11, 2003 5:40 am

Output of cmd.php

Post by eraser »

Hi carl ,
Permission are set full for the whole Cacti directory
& rra , log.

my apache settings:
# Virtual hosts
DocumentRoot /opt/cacti-0.8.3a

<Directory "/opt/cacti-0.8.3a">
AllowOverride none

my cacti settings:
cacti Web Root: nothing
Web Server Document Root: /opt/cacti-0.8.3a

and I had to make mods to the install to make things work
I created a cacti/include and scripts directory in /opt/cacti-0.8.3a
(/opt/cacti-0.8.3a/cacti/include , scripts) and copied the original
folders to there.From there my cmd.php ran fine.Before it was
looking for that (/opt/cacti-0.8.3a//cacti) directory when I ran cmd.php , and I did go through
all the settings from apache & cacti but found nothing to rectify
it.

[cactiuser@techdept cacti-0.8.3a]$ php cmd.php
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
X-Powered-By: PHP/4.2.2
Content-type: text/html

command: perl /opt/cacti-0.8.3a/scripts/linux_memory.pl MemFree:, output: 90496
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
command: perl /opt/cacti-0.8.3a/scripts/linux_memory.pl SwapFree:, output: 3076436
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
MUTLI command: perl /opt/cacti-0.8.3a/scripts/loadavg_multi.pl, output: 1min:0.70 5min:0.40 10min:0.35
MULTI expansion: found fieldid: 17, found rrdname: load_1min, value: 0.70
MULTI expansion: found fieldid: 18, found rrdname: load_5min, value: 0.40
MULTI expansion: found fieldid: 19, found rrdname: load_15min, value: 0.35
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
command: perl /opt/cacti-0.8.3a/scripts/unix_users.pl, output: 2
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
command: perl /opt/cacti-0.8.3a/scripts/unix_processes.pl, output: 82
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
command: perl /opt/cacti-0.8.3a/scripts/linux_memory.pl MemFree:, output: 90684
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
command: perl /opt/cacti-0.8.3a/scripts/linux_memory.pl SwapFree:, output: 3076436
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
MUTLI command: perl /opt/cacti-0.8.3a/scripts/loadavg_multi.pl, output: 1min:0.70 5min:0.40 10min:0.35
MULTI expansion: found fieldid: 17, found rrdname: load_1min, value: 0.70
MULTI expansion: found fieldid: 18, found rrdname: load_5min, value: 0.40
MULTI expansion: found fieldid: 19, found rrdname: load_15min, value: 0.35
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
command: perl /opt/cacti-0.8.3a/scripts/unix_users.pl, output: 2
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "iso-8859-1",
LANG = "en_ZA.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
command: perl /opt/cacti-0.8.3a/scripts/unix_processes.pl, output: 82
update /opt/cacti-0.8.3a/rra/localhost_mem_buffers_16.rrd --template mem_buffers N:90496
update /opt/cacti-0.8.3a/rra/localhost_mem_swap_17.rrd --template mem_swap N:3076436
update /opt/cacti-0.8.3a/rra/localhost_load_1min_18.rrd --template load_1min:load_5min:load_15min N:0.70:0.40:0.35
update /opt/cacti-0.8.3a/rra/localhost_users_19.rrd --template users N:2
update /opt/cacti-0.8.3a/rra/localhost_proc_20.rrd --template proc N:82
update /opt/cacti-0.8.3a/rra/localhost_mem_buffers_25.rrd --template mem_buffers N:90684
update /opt/cacti-0.8.3a/rra/localhost_mem_swap_26.rrd --template mem_swap N:3076436
update /opt/cacti-0.8.3a/rra/localhost_load_1min_27.rrd --template load_1min:load_5min:load_15min N:0.70:0.40:0.35
update /opt/cacti-0.8.3a/rra/localhost_users_28.rrd --template users N:2
update /opt/cacti-0.8.3a/rra/localhost_proc_29.rrd --template proc N:82
time: 0
export: running graph export
[cactiuser@techdept cacti-0.8.3a]$

thanx carl , and please send reply.

Regards
Eraser
Coeus
Cacti User
Posts: 51
Joined: Mon Aug 04, 2003 8:46 pm
Location: Perth - Western Australia

Post by Coeus »

OK,

You have a locale issue with perl that i've never had to deal with as I use english. This shouldn't be an issue as the printed output goes to /dev/null

From the output you provided, it looks as though the rrd files have been created and are updating.

Go to the graph preview view, click on one of the empty graphs, and provide the graph source here.

I get the feeling your running cacti in a chrooted environment, I've got a test box here that i'm having similar problems with.

I'll post here when I figure it out.

Cheers

Carl
eraser
Posts: 8
Joined: Thu Sep 11, 2003 5:40 am

graph source

Post by eraser »

Hi Carl.

Here is the graph source output

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--title="Localhost - Memory Usage" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="kilobytes" \
DEF:a="/opt/cacti-0.8.3a/rra/localhost_mem_buffers_16.rrd":mem_buffers:AVERAGE \
DEF:b="/opt/cacti-0.8.3a/rra/localhost_mem_swap_17.rrd":mem_swap:AVERAGE \
AREA:a#FF4105:"Free" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
STACK:b#FFC73B:"Swap" \
GPRINT:b:LAST:"Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s"

Now like I said previously I can take this run it from
command line and output it to .png and the graph is generated.
But I checked and it looks like my browser Internet Explorer
is not displaying the .png images. Maybe its my browser.

Anyway output is of some use.

Thanx Carl

Regard
Eraser
eraser
Posts: 8
Joined: Thu Sep 11, 2003 5:40 am

Problem solved

Post by eraser »

My problem is my browser.
Tried cacti in Opera and worked like a dream

Thanks again carl for all your help.

regards
Eraser :D
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest