Jump to content

Visual Ping 2 -> How to see equipment down on your network ?


cramaboule
 Share

Recommended Posts

Hello all,

New Release 1.6.1 (June 09)

As IT guy, one of your task is to know if something goes wrong before you have people phoning to you.

That's why I created ping test !

This script pings every x sec every IP address from a hosts file,(can ping in your network or outside of your network) , put in red the ones that are not working in green the ones that are good.

I created as well the Icon (for the task bar see pictures!) grip.dll contains only icons (Gree-Red) It needs to be in your @SystemDir or in the same folder as pingtest.exe

I take the hosts file from my linux server. (so for instance: \\mylinux\etc\hosts)(but can be anywhere else...)

Sorry for making the pictures ugly, but security first !

In the script you NEED to change 2-3 lines before testing in your network:

1.) What you need to get rid of (or not) In my case (the lines with '#' are ignored ! depend of your hosts file)

2.) The begening of your IP address network (for instance: 10.10.) There is a timer set at 500 ms for the inside network and 5sec for the Internet !)

3.) The path for your server (for the command line !) (It is in the Settings since 1.5)

I put an example of the hosts file

enjoy...

Posted Image

Host file exemple:

#
                #
                # my hosts file
                #
                #
                www.google.com google
                # line of comment
                123.456.789.111 IEsecond-hosts
                # inside network !
                10.10.10.1 my-main-server
                10.10.10.2 my-second-server
                10.10.10.10 my-printer

EDIT 1

: update the ping test due to the change of AutoIt ! previous Number of download :+116

EDIT 2

: Update the Ping Test 1.5 Due to the change of AutoIt (V3.3.0.0) Previous Number of download +106

Ping Test 1.5 Removed: grip.DLL but:

Added: icons into exe file using AutoIt3Wrapper

Added: Settings

Changed: Improved code

Changed: Display (Thanks to Melba23)

See the beginning of the code for more Info

The Icons, au3 and even exe in the zip file!

EDIT 3:Update the zip file little mistake in the au3 ! (download: +14)

EDIT 4: Update to 1.6 (last download: +39)

Added: ini file for the setting (read and write) : Idea from GreenCan

Added: 2 pings for the Outside Network if we get an error: Idea from GreenCan

EDIT 5: Update to 1.6.1: changed: Tray Improvement. Last download 1.6: +170

Pingtest1.6.1.zip

Edited by cramaboule
Link to comment
Share on other sites

Hi there.

Nice script clean and useful for comm monitoring.

Just one idea : Auto update would be nice!

Keep the good work.

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

Just one idea : Auto update would be nice!

Hi november,

Thanks !

What is "Auto update" ?

Link to comment
Share on other sites

Hi november,

Thanks !

What is "Auto update" ?

Hi there!

Auto refresh for the servers status. Or if you prefer, auto ping each 2 mins.

Just an ideia :)

Cheers m8, keep the good work!

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

:)

Or if you prefer, auto ping each 2 mins.

$Tdiff = TimerDiff($Ttimer)
    If $RedoGui = 1 Then Call("CreateGui")
    If $Tdiff >= $TWait Or $RedoGui = 1 Or $Nb_of_ping > 0 Then
        Call("fPing")
    EndIfoÝ÷ Ù©Ýjëh×6    If $NewMachine <> $OldMachine Then $RedoGui = 1
    $OldMachine = $NewMachine

I do not know what you mean, because I refresh every 30 sec and check the host file before pinging again ! :P

Link to comment
Share on other sites

  • 1 year later...
Link to comment
Share on other sites

i made my own some time ago,

pung.au3

need IPLIST.txt in same directory i this format:

www.google.it
 10.199.1.65
 10.199.1.139
 10.199.1.149
 10.199.1.2
 10.199.1.1

and generate html page that update himself

m.

Good Idea to export into HTML very nice and quite simple. You have a good view on 24h that's good.

Cramaboule

Link to comment
Share on other sites

btw y FileOpenDialog($head, "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "All (*.*)", 1, "hosts")

not FileOpenDialog($head,@WindowsDir & "\system32\drivers\etc", "All (*.*)", 1, "hosts")

or just FileRead(@WindowsDir & "\system32\drivers\etc")

Yes I know. As it was for a linux server I used to put the path of the file in the command line. if not,... you can put a txt file any where !!! Don't have to be necessary the host file in "\system32\drivers\etc"... that's why...

@myspacee: Thanks !

Link to comment
Share on other sites

@cramaboule,

Nice job,

May I suggest to add a ini file? that makes it much easier for the admin, he doesn't have to change the original setting each time.

Replace line 64 with these lines:

CODE
;Global $TWait = 30000 , $TOut_In = 200 , $TOut_Out = 5000, $Len, $IP

; read settings in ini file

Global $TWait = IniRead(@ScriptDir & "\pingtest.ini", "Settings", "PingTime", 30)*1000

Global $IP = IniRead(@ScriptDir & "\pingtest.ini", "Settings", "InsideNetworkIP", "")

Global $Len= StringLen($IP)

Global $TOut_In = IniRead(@ScriptDir & "\pingtest.ini", "Settings", "INW_TimeOut", 200)

Global $TOut_Out = IniRead(@ScriptDir & "\pingtest.ini", "Settings", "ONW_TimeOut", 10)*1000

the content of the pingtest.ini should then be:

CODE
[settings]

PingTime=60

InsideNetworkIP=57.57.45

INW_TimeOut=200

ONW_TimeOut=10

I also have frequently red lines (all for Outside network, but varying positions,I mean not always for the same IP) even when I increase the timeout. It looks a bit unconsistent to see red lines when in fact the lines should be green. Maybe you can avoid this by looping once after you get a ping error, and force an increased timeout just to be sure to confirm an error. Better a green line that takes a moment than a false alarm, don't you think so?

Last but not least, but there I am not sure it is a good idea, if you change the settings, you can also save the new settings to the ini file.

Greencan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

@Greencan

Thanks I appreciate your inputs !

Yes This is a good idea to put the settings in an *.ini file I'll modify this !

About the false alarm,... I can make 2 or 3 more pings if it gets an error on the outside network as we know that Internet is not always constant.

Cramaboule

Link to comment
Share on other sites

@Greencan

Thanks I appreciate your inputs !

Yes This is a good idea to put the settings in an *.ini file I'll modify this !

About the false alarm,... I can make 2 or 3 more pings if it gets an error on the outside network as we know that Internet is not always constant.

Cramaboule

Yes, could be good,

I just added this line after your initial ping and now I have constant and stable greens.

If $pPing = 0 Then $pPing = Ping($machine[$Nb_of_ping][1], $TOut*2) ; failure so do it once again

They only pitty is that now I see only a big number of green lines, that's boring... :)

Greencan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

If $pPing = 0 Then $pPing = Ping($machine[$Nb_of_ping][1], $TOut*2) ; failure so do it once again

Thanks I would modify in this way rather:

If $pPing = 0 And StringLeft($machine[$Nb_of_ping][1], $Len) <> $IP Then
        $pPing = Ping($machine[$Nb_of_ping][1], $TOut*2) ; failure so do it once again
    EndIf
Then it pings twice only the outside Network !

They only pitty is that now I see only a big number of green lines, that's boring... :)

That's why there is the Hide button... :) The icon turn red if there is a ping not returning !
Link to comment
Share on other sites

Thanks I would modify in this way rather:

If $pPing = 0 And StringLeft($machine[$Nb_of_ping][1], $Len) <> $IP Then
        $pPing = Ping($machine[$Nb_of_ping][1], $TOut*2) ; failure so do it once again
    EndIf
Then it pings twice only the outside Network !

That's why there is the Hide button... :) The icon turn red if there is a ping not returning !

OK,

I changed it too

Thanks

GreenCan

Contributions

CheckUpdate - SelfUpdating script ------- Self updating script

Dynamic input validation ------------------- Use a Input masks can make your life easier and Validation can be as simple

MsgBox with CountDown ------------------- MsgBox with visual countdown

Display Multiline text cells in ListView ---- Example of pop-up or ToolTip for multiline text items in ListView

Presentation Manager ---------------------- Program to display and refresh different Border-less GUI's on a Display (large screen TV)

USB Drive Tools ------------------------------ Tool to help you with your USB drive management

Input Period udf ------------------------------ GUI for a period input

Excel ColorPicker ---------------------------- Color pickup tool will allow you to select a color from the standard Excel color palette

Excel Chart UDF ----------------------------- Collaboration project with water 

GetDateInString ------------------------------ Find date/time in a string using a date format notation like DD Mon YYYY hh:mm

TaskListAllDetailed --------------------------- List All Scheduled Tasks

Computer Info --------------------------------- A collection of information for helpdesk

Shared memory Demo ----------------------- Demo: Two applications communicate with each other through means of a memory share (using Nomad function, 32bit only)

Universal Date Format Conversion -------- Universal date converter from your PC local date format to any format

Disable Windows DetailsPane -------------- Disable Windows Explorer Details Pane

Oracle SQL Report Generator -------------  Oracle Report generator using SQL

SQLite Report Generator -------------------  SQLite Report generator using SQL

SQLite ListView and BLOB demo ---------- Demo: shows how binary (image) objects can be recognized natively in a database BLOB field

DSN-Less Database connection demo --- Demo: ActiveX Data Objects DSN-Less Database access

Animated animals ----------------------------- Fun: Moving animated objects

Perforated image in GUI --------------------- Fun: Perforate your image with image objects

UEZ's Perforator major update ------------- Fun: Pro version of Perforator by UEZ

Visual Crop Tool (GUI) ----------------------- Easy to use Visual Image Crop tool

Visual Image effect (GUI) -------------------- Visually apply effects on an image

 

 

 

Link to comment
Share on other sites

very neat. Here's a tool I made for the same purpose.

edit:

removed garbage from bad autoit tag production.

edit:
Added IP address in Listview and Host List support.
Windows 7 icons are not correct.  Will need to make an exception for Win7 vs Win XP.

#include <GuiListView.au3>
#include <Inet.au3>
#include <File.au3>


Global $delay

$gui = GUICreate("PingTool", 480, 340, -1, -1, -1)
    $listview = GUICtrlCreateListView("|Hostname|IP|Sent|Recv|Lost|Last Seen ", 10, 10, 450, 280, 0x0008)   ;Listview to Store Ping Info
        _GUICtrlListView_SetColumnWidth($listview,0,22)
        For $x = 3 to 5
            _GUICtrlListView_SetColumnWidth($listview,$x,38)  ;Set Sent, Recv, and Lost Columns
        Next
        _GUICtrlListView_SetColumnWidth($listview,6,119)
    $cmbDelay = GUICtrlCreateCombo("60",44,304,40,20,0x0003)   ;Delay in Seconds
        GUICtrlSetData(-1,"45|30|15|5|1","5")
    GUICtrlCreateLabel("Every",10,308,30,30)
    GUICtrlCreateLabel("seconds",88,308,40,30)
    GUICtrlCreateLabel("Add:",160,308,26,30)
    $inputHost = GUICtrlCreateInput(@ComputerName,188,304,100,20)
    $btnAdd = GUICtrlCreateButton("",294,300,24,24, 0x0041)
        GUICtrlSetImage(-1, "C:\WINDOWS\system32\netshell.dll", -150, 0)
    GUICtrlCreateLabel("Open Host List:",354,308,80,30)
    $btnHostList = GUICtrlCreateButton("",434,300,24,24, 0x0040)
        GUICtrlSetImage(-1, "C:\WINDOWS\system32\shell32.dll", -43, 0)
$contextmnu = GUICtrlCreateContextMenu($listview)
    $cntxtRem = GUICtrlCreateMenuItem("Remove Selected",$contextmnu)

TCPStartup()   ;Required for IP Resolution
$delay = GUICtrlRead($cmbDelay)
$timer = TimerInit()

GUISetState(@SW_SHOW)

While 1   ;Main Loop
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case -3   ;Exit
            TCPShutdown()
            Exit
        Case $cmbDelay   ;Delay Time Change
            $delay = GUICtrlRead($cmbDelay)
        Case $btnAdd   ;Add Host to Ping Listview
            _AddHost(StringUpper(GUICtrlRead($inputHost)))
        Case $cntxtRem   ;Remove Host from Ping Listview
            _RemHost()
        Case $btnHostList
            _OpenList()   ;Import Host List

    EndSwitch

    If TimerDiff($timer) > $delay * 1000 Then   ;Perform Ping Routine if Delay Threshold is reached
        _PingRoutine()
        $timer = TimerInit()
    EndIf
WEnd


Func _PingRoutine()   ;Loop through Listview
    $listcount = _GUICtrlListView_GetItemCount($listview)
    For $x = 0 To $listcount-1
        _Ping($x)
    Next
EndFunc

Func _Ping($item)   ;Individual Ping Routine
    $data = _GUICtrlListView_GetItemTextArray($listview,$item)
    $host = $data[2]
    $data[4] += 1
    $id = _GUICtrlListView_GetItemParam($listview, $item)
    _Results($id,$data)
    GUICtrlSetImage($id, "C:\WINDOWS\system32\netshell.dll", -61)
    sleep(250)
    $ping = Ping($host,250)
    If $ping and Not @error Then
        $data[5] += 1
        $data[7] = @HOUR & ":" & @MIN & ":" & @SEC & " " & @MON & "/" & @MDAY & "/" & @YEAR
        _Results($id,$data)
        GUICtrlSetImage($id, "C:\WINDOWS\system32\netshell.dll", -62)
        sleep(250)
        _HostOnline($id)
    Else
        $data[6] += 1
        _Results($id,$data)
        _HostOffline($id,@error)
    EndIf
EndFunc

Func _HostOnline($item)  ;Animate Host Online
    GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -63)
    sleep(125)
    GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -60)
    sleep(125)
    GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -63)
    sleep(125)
    GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -60)
    sleep(125)
    GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -63)
EndFunc

Func _HostOffline($item,$err)   ;Animate Host Offline
    If $err = 3 Then
        GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -65)
        sleep(250)
        GUICtrlSetImage($item, "shell32.dll", -50)
        sleep(250)
        GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -65)
        sleep(250)
        GUICtrlSetImage($item, "shell32.dll", -50)
        sleep(250)
        GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -65)
    Else
        GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -66)
        sleep(250)
        GUICtrlSetImage($item, "shell32.dll", -50)
        sleep(250)
        GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -66)
        sleep(250)
        GUICtrlSetImage($item, "shell32.dll", -50)
        sleep(250)
        GUICtrlSetImage($item, "C:\WINDOWS\system32\netshell.dll", -66)
    EndIf
EndFunc

Func _Results($item, $data)  ;Set Listview Item Data
    Dim $str = ""
    For $x = 1 to UBound($data)-1
        $str &= $data[$x]
        If $x < UBound($data) -1 Then $str &= "|"
    Next
    GUICtrlSetData($item,$str)
EndFunc

Func _AddHost($host)   ;Add Host to Listview
    $ip = TCPNameToIP($host)
    If $ip <> $host Then
        GUICtrlCreateListViewItem("|" & $host & "|" & $ip & "|0|0|0",$listview)
    Else
        $host = _TCPIpToName($ip)
        GUICtrlCreateListViewItem("|" & $host & "|" & $ip & "|0|0|0",$listview)
    EndIf
EndFunc

Func _RemHost()   ;Remove Host from Listview
    $item = _GUICtrlListView_GetSelectedIndices($listview,True)
    For $x = $item[0] To 1 Step -1
        GUICtrlDelete(_GUICtrlListView_GetItemParam($listview, $item[$x]))
    Next
EndFunc

Func _OpenList()   ;Import Host List
    $src = FileOpenDialog("Host List",@ScriptDir,"Text files (*.txt)|All (*.*)",1)
    If Not FileExists($src) Then Return 0
    Local $arrHosts
    _FileReadToArray($src, $arrHosts)
    For $x = 1 to $arrHosts[0]
        _AddHost($arrHosts[$x])
    Next
EndFunc
Edited by spudw2k
Link to comment
Share on other sites

  • 4 months later...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...