Solved

Need a "Dead or Alive" program

Posted on 2016-10-05
4
82 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 81

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 81

Accepted Solution

by:
David Johnson, CD, MVP earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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!
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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