|
|
| Author |
Message |
jvanhambelgium
Joined: 10 Jan 2003 Posts: 33 Location: Antwerpen (Belgium)
|
Posted: Tue May 20, 2003 6:06 am Post subject: Date/Time "hack" not working in 0.8 (of end May) |
|
|
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: 2234 Location: Carlisle, PA
|
Posted: Wed May 28, 2003 2:25 pm Post subject: |
|
|
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:
-Ian |
|
| Back to top |
|
 |
jian
Joined: 30 Sep 2002 Posts: 3 Location: Singapore
|
Posted: Fri May 30, 2003 2:06 am Post subject: date_time not working |
|
|
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: 2234 Location: Carlisle, PA
|
Posted: Fri May 30, 2003 2:22 am Post subject: |
|
|
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
|
Posted: Fri Sep 12, 2003 8:52 pm Post subject: |
|
|
| 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: 2234 Location: Carlisle, PA
|
Posted: Sun Sep 14, 2003 5:02 pm Post subject: |
|
|
No, this does not work with cactid. It should however, so I added it to my TODO.
-Ian |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Sep 15, 2003 4:57 am Post subject: |
|
|
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: 2234 Location: Carlisle, PA
|
Posted: Mon Sep 15, 2003 5:10 pm Post subject: |
|
|
| 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
|
Posted: Fri Nov 21, 2003 5:53 am Post subject: Way to Store date into Cacti Db when using Cactid |
|
|
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: 2234 Location: Carlisle, PA
|
Posted: Wed Nov 26, 2003 3:49 pm Post subject: |
|
|
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
|
Posted: Thu Nov 27, 2003 3:53 am Post subject: Cool |
|
|
When I upgrade to Cacti 0.8.4 I will not have to restrip the cmd.php
Nice work Rax, |
|
| Back to top |
|
 |
|