Jump to content

need help writing a script in Windows


Recommended Posts

On Windows 2003, we have over 100 servers. I need to find NICs settings. I am using "SNMPUTIL" to get this.

If there is any other easy way to do this please do let me know.

Check the value of the output to see if its 2, if its not 2 the issue the command again increasing the end of the commands number by 1

snmputil get localhost public .1.3.6.1.4.1.232.18.2.3.1.1.34.2

So the output will either be the below or if its the last NIC you will get

d:\server1>snmputil get localhost public .1.3.6.1.4.1.232.2.3.1.1.34.1
Error: errorStatus=2, errorIndex=1

d:\server1>snmputil get localhost public .1.3.6.1.4.1.232.18.2.3.1.1.34.2
Variable = .iso.org.dod.internet.private.enterprises.232.18.2.3.1.1.34.2
Value = Integer32 2

For any NIC that returns a value of 2 we then need to check the speed of that interface with the following command;

 d:\server1>snmputil get localhost public .1.3.6.1.4.1.232.18.2.3.1.1.33.2 
Variable = .iso.org.dod.internet.private.enterprises.232.18.2.3.1.1.33.2
Value = Integer32 1000000000

So in this case we had a NIC (.2) that is set auto but is running gig which is good. We need to identify any NIC running auto not running gig, so if the NIC (.2) was running 10mps it would look like this;

 d:\server1>snmputil get localhost public .1.3.6.1.4.1.232.18.2.3.1.1.33.2 
Variable = .iso.org.dod.internet.private.enterprises.232.18.2.3.1.1.33.2
Value = Integer32 10000000

How do I write this into a script? Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy