Jump to content

Randi11

Members
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

About Randi11

  1. localzuk: I am NOT a scripting guru, but was able to put together for you a ping script quickly. (I am not a networking/systems guru either - just know a little bit of scripting.) Here is the script. Feel free to use it, edit it, make it better, etc. It is in biterscripting - you can use any language. (I like biterscripting because you can write a script in no time at all.) # PING SCRIPT # Following are passed as input arguments. They are ip addresses. var str edge, headend, server # Ping edge first. We will look for the lost packets in the response. var str reply var int lost system ping ("\""+$edge+"\"") > $reply # Parse the reply to get number of lost packets. That number is between "Lost = " and " ". stex "^Lost = ^]" $reply > null stex "[^ ^" $reply > null set $lost = makeint(str($reply)) if ($lost > 0) echo "EDGE ROUTER DOWN" else # Edge router is OK. # Check the headend router the same way. . . . if ($lost > 0) echo "HEADEND ROUTER DOWN" else # Headend router is ok. # Check the server the same way. . . . if ($lost > 0) echo "SERVER DOWN" else . . . etc. endif # Check for server endif # Check for headend router endif # Check for edge router To run the script, save it in file ping.txt. Then call it using following command. script ping.txt edge("1.2.3.4") headend("5.6.7.8") server("9.0.1.2") Very simple, really. You can also use URLs instead of IP addresses, such as "http://www.somesite.com". If you don't have biterscripting - it is free - download and install it from http://www.biterscripting.com. You can also follow their installation directions. (For your purposes, I don't think you need to do anything other than just install, then call the ping script as above.) Randi
  2. davidm: When converting old DOS batch scripts to something new, have you considered biterscripting ? I believe the conversion will be simpler. For example, your script will become set $inp="c:\cob\SPOOL\tlushmla.prt" set $outp="c:\cob\SPOOL\tlushmla.htm" system someprogram $inp $outp I started using biterscripting recently - and it is easy to learn. (I like vbscript also.) I think they still offer a free download at http://www.biterscripting.com . Do make sure you follow the installation instructions at http://www.biterscripting.com/install.html . That way, you will have all their sample scripts already installed, which will give you a headstart. Randi
×
×
  • Create New...