Jump to content

Visual Ping *** UPDATED *** Version 1.8


November
 Share

Recommended Posts

Hi all,

This is my first Script/Program.

I made for my work, as an IT i need so constantly have some info/status/whatever from servers so, this mass ping program its usefull..

The exportation file is comma delimited for an easier usage in excel!

And now im happy to share with you all.

Compatible with Vista and Win7

Cheers.

Any problem, ideas please let me know!

visualping1.8.au3

Edited by November

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

Hi all,

This is my first Script/Program.

I made for my work, as an IT i need so constantly have some info/status/whatever from servers so, this mass ping program its usefull..

The exportation file is comma delimited for an easier usage in excel!

And now im happy to share you you all.

Cheers.

Any problem, ideas please let me know!

Ok guys... i'm worried...

Not even a reply...

i'll try to explain again :

Dim $visualping

select

case $visualping = "ok"

post()

case $visualping = "sucks"

exitpost()

endselect

func post()

_post(http://www.autoitscript.com/forum/index.php?act=Post&CODE=02&f=9&t=42523&qpid=316139)

endfunc

func exitpost()

exit

end func

:whistle::P

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

Its very nice but I think your lack of responses is from having posting the exe but no source. Sure we can decompile but I think most people would like to see straight source :whistle:

Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Link to comment
Share on other sites

Its very nice but I think your lack of responses is from having posting the exe but no source. Sure we can decompile but I think most people would like to see straight source :whistle:

Right on the money. I'm actually about to develop an application that pings, etc for my Remote Administration Suite project. :P

Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki
Link to comment
Share on other sites

Where it is, the code.

My first idea was to do a loop ping of the host until a stop button pressed, but its tricky to stop a loop with button, so i just quit the idea :whistle:

Any ideas/improvement/functions are welcome.

Cheer all

VisualPing1.7.au3

Edited by november

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

Where it is, the code.

My first idea was to do a loop ping of the host until a stop button pressed, but its tricky to stop a loop with button, so i just quit the idea :whistle:

Any ideas/improvement/functions are welcome.

Cheer all

Add hosts directly from the GUI also (maybe with a listview contextual menu).

Thanks

Peppe

Link to comment
Share on other sites

Add hosts directly from the GUI also (maybe with a listview contextual menu).

Thanks

Peppe

Maybe like this example?

or input hosts directely?

Just to get the picture of your idea :whistle:

Regards.

vendorProb.au3

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

Its very nice but I think your lack of responses is from having posting the exe but no source. Sure we can decompile but I think most people would like to see straight source :whistle:

Feel free to change it and use it.

Im for the free software distribution :P

Cheers m8

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

Feel free to change it and use it.

Im for the free software distribution :whistle:

Cheers m8

Can you also provide an example of the host file? Or maybe allow a subnet of IP's to be pinged?

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Can you also provide an example of the host file? Or maybe allow a subnet of IP's to be pinged?

To ping a subnet you have to rearrange the strings. but its possible.

You can ping hostnames, ip, internet addresses to. but its was design to work with hostnames.

Feel free to create a host file.

A simple txt file.

include this... just for fun

127.0.0.1

localhost

(wokstationname)

The code also has rotine that eliminates null lines

ex:

127.0.0.1

localhost

(wokstationname)

All the lines are included in an array, and then deletes the null ones and recreate the array.

Cheers

Edited by november

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

Looks great. :whistle:

Thanx m8! :P

Now im doing some scripts by request, here in work.

its not perfect, because i dont have much time, but i think its ok :D

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

I agree, there's not many functions.. but it sure looks great. :whistle:

You've inspired me to build a program with the same goal in mind, only I will build a visual application.

Posted Image

Sample.

This will be part of a bigger application that is much like any Remote Administration program.

I dont know what it does, but just 4 the look... i would buy it :P

Share it when you finish!

Looks really great!

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

  • 2 weeks later...

I got an error on line 199 when running the program

$newvar = _ArraySearch($aRecords, "", 0, 0, 0, false)

changed to

$newvar = _ArraySearch($aRecords, "")

fixed the problem

Look great btw

Odd!

Well if it woks that good :shocked:

The best script is the one that works :(

Thanx m8

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

  • 1 month later...

wow nice program, cool november

Thanx m8

Its was made to my department... so its a bit oriented.

Its works fine here :)

Cheers m8

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

  • 2 weeks later...

Came across this when looking to do something similar.

I needed to resolve the name from the IP (reserve of what you have) and add in a site number (hard to explain, but I understand :)

Anyway, your array only supports a single point. Me I needed a 2D array. I have (briefly :) ) looked at the help and all but could not

figure out multi-dimed arrays. So I got around it with a bit of strange code (read thru sting til comma, this is site name, set flag, read rest of string this IP).

Now working on it to ping a range (a ping sweep if you will) of IPs with the same beginning 3 dots and the ending one ranging from 1 to 30. So from 255.255.255.1 to 255.255.255.30

If any of you kind, generous souls would be of service to this wayward soul and point me toward the road to multi-dimmed arrays you will have a really good thing happen in your life at some point :)

Here is the code so far if anyone is intrested...

CODE
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.2.0

Author: November

Date: 2007, March 02

Script Function:

Script ping loop with dynamic hosts

#ce ----------------------------------------------------------------------------

; Start Script

;Includes

#include <GuiListView.au3>

#include <GUIConstants.au3>

#include <GuiList.au3>

#include <GuiTreeView.au3>

#include <file.au3>

#include <array.au3>

#include <inet.au3>

;Options

;Opt ("GUICloseOnESC", 1)

Opt ("TCPTimeout", 10)

Opt("TrayIconHide", 1)

Opt("TrayAutoPause", 0)

Opt("GUIResizeMode", 1)

Opt("GUIOnEventMode", 0)

;Hotkeys

HotKeySet("{ESC}", "exity")

HotKeySet("{F1}", "help")

;Declaration

Dim $listview, $totalservers, $ping, $msg, $x, $exitB, $index, $item, $round, $Progress, $value, $FileHost, $host, $totalservers, $repeat, $stop, $gui, $errorhost, $HelpB, $teste, $nametoip, $location, $name, $tempfile, $exitHB, $decision

dim $correctip, $aRecords, $storeno, $cflag

;inicial declarations

$host = 0;Grants no hostfile in the beginning

$scan = 0; Grants no Scna was made for correct file export

;GUI creation

$osversion = @OSVersion;Organizes the images for the buttons for w2k and winxp

select

case $OSVersion = "WIN_2000"

$iconexit = "105"

$iconscan = "55"

$iconhelp = "23"

$iconfile = "70"

$iconexport = "6"

case $OSVersion = "WIN_XP"

$iconexit = "27"

$iconscan = "22"

$iconhelp = "23"

$iconfile = "70"

$iconexport = "6"

EndSelect

$gui = GUICreate("Visual Ping - Version 1.7", 450, 375, @DesktopHeight/2-120, @DesktopWidth/2-380, $WS_VISIBLE + $WS_CLIPSIBLINGS + $LVS_EX_GRIDLINES) ;, $LVS_EX_GRIDLINES and $LVS_EX_GRIDLINES

$progress = GUICtrlCreateProgress (20, 250, 150, 15); $PBS_SMOOTH

$listview = GUICtrlCreateListView(" IP Address | Server Status | Server Name ", 15, 20, 415, 210, $LVS_EX_HEADERDRAGDROP)

$FileHost = GUICtrlCreateButton("Host File", 200, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON)

$repeat = GUICtrlCreateButton("Scan Hosts", 245, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON)

$export = GUICtrlCreateButton("Export", 290, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON)

$exitB = GUICtrlCreateButton("Exit Program", 335, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON)

$HelpB = GUICtrlCreateButton("Help", 380, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON)

GUICtrlCreateLabel( "HOSTS", 205, 310, 50, 15)

GUICtrlCreateLabel( "SCAN", 250, 310, 50, 15)

GUICtrlCreateLabel( "EXPORT", 290, 310, 50, 15)

GUICtrlCreateLabel( "EXIT", 345, 310, 50, 15)

GUICtrlCreateLabel( "HELP", 385, 310, 50, 15)

;GUI Style

GUICtrlSetImage ($repeat, "shell32.dll",$iconscan)

GUICtrlSetImage ($FileHost, "shell32.dll",$iconfile)

GUICtrlSetImage ($exitB, "shell32.dll",$iconexit)

GUICtrlSetImage ($HelpB, "shell32.dll",$iconhelp)

GUICtrlSetImage ($export, "shell32.dll",$iconexport)

GUICtrlCreateLabel( "OVERALL : ", 20, 270, 65, 15, $SS_SUNKEN, $SS_WHITERECT)

GUICtrlCreateLabel( "", 85, 270, 50, 15, $SS_SUNKEN )

GUICtrlCreateLabel( "TOTAL HOSTS: ", 20, 290, 115, 15, $SS_SUNKEN )

GUISetFont(9, 400, 2, "Monotype Corsiva")

GUISetFont(9, 400, "", "")

;Read GUI

GUISetState()

;Selection Loop

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

exity()

Case $msg = $exitB

exity()

Case $msg = $repeat

prerepeat()

Case $msg = $export

export()

Case $msg = $FileHost

file()

Case $msg = $helpb

help()

EndSelect

Wend

;funcs

func prerepeat();Checks if host file is loaded

if not $host = 0 Then

repeat()

;Return

Else

$errorhost = GUICtrlCreateLabel( "ERROR : HOST FILE NOT LOADED", 45, 325, 350, 15, $SS_SUNKEN)

GUICtrlSetColor($errorhost, 0xff0000)

return

EndIf

EndFunc

Func repeat();Ping the Host File

$name = "EXPORTDAY" & @YEAR & @WDAY & @HOUR & @MIN & @SEC & ".TXT"

$tempfile = _FileCreate(@TempDir & "\" & $name)

FileWriteLine(@TempDir & "\" & $name, "STORE,SERVER,STATUS,IP" & @CRLF)

TCPStartup()

_GUICtrlListViewDeleteAllItems ( $listview )

$teste = UBound ( $aRecords )-1

for $x = 1 to $teste

for $loop = 1 to stringlen($aRecords[$x])

if StringMid($aRecords[$x],$loop,1)<>"," and $cflag = 0 Then

$storeno=$storeno & StringMid($aRecords[$x],$loop,1)

EndIf

if StringMid($aRecords[$x],$loop,1)<>"," and $cflag = 1 Then

$correctip=$correctip & StringMid($aRecords[$x],$loop,1)

EndIf

if StringMid($aRecords[$x],$loop,1)="," Then

$cflag = 1

EndIf

next

$correctip = $correctip & ".20"

$errorhost = GUICtrlCreateLabel( "Scanning : " & $correctip, 45, 325, 350, 15, $SS_SUNKEN)

$ping = ping($correctip, 2)

$nametoip =_TCPIpToName($correctip)

if $nametoip = "" Then

$nametoip = "NO IP AVAILABLE"

EndIf

if $ping Then

$ping = "ONLINE"

$item = GUICtrlCreateListViewItem($correctip & "|" & $ping & "|" & $nametoip, $listview)

GUICtrlSetColor($item, 0x3cb371)

Else

$ping = "OFFLINE"

$item = GUICtrlCreateListViewItem($correctip & "|" & $ping & "|" & $nametoip, $listview)

GUICtrlSetColor($item, 0xff0000)

EndIf

FileWriteLine(@TempDir & "\" & $name, $storeno & "," & $correctip & "," & $ping & "," & $nametoip & @CRLF)

$value = Number($x*100/$totalservers)

$round = round($value)

GUICtrlCreateLabel( "OVERALL : ", 20, 270, 65, 15, $SS_SUNKEN )

GUICtrlCreateLabel( " " & $round & " %", 85, 270, 50, 15, $SS_SUNKEN )

GUICtrlCreateLabel( "TOTAL HOSTS: " & $totalservers, 20, 290, 115, 15, $SS_SUNKEN )

GUICtrlSetData($progress, $round)

Next

$errorhost = GUICtrlCreateLabel( "SCAN COMPLETED", 45, 325, 350, 15, $SS_SUNKEN)

GUICtrlSetColor($errorhost, 0x3cb371)

TCPShutdown()

$scan = 1

EndFunc

Func export()

If $scan = 0 Then

$errorhost = GUICtrlCreateLabel( "ERROR : SCAN THE FILE FIRST", 45, 325, 350, 15, $SS_SUNKEN)

GUICtrlSetColor($errorhost, 0xff0000)

Return

Else

$location = FileSelectFolder("Choose folder", "")

If @error = 1 Then

$errorhost = GUICtrlCreateLabel( "ERROR : FOLDER NOT SELECTED", 45, 325, 350, 15, $SS_SUNKEN)

GUICtrlSetColor($errorhost, 0xff0000)

$location = ""

Return

EndIf

$filecopy = FileCopy(@TempDir & "\" & $name, $location, 0)

If $filecopy = 0 Then

$errorhost = GUICtrlCreateLabel( "ERROR : FILE NOT CREATED", 45, 325, 350, 15, $SS_SUNKEN)

GUICtrlSetColor($errorhost, 0xff0000)

$filecopy = 0

MsgBox(0, "filecopy", $filecopy)

Return

EndIf

EndIf

$errorhost = GUICtrlCreateLabel( "FILE: " & $name & " CREATED", 45, 325, 350, 15, $SS_SUNKEN)

GUICtrlSetColor($errorhost, 0x3cb371)

EndFunc

Func file();Opens Host File and removes empty lines

$host = FileOpenDialog("Host file location", "e:\", "(*.txt)", 8+2)

if @error = 1 Then

$host = 0

Return

EndIf

_FileReadToArray($host,$aRecords)

while 1

$newvar = _ArraySearch($aRecords, "", 0, 0, 0, false)

if @error = 6 Then

ExitLoop

Else

_ArrayDelete($aRecords, $newvar)

EndIf

wend

$totalservers = UBound ( $aRecords )-1

$errorhost = GUICtrlCreateLabel( "HOST FILE LOADED", 45, 325, 350, 15, $SS_SUNKEN)

GUICtrlCreateLabel( "TOTAL HOSTS: " & $totalservers, 20, 290, 115, 15, $SS_SUNKEN )

GUICtrlSetColor($errorhost, 0x3cb371)

Return

EndFunc

Func help();Brings the Help Box

$helpgui = GUICreate("Visual Ping - HELP", 220, 175, @DesktopHeight/2, @DesktopWidth/2-250, $WS_CAPTION + $WS_SYSMENU)

$help = GUICtrlCreateLabel("Visual Ping - Version 1.7" & @LF & @LF & "Simple program to ping hosts" & @LF & "Text file export" & @LF & "" & @LF & "November 2007" & @LF & "Designed for Free Use", 20, 10)

$exitHB = GUICtrlCreateButton("Exit Program", 85, 120, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON)

GUICtrlSetImage ($exitHB, "shell32.dll",$iconexit, 0)

GUISetState()

while 1

$decision = GUIGetMsg()

Select

Case $decision = $GUI_EVENT_CLOSE

GUIDelete($helpgui)

Return

Case $decision = $exitHB

GUIDelete($helpgui)

Return

EndSelect

wend

EndFunc

Func exity();Exit Program

FileDelete(@TempDir & "\" & $name)

exit

EndFunc

;Fim de script

Sample host text file

123,255.255.255

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...