Hello,
My question is rather lengthy so please bear with me.
I have written a kiosk program in Macromedia Director. This kiosk program displays informational items as well as displays employee photos. The kiosk program is installed on 6 different machines throughout a manufacturing plant. Since the kiosks are spread across the manufacturing plant floor, the client wanted an easy solution for checking the status of each of the kiosks to see if they were running.
My solution to this problem was to create a couple of .asp pages for monitoring as well as creating text files.
The first .asp page I wrote is called 'kioskupdater.asp'. The only function of this .asp page is to create a file on the server using the name of kiosk as the filename that is created on the server. This .asp page is called from within the kiosk program every 2 minutes. Thus the kiosk file, which is named according to the kiosk, is being updated on the server every 2 minutes. This .asp page is working without any problems.
The second .asp page I wrote, and I need help with validating the code, is called 'index.asp'. In a nutshell this .asp pages main functionality is to compare the modified time of the kiosk file that was created by the 'kioskupdated.asp' page against the time on the server. If the modified time of the kiosk file happens to be greater than the 'offset' time, a graphic displaying the kiosk being 'offline' is suppose to be displayed. Conversely if the kiosk files modified time falls within the 'offset' time, a graphic displaying the kiosk being 'online' is displayed. Finally if no kiosk file has been created for a particular kiosk a 'n/a' graphic is displayed.
This is what the index.asp page looks like when it's running:
http://www.rise4peace.com/index.asp.jpgThis is the code behind the index.asp page:
http://www.rise4peace.com/index.asp.txtThe main function of the 'index.asp' page is called:
is_kiosk_active("asm_ping"
, 15)
The first parameter is the name of the kiosk file that should be present on the server. The second parameter is the offset time. The index.asp page passes the name of each of the kiosk files that should be present on the server along with the same offset time.
The problem that I am experiencing is that every once in awhile the index.asp page will report that one of the kiosks is 'offline' but in actuality it is not. My concern is that one or more my time comparison routines is failing and thus returning an 'offline' graphic.
Since I am comparing the kiosk files military time against the servers military time I think I may have an issue with it crossing over into a new day but I am just not 100% sure. Since this is my first attempt at writing .asp code I am hoping that one of the many gurus here can help point out any problems within the code I have written.
Many thanks,
rise4peace