Xymon Mailing List Archive search

Date/Time options for Report URLs

list David Baldwin
Thu, 7 Feb 2013 09:50:34 +1100
Message-Id: <user-4f53e6245c3d@xymon.invalid>

Lionel,

Not sure what system you are using for rotating web pages, but I have a
browser which loads the following page 'bbcycle.html' (you will need to
substitute for http://xymonhost and probably modify some of the URLs in
the pages list) - it would be pretty trivial to add some Javascript to
generate the daily URL string you need and add to pages list.

David.

bbcycle.html

<HTML>
<HEAD>
<SCRIPT type="text/javascript">

  var timeout = 20*1000; // milliseconds
  var pages = [ 'hobbit/bb.html', 'hobbit/bb2.html',
'rss2html/rss2html.php', 'hobbit-cgi/hobbit-nkview.sh' ];

  var server = 'http://xymonhost/';;
  var i = 0;

  function setCycle() {
     cycle();
     setInterval("cycle();",timeout);
  }
 
  function cycle() {
     if ( i >= pages.length) window.location.reload(true); // reload
page to reload list of pages if this file gets updated
     var frame = document.getElementById("disp");
     if(pages[i]) frame.src = server + pages[i];
     i++;
  }
</SCRIPT>
</HEAD>
<BODY onload="setCycle();" style="margin:0;">
<IFRAME ID="disp" SRC="" height=100% width=100% frameborder=0
marginwidth=0 marginheight=0 vspace=0 hspace=0 style="left:0; top:0;">
</IFRAME>
</BODY>
</HTML>
	We are using a display management system to cycle through the various report displays that Xymon generates, for example the "Top Changes" & "Event Log" reports. Right now I have figured out how to setup the URL to generate the report for today, but the problem is that I have to manually update the display manager to pass the URL with today's date in order to get today's information:

The URL is (using xymon.com as the example site):
http://www.xymon.com/xymon-cgi/topchanges.sh?FROMTIME=2013/02/05 at 00:00:00&TOTIME=&HOSTMATCH=&EXHOSTMATCH=&PAGEMATCH=&PATHLIST=&EXPAGEMATCH=&TESTMATCH=&EXTESTMATCH=&COLORMATCH=&COUNTTYPE=events&TOP=10&Send=Show

If you notice the "FROMTIME=" section has it manually entered in as '2013/02/05 at 00:00:00', which I have to update every day to the new date. Actually I have it set to '2013/02/01 at 00:00:00' and have it as a monthly view, but I would like it to be a daily view, as well as not have to change it every day/month.

My question is are any of the following options possibilities?

1. Be able to pass some key words on the URL such as TODAY, YESTERDAY, TOMORROW. So that I could construct the URL as simply "FROMTIME=Today" or "FROMTIME=YESTERDAY", this way Xymon would just pass me the data for the day.

2. Could I pass the date/time without the "@00:00:00", and have Xymon assume 00:00:00. Since I can have the display management system sort of pass the date dynamically, but I can't have it append the @00:00:00. So if I could construct the URL in the following manner "FROMTIME=2013/02/05&TOTIME=2013/02/06" I would get the report for 2013/02/05

3. Possibly even change the format of the "FROMTIME=" to MM/DD/YYYY , again without the @00:00:00, so it can work more with US date/time options?
-- 
David Baldwin - Senior Systems Administrator (Datacentres + Networks)
Information and Communication Technology Services
Australian Sports Commission          http://ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617


Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au

This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.