PDA

View Full Version : Simple BW monitor for your win32 dedicated server


lsf
06-25-2005, 01:22 AM
@echo off
setlocal
:START
for /F "tokens=2" %%a in ('"netstat -e | find /I "byte""') do set down1=%%a
for /F "tokens=3" %%a in ('"netstat -e | find /I "byte""') do set up1=%%a
ping -w 850 -n 1 10.1.1.1 > nul
for /F "tokens=2" %%a in ('"netstat -e | find /I "byte""') do set /A down2=(%%a-%down1%)/1390
for /F "tokens=3" %%a in ('"netstat -e | find /I "byte""') do set /A up2=(%%a-%up1%)/1024
cls
echo Down %down2% KB
echo Up %up2% KB
title %down2% down %up2% up
GOTO START

Make a bwmon.bat file and place the above code in it.
This will give you a simple BW monitor without all the bloat stuff.
It can run minimized and will tell you your current up/down bandwith as the program name.
If you don't get it, just run it and minimize and you will se what i mean.
I'm not sure if this has any impact on the server, it shouldn't as performance counters are done within the os weather you show them or not. The only thing this does is using "netstat" and "find" to get the actual up and down numbers, and it uses ping to create a wait timeout of 850ms (the IP is just any non ansvering IP. This will give aprox. 1 second between updates.

Enjoy :cool: