Wednesday, June 07, 2006

Network Monitor

Purpose
Create as many virtual devices as you like to represent network devices you'd like regularly pinged. The script will update their status with regular pings, progressing each device between Up, Alert, and Down states. Devices will have their status updated accordingly, so you can trigger other events based on state or number of failed pings. Status text also shows icons reflecting status, unique to different kinds of devices. You can configure devices with IP addresses or NetBIOS names, so long as your server can ping them. Can also be configured to audibly announce certain devices going up and down, and those announcements can be suppressed depending on a certain other device being on.

Installation
Unarchive this zip file in your HomeSeer directory, honoring paths.

Upgrading
Versions up to v2.1 kept the IP address visibly in the device string. v2.2 starts using the UserNote for that. To upgrade, first copy the IP addresses into the user notes for all your network devices; then copy the new version of network_monitor.txt into place. The IP addresses will soon vanish from your devices' strings, resulting in a cleaner display. You can now delete any event you created to set those strings.

Upgrading from v2.2 to v2.3 should be as simple as replacing the network_monitor.txt file. Don't forget, if you customized it, don't overwrite your customizations!

Configuration
Follow the directions in the top of network_monitor.txt (in the Scripts directory) to configure it and set up Device Types and Devices accordingly. The archive includes icons for most of the device types listed, so you might need to create more icons if you create other device types. I recommend making the event that runs it set to not log.

You can then set up other events which trigger based on these devices going On (up), Dim (alert), or Off (down), or against their Device Value, which counts number of failed ping bundles. (Device value of 0 is Up, 1 is Alert, and 2+ is Down. Though each point there represents a bundle of ping failures, not a single one, to avoid situations where brief blips count as outages.)

Version History
  • v2.0 - 2006-05-06 - First release of v2.
  • v2.1 - 2006-05-11 - Fixed missing includes. Now uses hs.Ping. Up/Alert/Down are color-coded. Fixed my email address in the file.
  • v2.2 - 2006-05-26 - Moved IP addresses to hidden place in UserNote. Rewrote installation directions to make it simpler to get started.
  • v2.3 - 2006-06-03 - Added a "Ping" button to these devices. Added a printer icon to the collection.

Future Changes
I am still hoping to find a way to use a MAC to ping or look up the IP to ping, but that's only because my dumb router doesn't support MAC reservations, and I don't want to make everything fixed-IP instead of DHCP.

Download Download Network Monitor v2.3

To report a bug or make a feature suggestion, post a comment.

8 comments:

Anonymous said...

Frank,
I have yahoo.com in my config to check for internet connection, and suddenly, all day today I'm getting the internet reported as up, then down, then up, then down... It may be something with yahoo, but it appears that my internet was up the whole time. Have you seen anything like this?
Steve Anderson (stevea on HST)

Hawthorn Thistleberry said...

Yahoo Messenger has been down for more than a day now. I don't recommend using something like Yahoo as your Internet check, both because of things like this, and because of the unnecessary traffic on the Internet backbone. Instead, open a Command Prompt, type "tracert www.yahoo.com", and on the resulting list, pick the first address that's outside your house. Ping it, and if you get results, use that address for your Internet Connection device.

Anonymous said...

Frank,

I use your network monitor at home, however have had to turn off "scripts" time out.

This is because I would continue to get the script running out of time for pinging (esp. when something was offline).

I like to have this on in case one of my scripts runs away with Homeseer.

Is there a way to make your script take it's time, yet allow the system to timeout?

I understand that it's the number of ping attempts that are being made, which gives "alert" then "offline"

What kinds of intervals can I expect to use with this? Repeat the script every 5 minutes? 10 minutes? What do you recommend? I know that I would rather NOT call the script more then once while it is running already (which I can check the check-box for).

Thanks! Great Script!

--Dan

Hawthorn Thistleberry said...

I think that's why I stopped using hs.Ping way back in v1... guess they haven't really fixed it after all. I get this once in a while myself but it usually clears up quickly, and that's even with two devices that are usually down, not up. But when it happens, it's annoying. Guess I'll go back to the embedded ping next version.

I have mine run every two minutes. That's about right for the thresholds I use.

Anonymous said...

Great script! Anyone know where to get some XBOX or game console icons?

DJ said...

Great script! I have installed it and it seems to do everything. Just now I added an IP that doesn't exist, and it keeps telling me that it's "up"?

Sometimes it says "down" or "dim" ;-) but it should never say "up" correct?

Hawthorn Thistleberry said...

Network Monitor asks HomeSeer to test with hs.Ping. If HomeSeer returns that the ping worked, Network Monitor will flag it as "up". Are you sure there's no chance there's something at that IP? If so, then I guess HomeSeer is fooled.

DJ said...

Yes. I have never used this particular IP and cannot ping it from my routers, switches or PC's. Looks like we fooled HS2 ;-)