No graphs

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

Moderators: Developers, Moderators

Post Reply
arminp
Posts: 6
Joined: Sat May 19, 2007 10:24 pm

No graphs

Post by arminp »

Hi I am new to cacti and am trying to get my first graph going.

I want to make to start a simple ping to www.yahoo.com.

I have the device and graph set-up etc set-up.
RRDTool Command:

/usr/local/rrdtool-1.2.23/bin graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="yahoo - Ping Latency" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="milliseconds" \
AREA:#FFF200:"" \
GPRINT::LAST:"Current\:%8.2lf %s" \
GPRINT::AVERAGE:"Average\:%8.2lf %s" \
GPRINT::MAX:"Maximum\:%8.2lf %s"

I had checked that the rrdTool is generating graphs as per install test of rrd and it did.

But I do believe the poller.php has some difficulties.

Here is my poller cahe

Script: perl /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/scripts/ping.pl www.yahoo.com
RRD: /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/rra/yahoo_ping_9.rrd

as per FAQ I ran poller in shell and I get

[root@s15252520 cacti-0.8.6j]# php poller.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pgsql.so' - libpq.so.4: cannot open shared object file: No such file or directory in Unknown on line 0
05/19/2007 08:33:15 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/cmd.php 0 2]
sh: /bin: is a directory
Waiting on 1/1 pollers.
Waiting on 1/1 pollers.
.... many of those ....
Waiting on 1/1 pollers.
Waiting on 1/1 pollers.
05/19/2007 08:07:37 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceeded. Exiting.
05/19/2007 08:07:37 PM - SYSTEM STATS: Time:293.0145 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:1 RRDsProcessed:0
PHP Warning: pclose(): 50 is not a valid stream resource in /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/lib/rrd.php on line 47

Any advise help is highly appreciated.

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

Post by gandalf »

pgsql.so? Strange!
Please have a look at recent discussion at http://forums.cacti.net/viewtopic.php?t=21344 on activating mysql support
Reinhard
arminp
Posts: 6
Joined: Sat May 19, 2007 10:24 pm

Post by arminp »

Hi Gandalf,

I appreciate your help . I had checked the Threat you mentioned already to no avail. I resolved the pqsql.so issue - but I am still getting the same results, no graphs and when I run poller.php in shell mode it basicallt times out:


# php poller.php
05/20/2007 08:52:41 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/cmd.php 0 3]
sh: /php: No such file or directory
Waiting on 1/1 pollers.
sh: /bin: is a directory
Waiting on 1/1 pollers.
Waiting on 1/1 pollers.

.... many of these ....

Waiting on 1/1 pollers.
Waiting on 1/1 pollers.
05/20/2007 09:11:50 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceeded. Exiting.
05/20/2007 09:11:50 PM - SYSTEM STATS: Time:292.6227 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:6 RRDsProcessed:0
PHP Warning: pclose(): 57 is not a valid stream resource in /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/lib/rrd.php on line 47


So I went to your "Debug NaN's in your graphs" instructions


step 1 : checK the cacti log file

I couln't see anything unusual here. It has lots of these :

05/20/2007 09:06:56 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) LIMIT 10000"

05/20/2007 09:06:57 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"


and a few of these :

05/20/2007 09:06:57 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select count(*) from poller_item"
05/20/2007 09:06:57 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select id from host where disabled = '' order by id"
05/20/2007 09:06:57 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "replace into settings (name,value) values ('path_webroot','/var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j')"
05/20/2007 09:06:57 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "truncate table poller_time"
05/20/2007 09:06:57 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/cmd.php 0 3]



Step 2 : Check Basic Data Gathering

perl /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/scripts/ping.pl www.google.com

returns 129

so that seems okay

Step 3 : Check cacti's poller

# php /var/www/vhosts/metrics.onvaio.net/httpdocs/cacti/cacti-0.8.6j/cmd.php 0 3
#

This basically runs and after 15 secs or so comes back with no response at all??
Not sure if this is normal ??


Step 4 : Check MySQL updating

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0002 sec)

SQL query: SELECT poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num
FROM (poller_output, poller_item) WHERE (poller_output.local_data_id = poller_item.local_data_id AND poller_output.rrd_name = poller_item.rrd_name)
LIMIT 10000

Okay I think here is something not correct !!! But what ??


Any idea ?? :-?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I've been seeing this lately. What version of PHP? How much memory have your allocated for PHP in php.ini? If should be > 64mbytes.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
arminp
Posts: 6
Joined: Sat May 19, 2007 10:24 pm

Post by arminp »

Hi Witness, thanks for the idea. I found that my mem was 32 so I increased this ...

PHP ver = 5.0.4, Mem = 128
graphs = 0 :(
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Hmm, grab the following from SVN BRANCH_0_8_6: lib/database.php and replace yours with it. See if you get better output.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Suzumushi
Posts: 8
Joined: Thu May 12, 2005 9:14 am

Post by Suzumushi »

TheWitness wrote:Hmm, grab the following from SVN BRANCH_0_8_6: lib/database.php and replace yours with it. See if you get better output.

TheWitness
did not help
php 5.2.2
cacti-0.8.6j
cactid - latest

log:
05/23/2007 07:01:26 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
05/23/2007 07:01:26 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) LIMIT 15000"
05/23/2007 07:01:26 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceeded. Exiting.


Waiting on 1/1 pollers.
05/23/2007 07:01:26 PM - POLLER: Poller[0] Maximum runtime of 292 seconds exceeded. Exiting.
05/23/2007 07:01:26 PM - SYSTEM STATS: Time:293.5732 Method:cactid Processes:10 Threads:4 Hosts:137 HostsPerProcess:14 DataSources:2545 RRDsProcessed:0

Warning: pclose(): 75 is not a valid stream resource in /usr/local/apache/htdocs/cacti-0.8.6j/lib/rrd.php on line 47


when using cmd.php - no problems

best regards

Suzumushi
arminp
Posts: 6
Joined: Sat May 19, 2007 10:24 pm

Post by arminp »

I made some progress and found two items that may be helpfull for others

a) I fixed my path statements for php and the rrdtool to include the bin itself. So instead of /usr/bin/ I used /usr/bin/php ... same for the rrdtool

b) although using a unix ping script ... I had to get the snmp version setting correct. use snmpwalk -cpublic -v1 <host IP> to find it. btw requires the snmpd to run. The issue was that cacti though the host is down so for whatever reasons it uses snmp to validate that the host is up.

Note: I am wondering what to do with hosts that don't have snmp - is this a requirement?

Well the good news is my RRD file has been populated and the log shows CACTI2RRD: entries with good results.

running a <rrdtoolpath>/rrdtool info <rrd file> shows the data is in and I am now really down to graphing. So I hope anybody has an idea.

my graph debug shows:

/usr/local/rrdtool-1.2.23/bin/rrdtool graph - \
--imgformat=PNG \
--start=1180065537 \
--end=1180151937 \
--title="my host - Ping Latency" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2007/05/24 20\:58\:57 To 2007/05/25 20\:58\:57\c" \
COMMENT:" \n" \
--vertical-label="milliseconds" \
--slope-mode \
DEF:a="/var/www/vhosts/.../cacti-0.8.6j/rra/my_host_ping_18.rrd":ping:AVERAGE \
AREA:a#FFF200:"legend text graph" \
GPRINT:a:LAST:"Current\: 8.2lf s" \
GPRINT:a:AVERAGE:"Average\: 8.2lf s" \
GPRINT:a:MAX:"Maximum\: 8.2lf s"

which looks good to me - but no graph
arminp
Posts: 6
Joined: Sat May 19, 2007 10:24 pm

Post by arminp »

It may help others. I have found that bug 666 http://bugs.cacti.net/view.php?id=666 was reported. This looks like exactly what I have. - simply no graphs

Also I have set-up graph_exporting and that works great as this works with the poller.php when crontab runs my PATH is different

So I think what is going on is as cacti runs online under the appache env it doesn't find the rrdtool that is in a separate directory. I have no clue how make sure that this is visible to appache and cacti is finding it where it looks for?

Thanks for all the help so far - this is a great tool - and I know I am getting close

Best
Armin
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest