• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Command Line

ranstlin

Weaksauce
Joined
Mar 1, 2003
Messages
75
Do any of you guys know how to restart a network card? (disable/enable) from the command line in windows (particularly windows server 2003). I want to create a batch script to restart this if the server can't connect to something on the internet after a certain time period.

I'm having a problem with a network card just stopping to respond for some reason and the only way I can get it to work again is to restart it that way unless i want to restart the whole server. I had this problem with another server as well. About all I can think of is either the switch is malfunctioning or i'm screwing up some sort of dns issue.
 
wouldn't it make more sense to try and figure out what is causing your problems? Patching things with duct tape won't get you far.
 
Yes, I agree with your post. However, while I'm trying to figure out what is causing this problem. Do you not agree that it would be helpful to minimize downtime?
 
netsh interface set interface "Local Area Connection " ENABLE
netsh interface set interface "Local Area Connection " DISABLE


but what you're asking to do is a band-aide fix. Sounds like a switch issue to me if it happens on more than one server.
 
First off, thanks for actually answering my question instead of just flaming me :)

I would instantly think of it as a nic problem as well at first. But like I said earlier, this isn't the first time I've had this problem. I think the switch could be screwing up. And yes I know, its a band-aide fix. But please believe me when I say its temporary guys. I just don't want people bitching at me while i'm determining the issue. I can't be having the server at work go down constantly.
 
no one is flaming you, I could have given you the netsh command (pretty much a CLI to windows networking). I just don't think it solves anything, not even temporarily.

issues is , how do you implement it? how will your batch script know the NIC is non responsive? run it all the time and ping something? if unable then disable/enable NIC? I suppose you could ping localhost and do it that way...

and even if you can monitor it (and to be helpful, you could use something like Servers Alive and execute something on failed check) it will still go down temporarily and your users won't care a whole lot if it's down for 10 seconds or 10 minutes :) (damn impatient users! :)

IMHO you would be better off ordering the cheapest switch you can to get you by while you test things. Get some linksys piece of crap for $100 that has enough ports for you, heck get a hub... anything to rule out the switch + while you're at it throw another NIC in the server, do your diagnosing on a weekend :)
 
Well, there's a program I have called server-watch I believe that will check a website at whatever time interval you want, and after 3 tries or whatnot, if it can't connect it'll run a batch script and email someone notifying you of the problem.

I recently discovered 2 pretty nice, albeit old, smc managed tiger switches that were not in use. Whenever I get a chance to actually take the network down for a short bit without screwing things up royally, I'm going to try replacing it with one of them and see if that improves the problem.
 
again I Don't know the whole story of your rack setup etc...

but bolt one of them in, uplink it to another "good" switch , then when the NIC shits the bed like it has been doing just move the server to this new switch before you do your disable/enable fix.

If you have all the cables ready and switch bolted in ahead of time you are talking maybe 10 seconds max
 
ranstlin said:
Well, there's a program I have called server-watch I believe that will check a website at whatever time interval you want, and after 3 tries or whatnot, if it can't connect it'll run a batch script and email someone notifying you of the problem.
If the batch script doesn't work, that email won't be going any where. I would also have an outside monitoring system like Nagios watching as well. Nullsofts Netmon can also help, by pinging on a set interval and give you this nice little graph. I use it myself at work when I'm updating and restarting servers (so I know when I can login and make sure the update stuck).
 
I would do just that with the switch, but unfortunately that entire rack is full and there's not enough space to put another one under it. These are the reasons why i'm having to "patch" it long enough where i can spend a little time there :)

Thanks for the program update too, by the way, Xipher. I'll check that out.
 
Just to plug my favorite networking software... servers alive from woodstone is IMHO the best one out there and free for less than 10 checks.
:)
 
Back
Top