[SOLVED] Unable to get from script to graph

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

[SOLVED] Unable to get from script to graph

Post by buznakka »

Hello,

I have tried to create a graph from a script in the style of http://docs.cacti.net/?q=node/300

When I check cacti.log, my script gives output for its three output fields in the following format.
output: direct:10 lbhost:61 pool:200

My graph shows values for the "pool" data field, but not for the other two. When I do
rrdtool fetch /path/file.rrd, I see a lot of entries that look like this
1224097200: nan nan nan
1224097500: nan nan nan
1224097800: nan nan nan

mixed in with a few entries that look like this
1224096300: 2.7000000000e+01 nan nan
1224096600: 9.0600000000e+00 nan nan
1224096900: 9.0600000000e+00 nan nan

I'm sure I have done something wrong, but I'm not sure what it is at this point. Can you provide me with some help?

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

Post by gandalf »

Please show us a script example from command line. Is the string "output:" prepended to the output itself? Next, I need a screenshot of the data template
Reinhard
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

Post by buznakka »

gandalf wrote:Please show us a script example from command line. Is the string "output:" prepended to the output itself? Next, I need a screenshot of the data template
Reinhard
Does this do the trick?

SOW

My command line
[swalker@cacti:~]$ ./scripts/newstatic.pl http://www.mycompanyname.com/
direct:48 lbhost:6 pool:355[swalker@cacti:~]$

My log
10/15/2008 03:50:05 PM - CMDPHP: Poller[0] Host[587] DS[6471] CMD: /bin/perl /opt/cacti/cacti/scripts/newstatic.pl http://mycompany.com/img_/hm/20015_app_banner.jpg, output: direct:2 lbhost:5 pool:8
Attachments
static.JPG
static.JPG (176.64 KiB) Viewed 2909 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

This is all fine. Now, please post the line from "rrdtool update" as given by 2nd link of my sig to see, how the file update is performed
Reinhard
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

Post by buznakka »

gandalf wrote:This is all fine. Now, please post the line from "rrdtool update" as given by 2nd link of my sig to see, how the file update is performed
Reinhard
Thanks for your help. Is this what you're looking for?

SOW

10/16/2008 03:59:29 PM - WEBLOG: Poller[0] CACTI2RRD: /opt/cacti/bin/rrdtool graph - --imgformat=PNG --start=-7776000 --end=-300 --title="Isolated Web Server - Static Latency" --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="Milliseconds" --slope-mode --font TITLE:12: --font AXIS:8: --font LEGEND:7: --font UNIT:8: DEF:a="/mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd":pool:AVERAGE DEF:b="/mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd":pool:MAX DEF:c="/mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd":lbhost:AVERAGE DEF:d="/mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd":lbhost:MAX DEF:e="/mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd":direct:AVERAGE DEF:f="/mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd":direct:MAX LINE2:a#FFF200FF:"direct" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" LINE2:c#FF00FFFF:"lbhost" GPRINT:c:LAST:"Current\:%8.2lf %s" GPRINT:c:AVERAGE:"Average\:%8.2lf %s" GPRINT:d:MAX:"Maximum\:%8.2lf %s\n" LINE2:e#4444FFFF:"pool" GPRINT:e:LAST:" Current\:%8.2lf %s" GPRINT:e:AVERAGE:"Average\:%8.2lf %s" GPRINT:f:MAX:"Maximum\:%8.2lf %s\n"
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

No. That's "rrdtool graph". I need "rrdtool update"
Reinhard
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

Post by buznakka »

No update seems to be taking place for that file. It's happening for many other files, but not that one.
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

Post by buznakka »

gandalf wrote:No. That's "rrdtool graph". I need "rrdtool update"
Reinhard
How about this?

10/17/2008 02:10:27 PM - POLLER: Poller[0] CACTI2RRD: /opt/cacti/bin/rrdtool update /mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd --template direct 1224277692:1
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yea, that would be fine. Does this match your error?
Reinhard
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

Post by buznakka »

gandalf wrote:Yea, that would be fine. Does this match your error?
Reinhard
It corresponds to the script that is supposed to be powering the graph.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Your script is spitting out 3 values, but the update only shows one.
Please run a "php -q rebuild_poller_cache.php" to recreate the poller command table and retry
Reinhard
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

Post by buznakka »

Latest result.

10/21/2008 04:25:47 PM - POLLER: Poller[0] CACTI2RRD: /opt/cacti/bin/rrdtool update /mnt/boombox-vol2/cacti-0.8.7b/rra/isolated_web_server_pool_6471.rrd --template direct 1224631513:3
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

When you edit your Data Template and view each DS tab, is the correct Data Input Output Value drop down value selected for the DS name in question? Seem's odd.

Regards,

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?
buznakka
Posts: 17
Joined: Fri Jul 11, 2008 4:11 pm

Post by buznakka »

you're right. Something was mixed up in my graph template.

I'm resolved.
SOW
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest