Solved

Need a "Dead or Alive" program

Posted on 2016-10-05
4
33 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
  • 2
  • 2
4 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
Comment Utility
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
Comment Utility
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 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
Comment Utility
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
Comment Utility
Thanks, I will give your suggestion a try tomorrow. Thanks so much for custom writing the code for me.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Ubuntu 15.04 connects to LAN but not internet 30 147
WAN fail-over options 11 96
cannot RDP off my Network 4 53
Speed testing 26 76
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!
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now