Git Product home page Git Product logo

levitation / pingtool Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 62 KB

A program to monitor a number of hosts using ping. The program exits when all monitored hosts have an outage. The program allows specifying the ping source interface by IP address. For Windows.

Home Page: https://www.simplify.ee/

License: GNU Lesser General Public License v2.1

C# 99.83% Batchfile 0.17%
automation host icmp-ping monitor monitoring-tool ping uptime-check command-line command-line-tool uptime-checker windows reliability background-jobs console-application

pingtool's Introduction

Ping Monitor

A program to monitor a number of hosts using ping. The program exits when all monitored hosts have an outage. The program allows specifying the ping source interface by IP address. For Windows.

Use cases

If there is some network connection that occasionally misbehaves and loses reliable connection then you can use Ping Monitor tool to launch corrective actions upon detection of the occurrence of the problem.

You can create a batch file which contains a loop and inside that loop two sets of commands: the first command starts the Ping Monitor tool. If the first command quits then that means that the trigger situation has been detected and therefore it is appropriate time for the second set of commands to be executed. The second set of commands would contain some corrective action. For example, the second set of commands could:
    a) Disconnect and reconnect the misbehaving network connection.
    b) Switch to an alternate wifi network.
    c) Trigger a power cycle of the router when the router is powered through a USB controlled programmable power strip.

Example batch file content:

@echo off
:s
PingTool.exe -host=8.8.8.8 -host=8.8.4.4 -sourceHost=192.168.0.3
netsh mbn disconnect interface="Mobile Broadband Connection"
netsh mbn connect interface="Mobile Broadband Connection" connmode=name name="Your Service Provider Name"
ping -n 16 127.0.0.1
REM sleep 15
goto s

The above example pings two IP addresses belonging to Google. The pings are performed via the network interface having a local address of 192.168.0.3. Once pings to ALL of the specified target IP addresses start failing, the network connection is restarted by the following commands in the batch file. By default the trigger activates (that is, Ping Tool quits) when ALL of the target IP addresses fail ping for 3 consequtive checks with 5 second intervals, and then the outage continues for another 30 seconds after that. If the monitored IP addresses ping successfully during that additional time interval then the trigger is reset and Ping Tool continues running without quitting.

State

Ready to use. Maintained and in active use.

Program arguments and their default values


-help (Shows help text)
-outageTimeBeforeGiveUpSeconds=180 (How long outage should last before trigger is activated and PingTool quits. NB! This timeout starts only after the failure count specified with -outageConditionNumPings has been exceeded.)
-outageConditionNumPings=3 (How many pings should fail before outage can be declared)
-passedPingIntervalMs=15000 (How many ms to pause after a successful ping)
-failedPingIntervalMs=5000 (How many ms to pause after a failed ping)
-pingTimeoutMs=10000 (Ping timeout)
-host=host name (Host name. Multiple host names can be specified. In this case the program exits only after ALL monitored hosts have failed.)
-sourceHost=source host name (Source host name. Multiple source host names can be specified. If multiple names are specified then each target host is pinged through corresponding source host (interface). If no source host is specified for some target host then the ping path is automatically choosen by the operating system.)

Analytics

pingtool's People

Contributors

levitation avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.