ksh cacti script works, no graph

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

Moderators: Developers, Moderators

Post Reply
scottbowden23
Posts: 4
Joined: Fri Jun 02, 2006 10:18 pm

ksh cacti script works, no graph

Post by scottbowden23 »

The script is working per the logs, just a ps -ef|wc $1 for figuring out how to do this.

log output:
06/02/2006 10:15:11 PM - CMDPHP: Poller[0] Host[64] DS[2034]CMD: /tmp/cacti.ksh -l, output: 72

But the graph doesn't display
ERROR: Could not parse line 'GPRINT::LAST:Current\:%8.2lf%s'

Data Source:
/usr/local/bin/rrdtool create \
/usr/local/apache2/htdocs/cacti/rra/localhost_wc_2034.rrd \
--step 300 \
DS:wc:GAUGE:600:0:U \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \

Also running strings on the rdd file show data is being put in the file. I am using the type GUAGE set at the Data Source level.

strings output:
0003
GAUGE
AVERAGE
AVERAGE
AVERAGE
AVERAGE
LAST
LAST
LAST
LAST
UNKN
5y@S
@XA~K
@XA~K
@XA~K
Y@Ro\(
@XA~K
~K@Ru
Y@Ro\(
@XA~K
~K@Ru
Y@Ro\(

Please provide a little direction on how to have my output: value of 72 graph correctly.

Thank you,

Scott D. Bowden

PS, searching the board and found a little more info, but I still have the problem.

rrdtool fetch localhost_wc_2034.rrd LAST -r 1 -s -1h
wc

1149303300: 7.5400000000e+01
1149303600: 7.6003333333e+01
1149303900: 9.7023333333e+01
1149304200: 7.8173333333e+01
1149304500: 7.3830000000e+01
1149304800: 7.7953333333e+01
1149305100: 7.7433333333e+01
1149305400: 7.7400000000e+01
1149305700: 7.7413333333e+01
1149306000: 7.4960000000e+01
1149306300: 7.7963333333e+01
1149306600: NaN
1149306900: NaN
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please select your graph from Graph Management and switch to DEBUG mode, then. Post the whole rrdtool graph command. There's definitively sth wrong with the template. Suppose, the reference to the data source is missing
Reinhard
scottbowden23
Posts: 4
Joined: Fri Jun 02, 2006 10:18 pm

Post by scottbowden23 »

I have attached what I think you mean. I turned on Debug for the graph I'm having trouble with. However, I only see the error not the whole rrdtool command? Where can I grab that whole command from?
Attachments
cacti.JPG
cacti.JPG (17.34 KiB) Viewed 1205 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Oops, sorry. This feature was introduced lately.
So please select the graph from the Graphs Tab to see all 4 rra's. Then click on one of the wrenches
Reinhard
scottbowden23
Posts: 4
Joined: Fri Jun 02, 2006 10:18 pm

I found the rrd output

Post by scottbowden23 »

I found the output but forgive me, my ability to read rrd tool is very limited at best.

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=1149476735 \
--end=1149563135 \
--title="proc count" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2006/06/04 22\:05\:35 To 2006/06/05 22\:05\:35\c" \
COMMENT:" \n" \
--vertical-label="" \
--slope-mode \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n"

Below this point is one that works, I seem to be missing a DEF in the broken graph?

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="LocalHost - net -snmp - CPU Usage" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="percent" \
--slope-mode \
DEF:a="/usr/local/apache2/htdocs/cacti/rra/localhost_cpu_system_769.rrd":cpu_system:AVERAGE \
DEF:b="/usr/local/apache2/htdocs/cacti/rra/localhost_cpu_user_770.rrd":cpu_user:AVERAGE \
DEF:c="/usr/local/apache2/htdocs/cacti/rra/localhost_cpu_idle_772.rrd":cpu_idle:AVERAGE \
DEF:d="/usr/local/apache2/htdocs/cacti/rra/localhost_cpu_wait_771.rrd":cpu_wait:AVERAGE \
DEF:e="/usr/local/apache2/htdocs/cacti/rra/localhost_cpu_kernel_768.rrd":cpu_kernel:LAST \
AREA:a#FF0000:"System" \
GPRINT:a:LAST:"Current\:%8.0lf" \
GPRINT:a:AVERAGE:"Average\:%8.0lf" \
GPRINT:a:MAX:"Maximum\:%8.0lf\n" \
AREA:b#FFF200:"User":STACK \
GPRINT:b:LAST:" Current\:%8.0lf" \
GPRINT:b:AVERAGE:"Average\:%8.0lf" \
GPRINT:b:MAX:"Maximum\:%8.0lf\n" \
AREA:c#AAABA1:"Idle":STACK \
GPRINT:c:LAST:" Current\:%8.0lf" \
GPRINT:c:AVERAGE:"Average\:%8.0lf" \
GPRINT:c:MAX:"Maximum\:%8.0lf\n" \
LINE1:d#00BF47:"Wait" \
GPRINT:d:LAST:" Current\:%8.0lf" \
GPRINT:d:AVERAGE:"Average\:%8.0lf" \
GPRINT:d:MAX:"Maximum\:%8.0lf\n" \
LINE1:e#00A0C1:"Kernel" \
GPRINT:e:LAST:"Current\:%8.0lf" \
GPRINT:e:AVERAGE:"Average\:%8.0lf" \
GPRINT:e:MAX:"Maximum\:%8.0lf"
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: I found the rrd output

Post by gandalf »

scottbowden23 wrote: --lower-limit=0 \
...
the DEF statements are missing here!
...
COMMENT:"From 2006/06/04 22\:05\:35 To 2006/06/05 22\:05\:35\c" \
COMMENT:" \n" \
--vertical-label="" \
--slope-mode \
GPRINT::LAST:"Current\:%8.2lf%s" \
GPRINT::AVERAGE:"Average\:%8.2lf%s" \
GPRINT::MAX:"Maximum\:%8.2lf%s\n"
Your suggestion is quite right. So the Graph Template is broken. Select the item you suppose to be graphed (as a LINE or AREA) and choose the correct data source AND a color for it. If in doubt, post a screenshot of the graph item/graph template
Reinhard
scottbowden23
Posts: 4
Joined: Fri Jun 02, 2006 10:18 pm

you rock!

Post by scottbowden23 »

lvm, has anyone told you lately that you rock, because you do! That did it, now I know how to incorporate my nagios monitoring into my trending with cacti.

Thank you for your help,

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

Re: you rock!

Post by gandalf »

scottbowden23 wrote:... now I know how to incorporate my nagios monitoring into my trending with cacti.
Would you mind sharing your results with the community? There is already a steadily growing "fan club" of cacti AND nagios users as can be seen at Add-Ons and Scripts and Templates
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests