[RELEASE] Network Monitor HealthCheck (HTTP)

That’s interesting.

Ive updated the code, update the driver with the new code and try again. See if that changes anything.

Works now with the updated driver. Thank you!

May I request that you put the importURL in the definitions? That way, it will make it easier to update by just clicking Import.

1 Like

Done. Thank you for the suggestion.

2 Likes

It didn't auto populate in the Import dialog box. I don't know how other developers do it. Anyway, the import url is visible right there, and is easier to find and copy/paste. Thank you.

One more suggestion or request: make the LAN field optional too, or have a toggle for it, like Custom.

Use case: Instead of trying to remember what Internet, LAN, and/or Custom is for, in order to keep straight what I'm checking, I'm making individual devices with easier to identify names - one for ISP1 modem, one for ISP2 modem, one for my server (and one each for services that have a local web-based UI like pi-hole, echo speaks cookie "server"), one for wifi router, etc. Then in my rules, I can more easily include whichever device(s) or local services I want to check or get notified about.

Nice choice !!!

By pointing at different http ports, you can actually monitor the service(s) running on the same host :wink:

Done. Refresh the code.
Enjoy.

1 Like

That's exactly what I've been doing. Great minds...?!? :rofl:

Thank you for the update. Now off to stress and random test it for a week or two.

1 Like

Would you consider moving the sendEvent attrib value: “offline” command from the checkHost() to the intialize()?

As of now, each attrib value is changed to “offline” every time the checkInterval is executed. A RM rule trigger using value changed would fire every interval, causing lots of false alarms.

2 Likes

I did not think of that. You are correct.

Updated the code. Thank you.

Last suggestion (for now?): Once you think it's mature enough, consider putting this in Hubitat Package Manager to make it easier for all users to find and autoupdate. And I am not the person to ask about getting something into HPM. :man_shrugging:t4: Just making the suggestion.

2 Likes

Thanks for the update and app, as well as being so open to suggested changes/improvements.

Eventually, it would be nice to be able to manually control logging (e.g. info, debug, warning or off).

1 Like

One thing I noticed after the 1.2 update: All of the "Check LAN Host?" toggles were back to being ON.

1 Like

I’ll consider that. I do think that once “complete”, it will not require updates.

I’ll work on that.

In v1.1 checkLAN didn’t exist, it was added in v1.2 with default set to true. Upon upgrade, that default takes effect unless explicitly changed and saved.

I don’t think it will be relevant going forward as v1.2+ will be built upon the logic that “knows” about it.

1 Like

I implemented a fix for that.

Done.

in 1.3, with LAN off, I'm not able to save without some value in LAN Host.

Another observation: previously empty LAN Hosts, it is now defaulting to 192.168.1.1, even when LAN checks are off.

Good catches. I did not test the code completely and I have all the fields filled on my side.

It couldn’t save without LAN host because when Check LAN Host? was turned off, the lanHost field was still marked as required. That forced a value to be present during saving.

The default value was assigned even when LAN was disabled happened because during execution, it pulled in the default value for lanHost regardless of whether LAN checks were enabled.

I fixed both of those issues and I added a toggle also that when enabled, will now optionally treat “connection refused” as online. The new toggle controls whether only unreachable hosts are considered offline.

It is useful when probing other type of ports (not http) and the connection is refused.
Technically the host is up to refuse the connection. The driver should not rely only on a successful connection code.
It can be disabled though, where the driver returns to the normal “http only” approach .

2 Likes

I had created a rule that would power cycle my isp gateway via smart plug if all of my internet, lan and custom connections were offline for more than 15 minutes per the Network Monitor HealthCheck device. I recently decided to test my rule by manually turning the smart plug for my isp gateway off. I waited 20 minutes but my rule never triggered.

I discovered that there was no Scheduled Job for the checkConnectivity handler for my Network Monitor HealthCheck device. I found that the checkConnectivity job had not run for a week. I don’t know how this occurred. So Network Monitor Healthcheck device reported it’s last reported status that all internet, lan and custom were online. Hence never triggering my rule.

Is there any way (rule) to determine that a checkConnectivity job is scheduled and, if not, force scheduling one?

I’m not using this driver any more and because of that, I didn’t noticed the failure.

That doesn't mean that i wont maintain rhe driver, as eventually, i might return to it.

Let me look into what’s happening and i’ll fix it today.

Fixed.