-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extended languages for ping logger script
- Loading branch information
1 parent
d3673e7
commit d91ecc1
Showing
5 changed files
with
97 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Ping Logger | ||
- ein Skript zum Protokollieren von Ping-Ergebnissen in einer txt-Datei, um Ping-Zeiten für ein Ping-Ziel über einen längeren Zeitraum ermitteln zu können. | ||
- alles weitere, was eingestellt werden kann (z.B. Ping-Ziel, Wartezeit, Endzeit für den Skriptlauf, etc.) kann als Variable im Skript eingestellt werden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Ping Logger | ||
- a script for logging ping results in a txt file in order to be able to determine ping times for a ping target over a longer period of time. | ||
- everything else that can be set (e.g. ping target, wait time, end time for the script run, etc.) can be set as variables in the script. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
README-en.md |
90 changes: 45 additions & 45 deletions
90
Ping Logger/ping_logger.bat → Ping Logger/ping_logger-de.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
REM destination address for the ping | ||
set target=192.168.178.1 | ||
|
||
REM log file | ||
set logfile=%target%-ping_log.txt | ||
|
||
REM Waiting time in seconds | ||
set waittime=1 | ||
|
||
REM End time (in format HH:MM), leave blank for infinite running | ||
set endtime= | ||
|
||
REM Current time | ||
for /f "tokens=1-2 delims=:" %%a in ("%time%") do set currenttime=%%a:%%b | ||
|
||
REM Set the beginning of the log file | ||
echo -------------------------------------------------- | ||
echo !date! !time! - Starte Ping_Logger für Target: %target% | ||
echo -------------------------------------------------- | ||
echo -------------------------------------------------- >> %logfile% | ||
echo !date! !time! - Starte Ping_Logger für Target: %target% >> %logfile% | ||
echo -------------------------------------------------- >> %logfile% | ||
|
||
REM ping loop | ||
:pingloop | ||
for /f "tokens=1-2 delims=:" %%a in ("%time%") do set currenttime=%%a:%%b | ||
if defined endtime if "!currenttime!" geq "%endtime%" goto end | ||
|
||
REM Ping command and logging the result | ||
for /f "tokens=4-5 delims= " %%a in ('ping -n 1 %target% ^| find "Zeit="') do ( | ||
set pingtime=%%b | ||
echo !date! !time! - %target% ist erreichbar - !pingtime! | ||
echo !date! !time! - %target% ist erreichbar - !pingtime! >> %logfile% | ||
) | ||
|
||
REM waiting time | ||
timeout /t %waittime% >nul | ||
|
||
goto pingloop | ||
|
||
:end | ||
echo Ping script terminated. | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
REM destination address for the ping | ||
set target=192.168.178.1 | ||
|
||
REM log file | ||
set logfile=%target%-ping_log.txt | ||
|
||
REM Waiting time in seconds | ||
set waittime=1 | ||
|
||
REM End time (in format HH:MM), leave blank for infinite running | ||
set endtime= | ||
|
||
REM Current time | ||
for /f "tokens=1-2 delims=:" %%a in ("%time%") do set currenttime=%%a:%%b | ||
|
||
REM Set the beginning of the log file | ||
echo -------------------------------------------------- | ||
echo !date! !time! - Starte Ping_Logger für Target: %target% | ||
echo -------------------------------------------------- | ||
echo -------------------------------------------------- >> %logfile% | ||
echo !date! !time! - Starte Ping_Logger für Target: %target% >> %logfile% | ||
echo -------------------------------------------------- >> %logfile% | ||
|
||
REM ping loop | ||
:pingloop | ||
for /f "tokens=1-2 delims=:" %%a in ("%time%") do set currenttime=%%a:%%b | ||
if defined endtime if "!currenttime!" geq "%endtime%" goto end | ||
|
||
REM Ping command and logging the result | ||
for /f "tokens=4-5 delims= " %%a in ('ping -n 1 %target% ^| find "Zeit="') do ( | ||
set pingtime=%%b | ||
echo !date! !time! - %target% ist erreichbar - !pingtime! | ||
echo !date! !time! - %target% ist erreichbar - !pingtime! >> %logfile% | ||
) | ||
|
||
REM waiting time | ||
timeout /t %waittime% >nul | ||
|
||
goto pingloop | ||
|
||
:end | ||
echo Ping-Script beendet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
REM destination address for the ping | ||
set target=192.168.178.1 | ||
|
||
REM log file | ||
set logfile=%target%-ping_log.txt | ||
|
||
REM Waiting time in seconds | ||
set waittime=1 | ||
|
||
REM End time (in format HH:MM), leave blank for infinite running | ||
set endtime= | ||
|
||
REM Current time | ||
for /f "tokens=1-2 delims=:" %%a in ("%time%") do set currenttime=%%a:%%b | ||
|
||
REM Set the beginning of the log file | ||
echo -------------------------------------------------- | ||
echo !date! !time! - Start Ping_Logger for Target: %target% | ||
echo -------------------------------------------------- | ||
echo -------------------------------------------------- >> %logfile% | ||
echo !date! !time! - Start Ping_Logger for Target: %target% >> %logfile% | ||
echo -------------------------------------------------- >> %logfile% | ||
|
||
REM ping loop | ||
:pingloop | ||
for /f "tokens=1-2 delims=:" %%a in ("%time%") do set currenttime=%%a:%%b | ||
if defined endtime if "!currenttime!" geq "%endtime%" goto end | ||
|
||
REM Ping command and logging the result | ||
for /f "tokens=4-5 delims= " %%a in ('ping -n 1 %target% ^| find "time="') do ( | ||
set pingtime=%%b | ||
echo !date! !time! - %target% is reachable - !pingtime! | ||
echo !date! !time! - %target% is reachable - !pingtime! >> %logfile% | ||
) | ||
|
||
REM waiting time | ||
timeout /t %waittime% >nul | ||
|
||
goto pingloop | ||
|
||
:end | ||
echo Ping script terminated. |