Network monitor script

 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Network monitor script
# 1  
Old 09-19-2013
Network monitor script

Hi,

Although I'm not at my nature habitat, I need some assistance in having a basic windows script to monitor TCP connections from a host to other hosts.
script heed to display the following:
1. ping a remote host/hosts every 1 second (or other adjustable timer)
2. Display a fail/success.
3. time stamp.
4. write into a log file
5. create a new log file each hour.

A power shell script is acceptable, i'm a newbe in PowerShell
thanks
# 2  
Old 09-20-2013
There are several ways to do this.
  • you can set ping to the interval and process the output, perhaps for each hour so you can switch logs.
  • you can call ping every interval for one ping and process the output. You can regenerate the log file name on each pass.
  • You can send part of your script to the far end using ssh, and send a small message every interval. To switch logs, you might limit the runs to an hour. For a full duplex check it might just be 'ssh there cat', so the messages go up and back.
  • You can go to C/C++/Java/PERL/Python so the log switch is easier to detect and implement. You might even make it a free standing pipe fitting for just that. Scripts are harder to make blockage sensitive, compared to poll(). You could just write a ping output watcher. It might be a good time to use aio (asynchronous I O), so you can check progress without blocking any thread/process.
# 3  
Old 09-22-2013
Eventually I had used a "netstat" command within a script.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. IP Networking

I would like to monitor network traffic for a computer on my network

My son does homework on a school laptop. I was thinking about setting up a gateway on my home network, so that I can monitor web traffic and know if he is doing his homework without standing over his shoulder. Ideally I would like to use the Raspberry Pi Model b that I already have. However, I... (15 Replies)
Discussion started by: gandolf989
15 Replies

2. Shell Programming and Scripting

Monitor some of network services

Hi I want to write a script for netflow service because my service doesnt send any packet to netflow walker (server). Although the service is started but it does not send any packet to server until i restart the service I want to write a script in order to restart the service... (7 Replies)
Discussion started by: mohsen1366
7 Replies

3. Shell Programming and Scripting

Script to monitor network

Hello Guys, I am starting with shell scripting and I need some help with my problem... The scenario is, I have like 20 servers inside one company, where I face some network issues affecting my servers functionality (Voice/recorder/IVR systems). So, to evidence the network events, I decided to... (1 Reply)
Discussion started by: raval
1 Replies

4. Red Hat

How to monitor network device traffic using MRTG?

How to monitor network device traffic using MRTG? How can I add network devices in MRTG configuration to monitor? (2 Replies)
Discussion started by: manalisharmabe
2 Replies

5. UNIX for Advanced & Expert Users

Monitor % utilization of the network card

Hello, How to we typically monitor the % of utilization of network cards on a Unix box,basically the % utilization of the bytes transfered of the network card. This is required on all the flavours of OS - HP, AIX, RHEL, Sun etc. Please let me know. Thanks. (1 Reply)
Discussion started by: devtakh
1 Replies

6. Programming

Help in developing a Network Appliation to monitor pc in a network

I am developing a Network Appliation to monitor computers in a network. Specs are App monitors the current web page viewed in each system App also can shutdown the computer in the network App can show all process run by each computer in the network I am now confused how to start my... (2 Replies)
Discussion started by: valaparambil88
2 Replies
Login or Register to Ask a Question