• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Advice Please! monitor files on another network?

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  
Author Message
TheKingster
Link Spammer
Link Spammer


Joined: 03 May 2002
Posts: 0
Location: UK

Offline

PostPosted: Tue Sep 17, 2002 11:28 am    Post subject: Advice Please! monitor files on another network? Reply with quote

Heres one to tangle your brains:

Picture a scenario -

I wish to be able to sit on my pc at work, with a webpage open, and monitor the existence of certain files on another network. The other network I have full admin access to via PcAnywhere\VNC. If one of them files goes missing, it will show on the webpage.

Now the only way I can think of doing this is by having a server side page, with some sort of vb app on their network I make that posts certain strings to the page to tell it the file exists. With it being server side I will see it everytime I refresh the page.

Good way to do this or not? Any alternatives?

Also, I have been trying to run urls from vb, using the shell command. If you do a start then run and type in a full url, it works fine, or iexplore.exe url is ok to, but:

shell "http://www.yahoo.com" and shell "iexplore.exe http://www.yahoo.com" dont work. Any ideas?

Any help appreciated
Back to top
View user's profile Send private message
Mongrel
SF Mod
SF Mod


Joined: 30 May 2002
Posts: 8


Offline

PostPosted: Tue Sep 17, 2002 12:50 pm    Post subject: Reply with quote

We use IPMonitor - http://www.deepmetrix.com/ipmonitor - for a similar application. It monitors the bulk of our network activity and calls our Cell Phone in case of problems. There is the ability to monitor File Change, report on Event Log activity (say you were auditiing the activity on these files) and a couple other file-related functions are buried within other functions. We use it to test FTP by authenticating to the server and looking for the existence of a file in a known location.
Back to top
View user's profile Send private message
enigman
Just Arrived
Just Arrived


Joined: 09 Oct 2002
Posts: 0
Location: Sydney

Offline

PostPosted: Thu Oct 10, 2002 6:27 am    Post subject: You could try using Windows Script Host Reply with quote

If the machine you are wanting to monitor is a Windows box, you could always write a script using Windows Script Host and have it check for the presence of the file(s). If the file(s) isn't present have it insert the required text into a HTML file or into a text file. Have an ASP page insert the text from the text file into a HTML document. Assuming you aren't squeamish about having WSH active on a box and that the script is monitoring files on the one box.

Some sample VBScript code

Code:

Dim oFSO, oFile
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
If Not oFSO.FileExists("YourFileName") Then
  ' Create some text to insert into a HTML or text file
Else
  ' Do  nothing
End If

Set oFSO = Nothing


You could then call the script on the box via a schedule.

The whole thing could probably also be done using ASP and have the page refresh itself every few minutes.

Enigman
Thought of the day:
It's okay to call someone stupid; just don't prove it.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
browolf
Trusted SF Member
Trusted SF Member


Joined: 19 Apr 2002
Posts: 1


Offline

PostPosted: Thu Oct 10, 2002 11:56 am    Post subject: Reply with quote

if you're using wsh, instead of having the webpage u could just make it do "net send", and send you a alert windows when one of the files has gone.
Back to top
View user's profile Send private message
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Thu Oct 10, 2002 1:18 pm    Post subject: Expand... Reply with quote

with regards to launching webpages, try the command below:

"C:\Program Files\Internet Explorer\iexplore.exe" -nohome "www.yahoo.com"

No gaurentees it will work but worth a try.

The way the main problem is handled depends on your exact requirements, and tools availalbe to you. You mentioned you wish to monitor "files"? are they likely to go missing? or are do you just wish to keep tabs of when a server goes down? Assuming you are only monitoring files, see below:

I would agree with browolf and use a net send command. i have expanded the vbscript by enigman to do this:

Code:

Dim oFSO, oFile
Dim wshshell
Set wshshell=createobject("wscript.shell")
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")

If Not oFSO.FileExists("YourFileName") Then
 wshshell.run ("net send username One of your files has gone missing")
Else
  ' Do  nothing
End If

Set oFSO = Nothing


Explaination:
This is the full script which tests for the existance of the file name, and sends a notification if it is not there.

we assume you have netbios access to the file you want to check.

to make the script work on your system, change "username" in the net send statement to which ever user you log on as. also change "yourfilename" to the name of the file.

There is room for expanding this script:
1) send an email if the file is not there
2) log the event to a file or the system eventlog
3) automatically copy back a file if the one you are monitoring gets deleted.

to make sure the script is constently in action, you could:
1) modify the script to continiously loop
2) add a scheduled task to run the scipt every x mins.

Best of luck
Jason
Back to top
View user's profile Send private message Send e-mail
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Thu Oct 10, 2002 1:34 pm    Post subject: Reply with quote

With regards to sending an email by vb script, see the following KB article:
It describes sending emails via script.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q197920

If this suits your needs better than the net send idea, me or another user (voulenters? Very Happy ) can build a combined script.

let us know.


J
Back to top
View user's profile Send private message Send e-mail
browolf
Trusted SF Member
Trusted SF Member


Joined: 19 Apr 2002
Posts: 1


Offline

PostPosted: Thu Oct 10, 2002 6:47 pm    Post subject: Reply with quote

or

you can get commandline emailers. i think the most well known one is called Blat.
(http://www.interlog.com/~tcharron/blat.html)

~Andy
Back to top
View user's profile Send private message
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Fri Oct 11, 2002 4:15 pm    Post subject: Reply with quote

To open an IE page from VB script, try the following code:

Code:

Dim ie
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "http://www.website.com"
ie.visible=1


J
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Looking for more Windows Networking info?

Sign up to the WindowsNetworking.com Monthly Newsletter, written by Enterprise Security MVP Deb Shinder, containing news, the hottest tips, Networking links of the month and much more. Subscribe today and don't miss a thing!
View a sample newsletter.

Become a WindowsNetworking.com member!

Discuss your Windows Networking issues with thousands of other Windows Newtorking experts. Click here to join!

Community Area

Log in | Register

Readers' Choice

Which is your preferred data recovery solution?

Follow TechGenix on Twitter