Friday, 31 July 2020

How to find Multiple Data Line down or not, How to find Computer IP-Address

How to get IP-ADDDRESS of Computer:- 

 Syntax 
  
 ipconfig   

Description:-

Network troubleshooting makes much easiere IPCONFIG.
Displays all current TCP/IP network configuration values

current network adapter connection including:
Current IP Address
Subnet Mask
Default Gateway IP
Current domain

Examples:-

ipconfig /all                

Sample programme:-

ipconfig /all  

More Parameters and detail description goto c:\windows\system32\ipconfig/?

---------------------

HOW TO FIND MULTIPLE DATA LINE DOWN OR NOT, USING BATCH FILE:-

 Syntax    
 loop if
 ping find

To view all  parameters type      c:\windows\system32\ping/?

Useful Batch file for windows user 2020. to find INTERNET down or NOT

HOW TO FIND 50 or MORE Data lines Up or Down using this Batch File.
Bank Office
IT industries
Factories can use this batch file Instead of spending more money on software.

I used this PING command Many years in our office to find 50 Data lines dead or alive.
if data line dead automaticaly batch file open notepad.exe to indicating Line is down.
open notepad and check which line is down.

Description:-

PING command continue sending echo Request messages to the destination until interrupted.
To interrupt and display statistics, press CTRL+break. To interrupt and quit ping, press CTRL+

Examples:-

ping google.com /t

OR

PING  8.8.8.8   /t
(Google dns IP addresses 8.8.8.8)

Sample programme 1 :- tested ok

Down data msg uploaded to status-d.txt file .
UP message msg uploaded to  status-u.txt.

@echo off
:: creat four  File name in c:\main
::status.bat  -- batch file name
::status1.txt 
::status2.txt

set dated=%date:~-4%_%date:~3,2%_%date:~0,2%
set timet=%time:~0,2%_%time:~3,2%_%time:~6,2%
echo %dated%
echo %timet%

:start
timeout.exe 300
::pause the batch file upto 5 mnts

c:
cd\main  

del  c:\main\status1.txt
::delete status1.txt evertime automatic
ping google.com > c:\main\status1.txt
find /I "ttl" c:\main\status1.txt 
if errorlevel 1 goto down1 
@echo  **-- Data line 1 is  UP **--  >> c:\MAIN\status2.txt
echo %dated%  >> c:\MAIN\status2.txt
echo %timet%  >> c:\MAIN\status2.txt
echo ---------------------- >> c:\MAIN\status2.txt
goto  line2
:down1
@echo  **-- Data line 1 is  down **  >> c:\MAIN\status2.txt
echo %dated%  >> c:\MAIN\status2.txt
echo %timet%  >> c:\MAIN\status2.txt
echo ---------------------------------------DOWN >> c:\MAIN\status2.txt
:line2 

goto start

::When you copy the file change directory according to you c:\main

HOW THE BATFILE WORKS:

When you ping "ttl" string will be displayed  in screen. Put these 
ping output-message   to text file eg. status1.txt. by using  >> (TWO greater than sign) .

Fined string "ttl" in "line0.txt" by using "find" doscommand. If "ttl" does not exist in status1.txt
put message to down.

NOTE:-

What is the difference between Ping and ipconfig:

Although ipconfig displays information, it can also be used to make basic configuration changes and reset certain facets of DHCP and DNS.
Ping is used to test connectivity to other hosts

Sample programme 2:- tested ok

TO find MULTIPLE Data line checkup down-status:-
Use full for IT companies, Bank offfices:-
@echo off
:: creat four  File name in c:\main
::status.bat  -- batch file name
::status1.txt 
::status2.txt

set dated=%date:~-4%_%date:~3,2%_%date:~0,2%
set timet=%time:~0,2%_%time:~3,2%_%time:~6,2%
echo %dated%
echo %timet%

:start
timeout.exe 5
::pause the batch file upto 5 mnts

c:
cd\main  

del  c:\main\status1.txt
::delete status1.txt evertime automatic
ping google.com > c:\main\status1.txt
find /I "ttl" c:\main\status1.txt 
if errorlevel 1 goto down1 
@echo  **-- Data * google.com * is UP -- >> c:\MAIN\status2.txt
echo %dated%  >> c:\MAIN\status2.txt
echo %timet%  >> c:\MAIN\status2.txt
echo ---------------------- >> c:\MAIN\status2.txt
goto  line2
:down1
@echo  **-- Data * google.com * is  down --  >> c:\MAIN\status2.txt
echo %dated%  >> c:\MAIN\status2.txt
echo %timet%  >> c:\MAIN\status2.txt
echo ---------------------------------------DOWN >> c:\MAIN\status2.txt
:line2 

del  c:\main\status1.txt
::delete status1.txt evertime automatic

ping google.com > c:\main\status1.txt

find /I "ttl" c:\main\status1.txt 
if errorlevel 1 goto down2 
@echo  **-- Data * google.com * is  down -- **   >> c:\MAIN\status2.txt
echo %dated%  >> c:\MAIN\status2.txt
echo %timet%  >> c:\MAIN\status2.txt
echo ---------------------- >> c:\MAIN\status2.txt
goto  line3
:down2
@echo  --------**-- Data * google.com * is  down -- **------  >> c:\MAIN\status2.txt
echo %dated%  >> c:\MAIN\status2.txt
echo %timet%  >> c:\MAIN\status2.txt
echo ------------------------------------------- >> c:\MAIN\status2.txt
:line3
 ::change line 1 to line 2,  change down1 to down2
 ::change IP ping addres to second data line
goto start

NOTE :- More Parameters and detail description goto c:\windows\system32\ping/?

No comments:

Post a Comment

HOW TO BACKUP YOUR ALL DIRECTORY IN YOUR COMPUTER AND FILE NAMES:-

HOW TO BACKUP YOUR ALL DIRECTORY IN YOUR COMPUTER AND FILE NAMES:-   Syntax         tree   /f Description:- Displays names of files in a dir...