View Single Post
  #9  
Old 12-15-2012, 06:30 PM
kmusawi kmusawi is offline
Registered User
 
Join Date: Dec 2012
Posts: 2
Lightbulb script to search for strings and output result in text

Hi,

I would like some direction on how to accomplish the following, i do not have prior experience in VB however I have done Java and C++ some years ago so I can learn VB with some direction.

I would like to be able to have a script prompt the user asking what interface to search for current status ( i.e. - interface ge-1/4/2/1 ) and to look up the shw interface command to check if the link state is up or down. If the state is down to then check the log (i.e.- shw log ) to check when the interface last went down and to output the results in a text file or on the current screen.

In essence i would like to have a generic script that can do the following :

1) check the current state of the interface (Link up or Link down)
2) check how long the interface has been up for
3) if link to a specific interface is currently down to grab the exact date/time it went down
4) If link to specific interface went down and then came back up within a period of less than 10min to grab these dates and times

Output the results of the above commands to the screen or text file.

I deal with both Juniper and Cisco routers so I am aware both use slighly different commands to get the specified result but really need help on how to overall accomplish the above as it requires to "check for specific strings ( is link down or up) and ( look for the date and times it went down and back up)
Reply With Quote