Page 1 of 1 1
Topic Options
#37784 - 2003-03-12 08:01 AM Checking if a particular web-page is open on remote machine
onlinrgames Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 27
Hi,

I am running a script which monitors the status of a web-page on five different machines. If an error is reported by the web-page, I send a mail to the concerned persons. The script is working fine but what happens is that since all the five machines are continuously monitoring the status of the same page, if an error is reported by the web-page, mails from five different machines are sent to the same person.

I would like to avoid this. I can check for an active process like IExplore.exe on a remote machine by using tools like PStools etc. but how do I check if the particular web-page is open on a remote machine ?

A reply would be greatly appreciated.

Regards

Onlinegames

Top
#37785 - 2003-03-12 08:30 AM Re: Checking if a particular web-page is open on remote machine
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
first of all, running the exe might not be best way to do it... well, com is little trickier to start with. but then it's a lot easier to control.

anyway, why you need to monitor it on multiple machines?
and is there a special reason why you want it to e-mail and not via windows alerter to currently logged on admins?
_________________________
!

download KiXnet

Top
#37786 - 2003-03-12 09:30 AM Re: Checking if a particular web-page is open on remote machine
onlinrgames Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 27
Hi Lonkero,

01. Earlier, we used to monitor the web-page only from one machine but we faced the problem of users closing the script or the IE window. This used to happen repeatedly inspite of specific instructions to the users not to do so ( One reason for the instructions not being followed was that the users manning the machines were constantly changing.. )

We decided to have the monitoring on all the five machines so that at any given point of time, we have atleast one machine actively monitoring the site ( I agree this is the not the best approach and would appreciate if an alternative could be suggested ).

02. In addition to the mail being sent, the script does use "net send" to intimate local admins on the LAN. However, the servers which are being monitored are at a remote location and the only way we can alert the admins of that network is by mailing / SMS / paging them.

I hope I have clarified the situation properly.

Regards

Onlinegames

Top
#37787 - 2003-03-12 10:07 AM Re: Checking if a particular web-page is open on remote machine
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k
so, I suggest you remove all ie-related code in your script. [Big Grin]

I have a solution for you.
the solution will be executed in hidden and no IE process gets started.
neither user can stop the script as it will either prompt for access denied or log off the user if he tries to do that.

this scriptlet assumes you have IE 5.0 or higher installed on the monitoring machine.
also it assumes that you run it with WKIX32.exe!
the kix32.exe is old-style executable which shows the console window (is not hidden)

I also quess that you can make the looping around it by yourself and you have automated methods to start it so I don't address those issues.
code:
$web=createobject("microsoft.xmlhttp")
$web.open("GET","http://mysite.com/single",not 1)
$web.send
$page = $web.responsetext
$web = 0
if instr($page,"<html>") and instr($page,"<html>")
"page is fine"
else
"page is unreachable"
;do your reporting here
endif

as said, this method is easy and unvisible and also, un-breakable.

try it out.

