Charmed Quark Systems
Google
WWW CharmedQuark.com

Go Back   Charmed Quark Systems > General Discussion > Beta Driver Development
Register FAQ Members List Calendar Mark Forums Read

Beta Driver Development Discussion of new drivers, finding someone to write a new driver, etc...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2011, 07:47 AM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,552
Lightbulb Network Monitor Driver

Network Monitor Driver
Version 1.5

Description:

This driver will periodically monitor the status of a network device via TCP/UDP/HTTP and set a boolean field to indicate the device is up or down. Configuration is done via an XML file stored under /MacroFileRoot in the CQC program directory. See attached instructions for configuration details.

Release Info
  • Version 1.0 - Original Version
  • Version 1.1 - Adding Ping and Reload Config functionality
  • Version 1.2 - Add Support for Standard CQC Presence Events
  • Version 1.3 - Reduce Logging for TCPConnect failures to Med
  • Version 1.4 - Reduce Logging level for all NetMon failures to Med
  • Version 1.5 - Fix In/Out Issue with CQC 4.2.906+
TCP Monitors
The TCP monitor will connect to <Device>:<Port>, optionally send the <SendString> upon successful connection and optionally search for <RecvString> in the response then disconnect. If no <RecvString> is specified then a simple socket connection is done and considered a success.

UDP Monitors
The UDP montior will send a UDP message using <SendString> to <Device>:<Port> and expect a response in the <Timeout> period. It will then optionally search the response for <RecvString>.

HTTP Monitors
The HTTP monitor will send an HTTP GET to the <URL> and optionally search the response for <RecvString>. If <FailOnError> is set to True then the monitor will expect a 200 type response any other response code will be considered a failure. If <FailOnError> is set to False, then any response will be considered a success.

Ping Monitors
The Ping monitor will send an ICMP ping to the <Device> and expect a response in the <Timeout> period.

Polling Interval
In order to prevent abusive polling the driver will calculate a minimum polling interval based on the specified polling intervals in <Global> and each monitor. This may cause some polling to occur at inaccurate intervals if all the intervals do not have a common divisor. For example, if you specify a polling interval of 45 seconds on one monitor and 30 seconds on a second monitor the driver will loop through the monitor list every 30 seconds. So the monitor with a 45 second interval will only be triggered on every other pass (every 60 seconds).

Example Config
Code:
<NetMonCfg> <Global> <Attempts>3</Attempts> <PollInterval>600</PollInterval> </Global> <!-- Network Components --> <Monitor> <FieldName>CoreSwitch</FieldName> <Type>TCP</Type> <Device>coreswitch</Device> <Port>80</Port> <ShowTime>True</ShowTime> </Monitor> <Monitor> <FieldName>DirecTV</FieldName> <Type>HTTP</Type> <URL>http://directv:8080/info/getOptions</URL> <ShowResponse>True</ShowResponse> <ShowTime>True</ShowTime> <Timeout>2000</Timeout> </Monitor> <Monitor> <FieldName>TheaterPC</FieldName> <Type>Ping</Type> <Device>theaterpc</Device> <ShowTime>True</ShowTime> </Monitor> </NetMonCfg>

Available in CQC 4.2.922+



Attachments (CQCDrvPack Created under CQC 4.1.907)
Attached Files
File Type: html Network Monitor.html (53.9 KB, 14 views)

Last edited by wuench : 04-20-2013 at 05:03 AM.
Reply With Quote
  #2  
Old 08-13-2011, 08:22 PM
znelbok's Avatar
znelbok znelbok is offline
Integration Partner
 
Join Date: May 2005
Location: Calderwood, Australia
Posts: 3,758
Default

Can a simple ping be used with this driver?

Mick
__________________
Mykel Koblenz
Illawarra Smart Home
Reply With Quote
  #3  
Old 08-14-2011, 04:48 AM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,552
Default

Not right now. I originallly intended to add it, but ICMP isn't working in CML right now. If you try to build an ICMP "socket" it throws an exception.
Reply With Quote
  #4  
Old 08-14-2011, 09:57 AM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is offline
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 32,496
Default

I'll look into that after 4.0 is out.
__________________
Dean Roddey
Software Geek Extraordinaire
Reply With Quote
  #5  
Old 10-09-2011, 03:12 PM
znelbok's Avatar
znelbok znelbok is offline
Integration Partner
 
Join Date: May 2005
Location: Calderwood, Australia
Posts: 3,758
Default

Dean how are we going with the ICMP issue.

I read this today and it is something that I would like to try with CQC, but it requires ping to be working. (wanted to use the bluetooth optionmentioned a long time ago, but that never got of the ground)

http://www.mysmarthomeblog.com/page--11.html

Mick
__________________
Mykel Koblenz
Illawarra Smart Home
Reply With Quote
  #6  
Old 10-09-2011, 03:50 PM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,552
Default

Yeah, I was hoping to do this too. The IPhone has no open UDP/TCP ports when apps aren't running. ICMP is the only option.
Reply With Quote
  #7  
Old 10-09-2011, 04:51 PM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is offline
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 32,496
Default

I haven't had a chance to look at it yet. I'll try to take some time to look at it here before long.
__________________
Dean Roddey
Software Geek Extraordinaire
Reply With Quote
  #8  
Old 04-08-2012, 07:46 PM
Trioxide Trioxide is offline
 
Join Date: Nov 2007
Posts: 606
Default

Quote:
Originally Posted by znelbok
Dean how are we going with the ICMP issue.

I read this today and it is something that I would like to try with CQC, but it requires ping to be working.
http://www.mysmarthomeblog.com/page--11.html

Mick

Dean,
Is there a driver now that will do a Ping? I saw this article also and would like to be able to do it.

Thanks
Reply With Quote
  #9  
Old 04-08-2012, 10:09 PM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is offline
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 32,496
Default

No, not yet. I'll take a look at it.
__________________
Dean Roddey
Software Geek Extraordinaire
Reply With Quote
  #10  
Old 04-09-2012, 04:54 AM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,552
Default

I use Eventghost and the driver I wrote for that to do a ping. It has a ping plugin.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:53 PM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.