?
Solved

Need a "Dead or Alive" program

Posted on 2016-10-05
4
Medium Priority
?
90 Views
Last Modified: 2016-10-05
I am trying to diagnose a problem with either my ISP or my router. In order to make that easier I need a utility that will run continuously and monitor if I have an internet connection or not. I would want it to be able to poll the internet in as little as every 15 seconds. Does anyone know of such a utility that exists?
0
Comment
Question by:Need-a-Clue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:David Johnson, CD, MVP
ID: 41830986
powershell script
function Test-Aliveordead {
Add-Type -AssemblyName PresentationCore,PresentationFramework
$continue = $true
do{
if(test-connection google.com -ErrorAction SilentlyContinue)
	{
	start-sleep -Seconds (15*60)
	}
else {
$ButtonType = [System.Windows.MessageBoxButton]::YesNo
$ButtonType = [System.Windows.MessageBoxButton]::YesNo	
$MessageboxTitle = 'Test pop-up message title'
$Messageboxbody = 'Are you sure you want to stop this script execution?'
$MessageIcon = [System.Windows.MessageBoxImage]::Warning
$result = [System.Windows.MessageBox]::Show($Messageboxbody,$MessageboxTitle,$ButtonType,$messageicon)
if ($result -eq "No") { $continue = $true }
else {$continue = $false} 
}
}
while ( $continue -eq $true)
}

Open in new window

0
 

Author Comment

by:Need-a-Clue
ID: 41831095
Hello David Johnson, CD, MVP,

I DO appreciate your post. However, I have zero idea what powershell is and the code you supplied is greek to me. I am seeking a program that I can easily run and configure. Maybe you might have an idea more along those lines?
0
 
LVL 82

Accepted Solution

by:
David Johnson, CD, MVP earned 2000 total points
ID: 41831136
DO appreciate your post. However, I have zero idea what powershell is and the code you supplied is greek to me. I am seeking a program that I can easily run and configure. Maybe you might have an idea more along those lines?

As an IT Pro I'd suggest you start learning PowerShell as it is the tool of preference for Windows and is also available for Linux. Powershell is replacing VBS (VBScript has not had any development done on it for over 10 years.

copy and save the code I gave you as a *.ps1 file. Start Powershell ISE or simply Powershell as an administrator and run the following 2 commands.

set-executionpolicy -executionpolicy remotesigned
update-help

To explain the script
function Test-Aliveordead {
Add-Type -AssemblyName PresentationCore,PresentationFramework
$continue = $true
do{
if(test-connection google.com -ErrorAction SilentlyContinue)
	{
	start-sleep -Seconds (15*60)
	}
else {

Open in new window

What this does is ping google.com and if it gets a result it will sleep 15 minutes and then try again
$ButtonType = [System.Windows.MessageBoxButton]::YesNo
$ButtonType = [System.Windows.MessageBoxButton]::YesNo	
$MessageboxTitle = 'Ping Failed'
$Messageboxbody = 'Are you sure you want to stop this script execution?'
$MessageIcon = [System.Windows.MessageBoxImage]::Warning
$result = [System.Windows.MessageBox]::Show($Messageboxbody,$MessageboxTitle,$ButtonType,$messageicon)
if ($result -eq "No") { $continue = $true }
else {$continue = $false} 
}
}
while ( $continue -eq $true)
}

Open in new window

if the ping failed then a message box will pop up asking you if you want to continue..
0
 

Author Comment

by:Need-a-Clue
ID: 41831154
Thanks, I will give your suggestion a try tomorrow. Thanks so much for custom writing the code for me.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question