include last updated time on a grapf

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

Moderators: Developers, Moderators

Post Reply
lucky
Cacti User
Posts: 62
Joined: Mon Sep 30, 2002 3:23 am
Location: Germany

include last updated time on a grapf

Post by lucky »

hi,

i am a really newbie and need some help :D

i have some problems to include the last updated time of a graph. i try it with CDEF functions but i don't realy now how?!?!

i would like add the last updated time as a default for all new graphs, is it possible???

thx for help
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

You won't be able to do this with CDEF's, but if you want to follow I can explain how to do this.

First, add a new data input source and call it 'Get Current Date'. Make the input string '/bin/date', and the output string '<date>'.

Save it, and add a new field. Give the field a name of 'Current Date' and a data name of 'date'. Make sure that 'Output' is selected and 'Field Used to Update RRA' unchecked.

Save this and add a new data source. Call it 'current_date' and select 'Get Current Data' as the data input source. Select all values under 'Associated RRA's' and save.

Now to add the 'Last Updated Date' to your graph, simply add a new graph item. Then choose 'current_date' for the data source, 'COMMENT' for the graph item type, and enter the text format in this form:

Code: Select all

Last Updated: <date>
Hope this helps :D

-Ian
jian
Posts: 3
Joined: Mon Sep 30, 2002 3:38 am
Location: Singapore

Post by jian »

Thanks raX.

i did it on W2K Pro.
instead of using /bin/date as the input source, i used c:/unxutil/bin/dateu.exe (rename dateu.exe from date.exe). :)
lucky
Cacti User
Posts: 62
Joined: Mon Sep 30, 2002 3:23 am
Location: Germany

Post by lucky »

hi,

thx for help.

i am working on a win2000 server..... :cry:

it doesn' t work

the values in the graph are blank!!

i am working with input strings 'date /t' and 'time /t' on win 2000

c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start="-86400" \
--title="Traffic Analysis for 10.224.26.247__FastEthernet0/0" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--vertical-label="Bits Per Second" \
DEF:a="c\:/inetpub/wwwroot/cacti/rra/traf_10_224_26_247_2_in.rrd":traf_10_224_26_247_:AVERAGE \
DEF:b="c\:/inetpub/wwwroot/cacti/rra/traf_10_224_26_247_2_out.rrd":traf_10_224_26_247_:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:cdefe#002A97:"Outbound" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"last updated: " \
COMMENT:""


thx for help
jian
Posts: 3
Joined: Mon Sep 30, 2002 3:38 am
Location: Singapore

Post by jian »

hi,

i've tried two different data inputs "date/t" and "time/t". Both worked.
However, it seems that rrdtool only allow one COMMENT. So i couldn't print both date and time together.

i'm using unxutil's date.exe function, which return date/time as follows:

Mon Oct 7 15:55:01 Malay Peninsula Standard Time 2002

cheers
lucky
Cacti User
Posts: 62
Joined: Mon Sep 30, 2002 3:23 am
Location: Germany

Post by lucky »

thx @all it works :D :D :D
User avatar
eddy
Posts: 32
Joined: Wed Apr 03, 2002 8:48 am
Location: Mississauga, Ontario

Post by eddy »

I have been trying to do this for sometime now on a win2k server. I have setup the data input and date source as you have explaned but when I run cmd.php to check if all is ok I get this wrror message:

C:\Apache\htdocs\cacti>php cmd.php
ERROR: Not enough arguments
X-Powered-By: PHP/4.2.0
Content-type: text/html

Any help would be greatly appreciated

Eddy :o
anthony.warren
Posts: 31
Joined: Fri Nov 22, 2002 10:50 am
Location: Rochester, UK

Post by anthony.warren »

Eddy,
Did you ever get this sorted because I am getting the same message using Unxutils dateu.exe?

Anthony
Guest

Post by Guest »

Anthony,

No I never did get this figured out but it works none the less, I just ignore the error message now.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests