Is it alive

preshomesc
preshomesc used Ask the Experts™
on
I need a utility that will accept a supplied list of IP addresses.  

The utility would then take those IP addresses and effectively PING the device to see if it is alive.  

If it replies back, the utility would move to the next IP address in the list.  

If it did not reply, the utility would send a message via SMTP to our support distribution group.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I use a service provider to do all that for me. They are Hyperspin.com

I have multiple web servers and they ping my servers IP's on the frequency I choose. If a response is not received, they send me a text or email or both alerting me the IP has lost it's web connection. It also lets me know when the IP is back on the web responding again.

The cost is $7.95 per month. It runs 24x7. I've used them for years. They work great.
Nagios is free and can effectively do what you ask.


http://www.nagios.org/
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Developer
Fellow 2017
Most Valuable Expert 2018
Commented:
Hi preshomesc,
I wrote a utility to do this and also an article to go along with it. I plan to submit the article (and utility) today for publication. I will post back here as soon as it is approved/published by EE.

Update 2013-09-06: The article, Test IP Addresses with PING, was just published. Please read the article and try the utility. Let me know if you have any problems with it. Regards, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
preshomesc,
I don't know if an edit to a comment sends a notification, so here's a new comment to let you know that the article, Test IP Addresses with PING, was published yesterday. Please try the utility and let me know if it works for you. Thanks, Joe
Hi joewinograd, I read your article and it looks like you have created a very good application. I commend you on your programming skills and the logic you have built-in.

Here are some quick comparisons of your app vs the service I suggested:

1. The service I use has sixteen different ping stations spread out around the world that provide the service. If one does not get a response, it's tested again from another station. Your app appears to require the user to install it on their own Pc or server. If that system looses a connection to the web, there is no backup unless the user has a 2nd or 3rd system running the same app.

2. If a problem develops with the O/S or your app running on that O/S, the user is responsible for troubleshooting or possibly contacting you or posting it to EE as a problem. It looks like you provided a very well developed app, but in IT, anything can go wrong and sooner or later something does whether it's a Windows caused problem or app that needs updating due to O/S changes.

I agree, for the first version of your app, you have developed a brilliant solution for a person who needs basic monitoring of an app or server that is not mission critical. I don't know how critical preshomesc app or server is.  He/She needs to evaluate the situation and make a decision as to what solution works best in the long run. Preshomesc might be better off trying your solution for a few months and determining if it suits his/her needs before spending money on a paid service.

If you have the resources available, I'd suggest developing your app into a paid service like Hyperspin has. I use it for multiple servers that my clients pay for. They use my servers 24x7x5 so I need quick notifications when a problem surfaces.

Please take these comments as constructive. In no way an I trying to criticize your work. Good luck on your app. I hope you are successful with it and grow.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi TG-TIS,

Thank you for taking the time to read my article and provide such thoughtful feedback – I really appreciate it! And thanks for the kind words – always nice to hear.

Although I haven't looked at the commercial service that you recommended, I have no doubts that its capabilities are much more robust than my relatively simple PING-based program. You are correct that my app requires users to install it on their own machines and that the users are responsible for troubleshooting issues. You are also correct that the app could need changing due to OS changes. For example, if Microsoft changes some of the text in the PING command's output, my program would need changing (not difficult to do, since I provided the source code, but certainly a task that users would have to perform on their own).

That's an interesting idea to develop the app into a paid service – it's great when our free work here at EE can lead to putting some food on the table. :)   But in this case, I don't have the expertise in networking/monitoring that would be required to compete with a company like Hyperspin.

I do take your comments as constructive and am grateful that you took the time to provide them. Regards, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
I have a question for the folks on this thread about the program I wrote. The current version checks for "bad" output from the PING command, namely, the four most common PING errors:

Destination Host Unreachable
Request Timed Out
TTL Expired in Transit
Unknown Host

Do you think it would be better to check for "good" output? For example, a successful PING result looks like this:

Reply from 192.168.0.123: bytes=32 time<1ms TTL=64

The app could look for ["bytes=" AND "time" AND "TTL="] in the PING output and mark the IP address as good if it finds it in any line. Is that a better approach than looking for the "bad" strings? Thanks, Joe
Ron MalmsteadInformation Services Manager

Commented:
Here's one I wrote in .net a while ago..
http://code.google.com/p/pingmon-mailer/

It's a command line utility that you can have run periodically or indefinitely..you can set a delay between pings as well as the timeout, and will mail you on "success","fail",or "changed" ping status.  You can also set it to exit after x number of target statuses.. so if something is going up/down/up/down/up/down.. you won't wake up to 500 emails on your iphone.

I use it to monitor connections to several servers between 3 sites.. and it works so far so good.. it was a rapidly developed utility however, not too many lines of code or effort put into it.. so ..your mileage may vary.
..enjoy.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
xuserx2000,
I haven't downloaded your code yet, but can you tell me simply what it looks for? In other words, what determines "success", "fail", or "changed" status? Thanks, Joe

Author

Commented:
We're in the middle of constructing a 38' x 30' addition onto our offices and I in DR mode.

Forgive me for not monitoring until now.

Since I am looking for something internal,  joewinograd's app looks inviting.  I still can't believe there's nothing been written prior to  joewinograd taking the initiative ... seems like a "duh" moment ... congrats to  joewinograd.

I'll download it in the next few weeks and test it.

One of the threads mentioned "good" or "up" indicators ... as an old fart, I expect things to work and feel like I should only require notification when they don't ... probably a difference in "need" rather than personal preference.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
> I'll download it in the next few weeks and test it.

Hi preshomesc,
I just updated the article and submitted it for republication. During the review/republication process, you will not be able to download it. But that usually takes less than a day (at most two days), so it will certainly be ready when you are. Regards, Joe
Ron MalmsteadInformation Services Manager

Commented:
Success is a successful ping..(you got a reply)
So if you configure it for success.. it will email on a successful ping.  (so if you're waiting a long time for something to come up and you want to be notified when it does.)

Fail...is a timedout or unreachable ping.
..emails on fail.

Change.. is used to monitor the status in most cases indefinitely.
So if you have a series of success pings.. and then a fail.. it will email on fail..  and if it continues to fail.. it won't email until it is successful again.

..the dieafter command tells the program when to stop.. when you hit x number of target statuses.


I'm probably going to add more to this proggie eventually.. for example.. the ability to send an HTML email from a user defined template.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
> Success is a successful ping..(you got a reply)

What string do you look for to determine that you got a reply?
Ron MalmsteadInformation Services Manager

Commented:
In .Net...

 info = pinger.Send(host)
                Status = info.Status.ToString

...it will return "success" if it got a reply.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Thanks!
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi preshomesc,
Just checking in with you, as it's been nearly six months since the last post here. I'm wondering if you're satisfied with the answers/solutions posted so far or if you're looking for more. Please let us know. Thanks, Joe

Author

Commented:
Sorry everyone ... I have been uber-swamped and have just hired some help ...

I'll get around to reviewing all threads and suggestions next week.

Thanks to all!
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Sounds good! Thanks for the reply.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi preshomesc,
Don't mean to be a pest, but I'm trying to clean up a number of open questions, and another month has gone by since your "next week" comment on this one. Any updates for us? Thanks, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
I wrote a 92-line script and published an EE article describing the solution with the source code for the script attached to the article:
Test IP Addresses with PING

The post with a reference to the published article is https:#a39472995 and deserves to be the Accepted Solution, imo.

The asker wrote:
Since I am looking for something internal, joewinograd's app looks inviting. I still can't believe there's nothing been written prior to joewinograd taking the initiative ... seems like a "duh" moment ... congrats to joewinograd. I'll download it in the next few weeks and test it.
Six months later, he wrote:
Sorry everyone ... I have been uber-swamped and have just hired some help ... I'll get around to reviewing all threads and suggestions next week.
That was more than two years ago. Regards, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Thank you, thermoduric — much appreciated!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial