New Plugin : NETMON - a network device monitor

Hi, Love the app. I am having some issues with using host names as the IP address which keeps coming back as offline even though I ping it manually fine (no issues when using actual IP addresses).

Does the app support the use of host names instead of IP address? Attached screenshot, log extract and shell cmd ping
netmon3

Not an expert with this plugin, but is it expecting a dotted quad IPv4 adress (like you ping and all the devices that are showing online) as opposed to hostname?

C

yes it does, as long as your name is correct and resolved by the DNS it will work

in your example the names are not matching you have b6e99c.home that succeeds and epson3bce2d.home in the log which fails. if the command line ""ping -c 1 -w 3 …name… " works then the plugin will work

2 Likes

I’m also looking into this as a more intelligent method for resetting the router when one home is vacated. Working through some kinks, and might just do 3-4 ping sensors. Or maybe ping lua from reactor…?

1 Like

Hi, I have finally noticed that my Inverted sensors still dont work either. I have just had a look at the code and spotted there is a logic error in the inverting line:

	local inverted = device_def.inverted or 0
	local value = (inverted>0) and (not success) or success

Whatever the value is for “inverted”, the “or success” term will return true if success is true. Looking on github at version 0.10, (app store version above is at 0.7); the names have changed, but the logic is still wrong…

	local value = (inverted>0) and (not device_def.success) or device_def.success

I have changed my code to XOR the inverted and success flags. This seems to correct the issue:

	local value = (inverted>0) ~= device_def.success

Regards
Octoplayer

(I also changed the log entry from

luup_log:319: NETMON: warning: Device 192.168.1.72 did not respond properly to…

to

luup_log:319: NETMON: warning: Device 192.168.1.72 did not respond to

that code is already fixed in github GitHub - amg0/NetMonitor: Network Monitor plugin for VERA version since v0.8. it is currently at v0.10 level.
can you please try that version and let me know if you still have problems

Hi amg,
I had already pulled v.10 from github to fix the issue, but it had the same behaviour as the version that I had previously been using from the app store. The other possibility is that I have got the wrong files from github, but I have checked against your link above and it looks like the latest version of L_netmon.lua

The issue is that the code says:

local value = (inverted>0) and (not device_def.success) or device_def.success

That is pretty much: (inverted and not success) OR success
So if a ping is received, success is true, but (Anything) OR (True) is always True.
hence “inverted” is ignored if a ping is received.

Using Inverted ~= success gives an exclusive-or function, so that if inverted ==false, value
= success, but if inverted is true, then value = not success.

So, yes, I had tried v0.10, and the fix I posted makes invert work the way I would expect, i.e. I have some devices that I monitor and want to be tripped when they go offline, (webcams, NAS etc). Others are normally off and I want to know when they go on (PC / TV) so I set those to inverted.

(That’s why I also changed the log wording; for a device that is turned off or is out of range, “no ping” is the proper response, sorry - just being pedantic :slight_smile: )

Cheers
Octo

understood. can you please try v11 on github/ I used a less sophisticated version than your code just for my simple brain to understand it later… but it should be the same I hope
let me know, thx for reporting the issue

1 Like

Hi,

I’ve been using netmon for a couple months now.

I don’t know why, but I noticed recently the icons are not changing when devices are detected. I just upgraded to v10 and that didn’t resolve the issue.

ALL devices on the status tab say “Offline” however if i click “test” the expected ones do get a pop-up which says “Online”. Nothing happens if they are actually offline.

Any thoughts on what may have changed?

Edit: just realized IPs showing unchanged since April 21.

I am not clear with the problem.
What is not changing ? The status of devices ? They do not go to tripped state ?

Can you enable debug mode , reload luup, and share logs ?

Just installed this plugin, but what goes wrong?

I add a text and IP address, then click save and reload, but get a popup that I have to save the changes.
So it seems not to work …

And thus there is nothing in the status tab.

hi, yes, the status of the devices are not changing. Also, I noticed in reactor that the status of the devices are not getting displayed.

I am sending you the log now. Thanks!

When I did this log, Robins Laptop, RobinsPhone, MaricarsPhone, and Maricars watch should all be pingable.


it was a bug fix. I have put a version 0.12 on GitHub GitHub - amg0/NetMonitor: Network Monitor plugin for VERA which fixes the issue
thx for reporting.

thanks I tried. It appears to be working. Thanks!

Edit: The inverted option is also working. Cheers.

When will the update be available in the app store?

As soon as Vera approves it.

Check.

Can I just upload all the files in de developer part?

Will it be updated automatically then when 0.13 comes out?
What to do when I want to remove the uploaded 0.12?

Thanks.

Ok, just installed 0.12, so far so good. But I have a question.

After I added 2 IP’s I got 2 new devices. Looks good. But is it the way that when you remove an IP,
you have to manually remove the device that was created?

Netmon does it for you based on the data in your device ´s configuration tab

Well then there is a bug. I saved, reloaded. IT went away in the status tab. But the device was stille there.