[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Need a "Dead or Alive" program

Posted on 2016-10-05
4
Medium Priority
?
96 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 83

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 83

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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!
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 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