It's in html/pages/graphs.inc.php, the godaweful javascript.
You probably just want your pages to use time() and then subtract seconds from it. we set them in definitions.inc.php :
$config['time']['now'] = time(); $config['time']['fourhour'] = $config['time']['now'] - 14400; //time() - (4 * 60 * 60); $config['time']['sixhour'] = $config['time']['now'] - 21600; //time() - (6 * 60 * 60); $config['time']['twelvehour'] = $config['time']['now'] - 43200; //time() - (12 * 60 * 60); $config['time']['day'] = $config['time']['now'] - 86400; //time() - (24 * 60 * 60); $config['time']['twoday'] = $config['time']['now'] - 172800; //time() - (2 * 24 * 60 * 60); $config['time']['week'] = $config['time']['now'] - 604800; //time() - (7 * 24 * 60 * 60); $config['time']['twoweek'] = $config['time']['now'] - 1209600; //time() - (2 * 7 * 24 * 60 * 60); $config['time']['month'] = $config['time']['now'] - 2678400; //time() - (31 * 24 * 60 * 60); $config['time']['twomonth'] = $config['time']['now'] - 5356800; //time() - (2 * 31 * 24 * 60 * 60); $config['time']['threemonth'] = $config['time']['now'] - 8035200; //time() - (3 * 31 * 24 * 60 * 60); $config['time']['sixmonth'] = $config['time']['now'] - 16070400; //time() - (6 * 31 * 24 * 60 * 60); $config['time']['year'] = $config['time']['now'] - 31536000; //time() - (365 * 24 * 60 * 60); $config['time']['twoyear'] = $config['time']['now'] - 63072000; //time() - (2 * 365 * 24 * 60 * 60);
adam.
On 2012-05-23 10:32, Adam Blackington wrote:
thanks Adam.... on an interface graph's page is the calendar tool allowing users to manipulate the graph. In what file(s) is that tool defined? i can't seem to find where it's referenced.
On Wed, May 23, 2012 at 4:52 AM, Adam Armstrong <adama@memetic.org mailto:adama@memetic.org> wrote:
They're Unixtime in seconds. Php time() -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. Adam Blackington <ablackington@lionlink.net <mailto:ablackington@lionlink.net>> wrote: Now that the CIDR fix has been implemented, can anyone tell me how to generate the from and to attributes in the URL? I dont understand how those attributes are calculated? Once I do, I'll be golden! graph.php?to=*1337760941*&id=4&type=port_bits&from=*1337674541*&height=300&width=1075 Thanks, Adam On Tue, May 15, 2012 at 11:19 AM, Adam Armstrong <adama@memetic.org <mailto:adama@memetic.org>> wrote: haha. adama always wins! \o/ On 2012-05-15 13:34, Andy Brown wrote: Ta, Will pull the latest then as I've shifted onto vhost based to get around the other stuff I chatting with you recently about :) Cheers Andy On 15/05/12 12:55, Adam Armstrong wrote: The CIDR option was broken until I fixed it last week in r3169 :D http://fisheye.observium.org/browse/Observium/html/includes/graphs/graph.inc.php?hb=true Those two config options are separate. The CIDR stuff was broken because the code below was exit()ing before it could be tested. :D adam. On 2012-05-15 10:19, Andy Brown wrote: Funnily enough I just tried to use this idea too (I want to export a graph to my external webserver, so am running a small script to grab the graph every hour and upload it to my public server). And I've hit the same problem with grabbing the graph.php directly and not via an authenticated login. I enabled debug and think I've found two problems: Hitting: mylan/graph.php?height=100&width=215&id=1&type=application_heyu_darkstate&debug=true It gives me: Fatal error: Call to undefined function graph_error() in /opt/observium/html/graph.php on line 47 So I assume this is the problem the OP was having but hadn't tried enabling debug, so that should be easy to fix. The second problem I think might just be my interpretation of the config options. In config.php I have put: $config['allow_unauth_graphs'] = 0; $config['allow_unauth_graphs_cidr'] = array("192.168.55.0/24 <http://192.168.55.0/24>"); But I suspect this may be the confusion, should allow_unauth_graphs be set to 1 AND something in the cidr array? Reason I ask is because in graph.php the auth part only has: if (isset($config['allow_unauth_graphs'])&& $config['allow_unauth_graphs']) { $auth = "1"; ## hardcode auth for all with config function } else { if (!$_SESSION['authenticated']) { graph_error("Session not authenticated"); exit; } } So I assume the CIDR thing is new/not fully implemented yet? Cheers :) On 04/05/12 22:47, Tom Laermans wrote: Also, that's indeed as Adam said not a direct access to graph.php as the referer is filled out :-) Tom On 4/05/2012 22:32, Tom Laermans wrote: That's a correct line, but it's HTTP 200, not 500... I didn't see any 500s in the log, but I read it from my cellphone so I could have overlooked :) Tom On Fri, 2012-05-04 at 15:27 -0400, Adam Blackington wrote: Is this not looking right? :: CLIENT.IP - - [03/May/2012:08:32:43 -0400] "GET /graph.php?type=port_upkts&id=60&from=1335961963&to=1336048363&width=100&height=20&legend=no&bg=ffffff HTTP/1.1" 200 1664 "http://OBSERVIUM.IP/device/device=1/tab=port/port=60/" "Mozilla/5.0 (Windows NT 6.1; WOW64) On Fri, May 4, 2012 at 3:20 PM, Adam Armstrong<adama@memetic.org <mailto:adama@memetic.org>> wrote: None of these logs seem relevant. None of them show you directly accessing graph.php Adam _______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium _______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium _______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium _______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium _______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium _______________________________________________ observium mailing list observium@observium.org <mailto:observium@observium.org> http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium