Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Date/Time "hack" not working in 0.8 (of end May)

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions
Author Message
jvanhambelgium



Joined: 10 Jan 2003
Posts: 33
Location: Antwerpen (Belgium)

PostPosted: Tue May 20, 2003 6:06 am    Post subject: Date/Time "hack" not working in 0.8 (of end May) Reply with quote

Hi,

I've tried to implement the workaround to display the current Date/Time on a graph as describe in another forum some time ago ;
Tried it on 0.6.8a and it works just fine.

Tried it on 0.8 on FreeBSD ;

- Create Data Input method
- Created DataSource using the above method
- Edited some graph and added an entry/item of type COMMENT where I place <date> on the "Text Format" line.


Respons ;

Notice: Undefined Variable : text_format_lenght in /www/htdocs/cactiptod/include/rrd_functions.php on line 541

Any clues ?? The output of my "date" command is Date + Time ... perhaps malformatted or to long ??

Thanks & regards,
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Wed May 28, 2003 2:25 pm    Post subject: Reply with quote

I just added this capability to 0.8, so that it is no longer a hack. To add the date/time of the last update, simply add a COMMENT graph item type that reads:

Code:
|date_time|


-Ian
Back to top
jian



Joined: 30 Sep 2002
Posts: 3
Location: Singapore

PostPosted: Fri May 30, 2003 2:06 am    Post subject: date_time not working Reply with quote

I've tried adding a COMMENT with text format "Last updated: <date_time>" into the Graph Template of Interface - Traffic (bits/sec). However, no COMMENT item appear on the graph.

Please help to explain the process in more detail. Thanks.
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Fri May 30, 2003 2:22 am    Post subject: Reply with quote

The text you would have to put on the graph is:

"Last updated: |date_time|"

-Ian
Back to top
acrophile



Joined: 11 Sep 2003
Posts: 14
Location: Idaho

PostPosted: Fri Sep 12, 2003 8:52 pm    Post subject: Reply with quote

Does this work with cactid? My date_time's are stuck at the last time cmd.php ran...
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Sun Sep 14, 2003 5:02 pm    Post subject: Reply with quote

No, this does not work with cactid. It should however, so I added it to my TODO.

-Ian
Back to top
Guest






PostPosted: Mon Sep 15, 2003 4:57 am    Post subject: Reply with quote

Ian,

This works pretty good but I have a small problem. I get extra \ from somewhere.

Last Updated On:\ Mon Sep 11\:45\:03 CEST 2003

My Text Format reads:

Last Updated On: |date_time|

Would you happen to know the deal with those extra \s?

Thanks,
- Gaurav
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Mon Sep 15, 2003 5:10 pm    Post subject: Reply with quote

Anonymous wrote:
Would you happen to know the deal with those extra \s?


This was fixed in version 0.8.3.

-Ian
Back to top
kwabbernoot
Cacti User


Joined: 13 Oct 2003
Posts: 99
Location: Zottegem, Belgium

PostPosted: Fri Nov 21, 2003 5:53 am    Post subject: Way to Store date into Cacti Db when using Cactid Reply with quote

Hi,

I am using the cactid C poller to retrieve my stats. While browsing this forum I also found that the cactid poller does not update the date value in the 'settings' table.

I created a workaround to solve the update of the date value.
I stripped the cmd.php into the following
Code:

#!/usr/bin/php -q
<?php

include("/var/www/html/cacti/include/config.php");
include_once("/var/www/html/cacti/include/functions.php");

/* insert the current date/time for graphs */
db_execute("replace into settings (name,value) values ('date',NOW())");

?>


Because I use a shell script to launch the cactid poller I just added a call to the PHP script just before the poller runs.

REMARK: make sure that your include paths are correct with your cacti installation.

Regards,
Back to top
raX
Lead Developer


Joined: 13 Oct 2001
Posts: 2235
Location: Carlisle, PA

PostPosted: Wed Nov 26, 2003 3:49 pm    Post subject: Reply with quote

If you use cactid under version 0.8.4, it should update the |date_time| variable just fine.

-Ian
Back to top
kwabbernoot
Cacti User


Joined: 13 Oct 2003
Posts: 99
Location: Zottegem, Belgium

PostPosted: Thu Nov 27, 2003 3:53 am    Post subject: Cool Reply with quote

When I upgrade to Cacti 0.8.4 I will not have to restrip the cmd.php

Nice work Rax,
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group