[ 12. March 2003, 10:54: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#37788 - 2003-03-12 03:47 PM Re: Checking if a particular web-page is open on remote machine
onlinrgames Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 27
Hi Lonkero,

Frankly speaking, I didn't fully understand the script as COM is totally Greek / Latin to me... [Frown]

I did run the script as given by you ( with the required modifications like URL change, looping etc. ). The output is "Page is fine" if it is a valid URL and "Page is unavailable" otherwise even if there is no IE window open in my machine ( I understand this is the correct behaviour as per the script ).

Please correct me if I have understood the script wrongly.. It is only checking if the machine can get a valid response from the specified web-page. If yes, then, it outputs "Page is fine" and for some reason, if it cannot ( either a network problem or the server itself is down ), then it outputs "Page not unreachable".

The script is not actually checking if an IE window is open with the specified web-page or not on the machine, is it ?

Also, could you please add the portion of the scriptlet which does the same check on a remote machine also ? As I said, I am totally at sea when it comes to COM scripting. [Frown]

Regards

Onlinegames

Top
#37789 - 2003-03-12 03:55 PM Re: Checking if a particular web-page is open on remote machine
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
there is no way to do the same script with IE window.
like I said, all it's purpose is to run hidden and disable the possibility of user breaking it.

could you tell what more you need to be able to do with it?
also, what you mean with remote?
_________________________
!

download KiXnet

Top
#37790 - 2003-03-12 05:12 PM Re: Checking if a particular web-page is open on remote machine
onlinrgames Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 27
Hi Lonkero,

Assume that machine no.1 already has an IE window open with the particular web-page open ( Google, for example ).

I want the script which is running on this machine to monitor if Google web-page is open on machine nos. 2,3,4 and 5. If yes, I want the script to just keep quiet even if there is an error in the Google web-page. If no other machine has this web-page open and there is an error in the web-page, I want a mail sent from this machine to the concerned persons.

This logic would be applied on all machines. This way, I avoid the same mail being sent from different machines for a problem.

"Remote" means the location where the server is physically located ( continents apart ). This web-page just monitors the status of the servers and if there is any anomaly, it reports accordingly. ( We are using Big Brother software for monitoring of the servers ). So, when there is a problem in the servers, we need to inform our counterpart at the other end so that they can work on the servers and get it up and running again.

Hope this clarifies the situation.

Regards

Onlinegames

Top
#37791 - 2003-03-12 06:41 PM Re: Checking if a particular web-page is open on remote machine
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure, you still want to use ie stuff.
don't know why and there is also one solution with IE-com.
anyway, as I see no reason for using IE for the check, I wont provide any code.

I can't still see what you are doing with any of the ie-windows.

this method I showed can be used easily to do hidden checks from all wksta's say once per minute.
they can also be made to communicate with each other so only one is sending error.
or even, sending error mail only if all fail.

I see no future in IE...
well, at least not in this script.
_________________________
!

download KiXnet

Top
#37792 - 2003-03-13 09:28 AM Re: Checking if a particular web-page is open on remote machine
onlinrgames Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 27
Hi Lonkero,

Ok, I guess I will have do some changes in my logic ( maybe check for the presence of the script rather than the IE page itself and take required action).

In any case, thanks for your help. [Smile]

Regards

Onlinegames

Top
#37793 - 2003-03-13 04:36 PM Re: Checking if a particular web-page is open on remote machine
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might be able to check the running processes on a remote computer. This might even contain the webpage that the iexplore.exe process is currently looking at.
_________________________
There are two types of vessels, submarines and targets.

Top
#37794 - 2003-03-13 06:16 PM Re: Checking if a particular web-page is open on remote machine
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
still, I have no idea why he would want to use ie for that.
_________________________
!

download KiXnet

Top
#37795 - 2003-03-13 07:45 PM Re: Checking if a particular web-page is open on remote machine
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Lonkero,

That is quite similar to the code I have here.

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000354;p=

However, I think I will pull my UDF as I have confirmed that it does not work.

When site is down, IE Window will quickly timeout and give me default error message. With my UDF it retrieves cache so the page is still there, and thus no SITE DOWN message.

Is your code doing something different that allows it to bypass the cache server?

Top
#37796 - 2003-03-13 07:55 PM Re: Checking if a particular web-page is open on remote machine
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well.
that is not done in above code as didn't get the full picture.

and I see you don't bypass even local IE-cache in your UDF.
_________________________
!

download KiXnet

Top
#37797 - 2003-03-13 10:18 PM Re: Checking if a particular web-page is open on remote machine
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
My 2 cents...

onlinrgames,

You say,
quote:
( We are using Big Brother software for monitoring of the servers ).
Found this on Big Brother site...
quote:

Notification

Big Brother has a sophisticated notification ruleset, not for the faint of heart (blame Rob). You can notify based on time-of-day, machine, or the test that failed. In addition we support an initial delay before paging (useful to cut down on late night false alarms), page-only-every defined amount of time, paging groups, acknowledgement, and escalation. Built in support for e-mail paging, alphanumeric paging via Qpage or Sendpage, or numeric and SMS pages via Kermit for the BB Unix/Linux server platform while the NT/Win2K server platform only supports e-mail for now. Under the Unix/Linux server platform, you can even create your own custom notification procedure.

So question would be = Why not use the built in notification capability?

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 735 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.033 seconds in which 0.011 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org