The Vera Community forums have moved!

Advanced => Programming => Plugins & Plugin Development => Topic started by: amg0 on May 07, 2018, 05:16:09 pm

Title: New Plugin : NETMON - a network device monitor
Post by: amg0 on May 07, 2018, 05:16:09 pm
Network Monitor plugin for VERA

New Plugin : NETMON  , Network Monitor
supported on UI5, UI7, ALTUI, openluup
The plugin will soon be released in the VERA App Store (http://apps.mios.com/plugin.php?id=9081)

Source and more details documentation can be found here : =>
https://github.com/amg0/NetMonitor (https://github.com/amg0/NetMonitor)

This plugin is enabling you to check the availability of some device on your IP network. it uses ping or http to verify the availability of a device and report it as a Motion Sensor device in VERA
-Tripped:  means the device is not present or fails
-Untripped: means the device is properly responding to the probe

The plugin is not yet in the App Store but you can find it AltAppStore or the sources on https://github.com/amg0/NetMonitor (https://github.com/amg0/NetMonitor)
To install , download the files from github , upload them and manually create the device

It is freeware but you have a donation setting page if you feel like showing your support
Title: Re: New Plugin : NETMON - a network device monitor
Post by: ChrisTheC on May 08, 2018, 06:02:44 am
Amg0,

Thanks for your continued enhancements.

Tried it on openLuup. I don't have the "status" tab.

Regards,
Chris
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on May 08, 2018, 08:01:25 am
Amg0,

Thanks for your continued enhancements.

Tried it on openLuup. I don't have the "status" tab.

Regards,
Chris
I had forgotten to commit in github, it should be in now in latest version. Sorry
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on May 08, 2018, 08:08:30 am
Amg0,

Thanks for your continued enhancements.

Tried it on openLuup. I don't have the "status" tab.

Regards,
Chris
I had forgotten to commit in github, it should be in now in latest version. Sorry

You can also take the latest altui from github I did some enh for the netmon displays ( dashboard and favorites )
Title: Re: New Plugin : NETMON - a network device monitor
Post by: ChrisTheC on May 09, 2018, 06:15:58 am
 :) Looking good!
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on May 09, 2018, 11:12:15 am
Just added UI5 support as well. so UI5 UI7 ALTUI and openluup are supported
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Jantang on May 21, 2018, 01:06:13 pm
@amg0.  A splendid plug-in. Would I be correct that IgnoreTripTime is not implemented? At least it does not seem to work in the way that I would expect.  I have an IP device that is on an unreliable part of the network, so I would like to delay the alert until it has failed two pings.  I set IgnoreTripTime to a value more than the polling cycle time, but it still trips, and only delays the un-trip.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on May 25, 2018, 02:56:09 pm
@amg0.  A splendid plug-in. Would I be correct that IgnoreTripTime is not implemented? At least it does not seem to work in the way that I would expect.  I have an IP device that is on an unreliable part of the network, so I would like to delay the alert until it has failed two pings.  I set IgnoreTripTime to a value more than the polling cycle time, but it still trips, and only delays the un-trip.

correct, not implemented, I need to look at this but am quite busy professionally at the moment. could take a little while
Title: Re: New Plugin : NETMON - a network device monitor
Post by: wilme2 on June 18, 2018, 04:24:06 pm
Network Monitor plugin for VERA

New Plugin : NETMON  , Network Monitor


Cool - I was about to install the old PING sensor, but I am going to try this instead...
Title: Re: New Plugin : NETMON - a network device monitor
Post by: wilme2 on June 18, 2018, 04:30:57 pm
How do I assign a monitored device to a "Room"?  I guess in the advanced settings if I knew the room number...

UPDATE - works via advanced settings.

UPDATE 2- nope, after a reboot, the motion sensor was back in "No Room" AKA Room 0...

Realization - this is parent/child and they have to be in the same room - it is a Vera limitation.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on June 18, 2018, 05:44:03 pm
Nope it is a design decision. I made the device in embedded mode so children are following it in the same room as their parent. Seemed  to me a better way as they are all just a probe.
I am Not sure if this setting could be controlled by an option and changed after the initial device creation
Title: Re: New Plugin : NETMON - a network device monitor
Post by: ChrisTheC on June 19, 2018, 05:38:33 am
How do I assign a monitored device to a "Room"?  I guess in the advanced settings if I knew the room number...

UPDATE - works via advanced settings.

UPDATE 2- nope, after a reboot, the motion sensor was back in "No Room" AKA Room 0...

Realization - this is parent/child and they have to be in the same room - it is a Vera limitation.

wilme2,

Perhaps I misunderstand your query, but on openLuup/ALTUI, I moved all of the child devices into a separate room via the control panel of the child device.

If this is not what you are looking for, please ignore.

Chris
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on June 19, 2018, 07:49:22 am
How do I assign a monitored device to a "Room"?  I guess in the advanced settings if I knew the room number...

UPDATE - works via advanced settings.

UPDATE 2- nope, after a reboot, the motion sensor was back in "No Room" AKA Room 0...

Realization - this is parent/child and they have to be in the same room - it is a Vera limitation.

wilme2,

Perhaps I misunderstand your query, but on openLuup/ALTUI, I moved all of the child devices into a separate room via the control panel of the child device.

If this is not what you are looking for, please ignore.

Chris
Maybe oprnluup did not fully implement the embedded flag concept on devices...
Title: Re: New Plugin : NETMON - a network device monitor
Post by: akbooer on June 20, 2018, 07:19:33 am
I may be missing something, but is there a way to invert the sense of the 'tripped' alarm?

I'm using it to monitor by internet connectivity, and having previously used the Ping plugin, OK is '1' and not OK is '0'.

Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on June 20, 2018, 07:33:37 am
I may be missing something, but is there a way to invert the sense of the 'tripped' alarm?

I'm using it to monitor by internet connectivity, and having previously used the Ping plugin, OK is '1' and not OK is '0'.

I think the point is when a device has the embedded flag set too ne all it?s children devices are following it in the same room.
NETmON plugin uses the embedded flag so on vera all children follow their father in the same room and apparently on openluup not hence my inference that embedded flag may not be implemented on openluup. ( have not tested )
Title: Re: New Plugin : NETMON - a network device monitor
Post by: akbooer on June 20, 2018, 09:53:52 am
I think the point is when a device has the embedded flag set too ne all it?s children devices are following it in the same room.
NETmON plugin uses the embedded flag so on vera all children follow their father in the same room and apparently on openluup not hence my inference that embedded flag may not be implemented on openluup. ( have not tested )

OK on that.  I'll check, but I thought that I had correctly implemented this behaviour.

However, my recent post was a separate enquiry altogether... how to invert the sense of the 'Tripped' variable.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: sk1.publicc on June 25, 2018, 10:51:49 pm
Loving this plug-in.  Have teamed it up with Homewave to monitor all of my Milight Bridges.
Helps flag any connectivity issues quickly and before I waste time troubleshooting scenes that aren't working.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on June 26, 2018, 03:08:34 am
Loving this plug-in.  Have teamed it up with Homewave to monitor all of my Milight Bridges.
Helps flag any connectivity issues quickly and before I waste time troubleshooting scenes that aren't working.
thank you for the feedback
Title: Re: New Plugin : NETMON - a network device monitor
Post by: ojovilla on October 06, 2018, 09:56:48 am
Mine seems to always be in a constant state of tripped.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on October 06, 2018, 10:34:45 am
Mine seems to always be in a constant state of tripped.
Looking into this
Also it would be useful if you could share a Vera log file captured with the plugin in debug mode.

Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on October 06, 2018, 12:37:50 pm
Mine seems to always be in a constant state of tripped.

you may have version 0.2.  Version 0.4 fixed this
I had this on github since a while but did not yet published it to mios app store. this is done now but it will take some days for MCV to approve it
in the mean time you can either take the github version https://github.com/amg0/NetMonitor (https://github.com/amg0/NetMonitor) or install it by opening a browser with this url and ignoring the error messages

http://<yourveraip>/port_3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=9081&Version=36920
Title: Re: New Plugin : NETMON - a network device monitor
Post by: ojovilla on October 08, 2018, 10:50:38 pm
I believe I am on the latest version , at least it says 0.4. here is the log below, If I am reading this correctly , it appears to be have an error on ping and changing the ip address.

luup_log:216: NETMON: warning: Device 192.X.X.2 did not respond properly to { "type": "ping", "name": "Iphone", "ipaddr": "192.X.X.X" } probe <0x72eb2520>
02   10/08/18 20:04:02.351   15622 updated ip 192.X.X.3 mac .......



Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on October 09, 2018, 12:51:26 am
I believe I am on the latest version , at least it says 0.4. here is the log below, If I am reading this correctly , it appears to be have an error on ping and changing the ip address.

luup_log:216: NETMON: warning: Device 192.X.X.2 did not respond properly to { "type": "ping", "name": "Iphone", "ipaddr": "192.X.X.X" } probe <0x72eb2520>
02   10/08/18 20:04:02.351   15622 updated ip 192.X.X.3 mac .......

Can you ssh into Vera and try to ping this device from the shell cmd line ?
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 13, 2019, 05:25:48 pm
HI amg

I was trying to incorporate the plugin into a notification of some type when I stumbled on what looks like some errata code in the D_NETMON_UI7.json file.  Code is near the bottom and is part of the notification tab.

However, my main request has to do with creating some code that will send a push notice whenever a given device goes offline.  Rather than create a notice for each and every device (I have quite a few), I was thinking of a function within the plugin itself that would populate a service variable with the names of any offline devices.  Then one could access that variable, and use its description as the message body within a push notice.   I imagine I would use this same empty variable as the state point and when it populates, it would trigger the notice.  Or perhaps there's a better way to what I'm trying to do.

Is this doable?  If not, no worries.
Thx
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on January 13, 2019, 05:35:34 pm
Hello
I probably do not fully understand. Every device is a motion detector so a device going offline can be detected by an event on the tripped event of that device ( or a Luup variable watch on Tripped variable ), can?t it ?

Thx for the notice on the json I ll have a look
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on January 13, 2019, 05:42:29 pm

I was trying to incorporate the plugin into a notification of some type when I stumbled on what looks like some errata code in the D_NETMON_UI7.json file.  Code is near the bottom and is part of the notification tab.


I could not find the problem, could please you show it with a snapshot of code or screen ?
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 13, 2019, 06:10:43 pm
Here's a snapshot of the file contents.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 13, 2019, 06:13:38 pm
Yes, I can detect individual devices using a notification for each device.  However, since I have a great many devices hanging off my Network (and being monitored) I do not want to have to create an individual notice for each device, but rather one single notice that would fire if any device went offline. 
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on January 13, 2019, 06:24:39 pm
Yes, I can detect individual devices using a notification for each device.  However, since I have a great many devices hanging off my Network (and being monitored) I do not want to have to create an individual notice for each device, but rather one single notice that would fire if any device went offline.
Ok, did you also see the 2 Events ( offline count goes below and goes beyond ) ?
Then we can think of something else like  the DeviceStatus variable that contains a json  array , I need to check if a luup watch on this variable would work
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on January 13, 2019, 06:25:44 pm
Here's a snapshot of the file contents.
Ok but what is the problem? This looks correct
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 13, 2019, 07:31:19 pm
For example, what does "temperature_goes_above" have to do with the online status of Network devices?
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 13, 2019, 07:44:00 pm
I can definitely use 'offline count goes beyond' as the trigger, if it will fire on anything above 0.
Thx
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 13, 2019, 08:19:29 pm
Here's a snapshot of what I'm referring to.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 16, 2019, 05:00:23 am
Hi amg,
I made the changes to both the lua file and the service file and all works well for my requested notification variable.  I did not touch the notification tab.  Should I push these changes up to git-hub, or is there a better way to incorporate the code. Thx
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on January 17, 2019, 08:09:14 am
Hi amg,
I made the changes to both the lua file and the service file and all works well for my requested notification variable.  I did not touch the notification tab.  Should I push these changes up to git-hub, or is there a better way to incorporate the code. Thx
I ll check, thx
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on January 20, 2019, 04:22:44 pm
Thx for the commit amg.   8)
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Vera Plus user on January 21, 2019, 02:03:25 pm
After updating today to 0.5 I think it?s some problem. It doesn?t see any of my devices anymore.

Do I have to do any adjustment?
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on January 21, 2019, 02:15:42 pm
After updating today to 0.5 I think it?s some problem. It doesn?t see any of my devices anymore.

Do I have to do any adjustment?
No. Must be another issue. Enable debug mode and share the log please
Title: Re: New Plugin : NETMON - a network device monitor
Post by: Vera Plus user on January 22, 2019, 01:34:46 am
You are right.

I have another problem with my Vera and when this was solved it was alwright again.

Thank you
Title: Re: New Plugin : NETMON - a network device monitor
Post by: DesT on January 26, 2019, 09:07:03 am
amg0,

It is possible to have a toggle somewhere to "INVERT" the detector.   I will prefer like AK to have the inverse that a detectesd device is tripped...
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on January 26, 2019, 11:23:19 am
amg0,

It is possible to have a toggle somewhere to "INVERT" the detector.   I will prefer like AK to have the inverse that a detectesd device is tripped...

I added the inverted option in v0.7 in github. if you change status inverted property, you need to wait until the device is tested, or to force a refresh on the device ( test button ) before you get a coherent status
Title: Re: New Plugin : NETMON - a network device monitor
Post by: DesT on January 26, 2019, 12:23:51 pm
Just update the plugin and change the settings for Invert and when I "test" a device it give me the right answer BUT all my devices are still Untripped...
amg0,

It is possible to have a toggle somewhere to "INVERT" the detector.   I will prefer like AK to have the inverse that a detectesd device is tripped...

I added the inverted option in v0.7 in github. if you change status inverted property, you need to wait until the device is tested, or to force a refresh on the device ( test button ) before you get a coherent status
Title: Re: New Plugin : NETMON - a network device monitor
Post by: DesT on January 26, 2019, 12:32:26 pm
Ohhh I think I understand my problem.

I need to invert the "motion" status... not the "online/offline" status....
Title: Re: New Plugin : NETMON - a network device monitor
Post by: jvanhambelgium on February 01, 2019, 04:24:05 pm
Hi,
I don't have the impression that this plugin is working on my Veraplus / UI7 / latest FW
So I defined just 2 IP's to check, 1 if certainly online, the other not.
Still they are bot reported online and nothing really seems to happen ?
I'm just seeing the main Netmon-app/device, no "child" devices/sensors are visible in my GUI even after browser-reload (latest Chrome , Version 72.0.3626.81 (Official Build) (64-bit) on Ubuntu)
I've put on the debug-mode and captured some output, followed by 2 ping tests myself from the console.


50   02/01/19 21:54:47.104   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { "name": "TV", "ipaddr": "172.29.45.17" }, { "name": "FAKE", "ipaddr": "172.29.45.18" } ],6432) <0x748d8520>
50   02/01/19 21:54:47.105   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50   02/01/19 21:54:47.105   luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
50   02/01/19 21:54:57.100   luup_log:6432: NETMON: debug: refreshDevices(6432) <0x748d8520>
50   02/01/19 21:54:57.102   luup_log:6432: NETMON: debug: refreshOneDevice(6432,null) <0x748d8520>
50   02/01/19 21:54:57.102   luup_log:6432: NETMON: debug: getDevicesStatus(6432) <0x748d8520>
50   02/01/19 21:54:57.104   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesNotification,,6432) <0x748d8520>
50   02/01/19 21:54:57.104   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { "name": "TV", "ipaddr": "172.29.45.17" }, { "name": "FAKE", "ipaddr": "172.29.45.18" } ],6432) <0x748d8520>
50   02/01/19 21:54:57.105   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50   02/01/19 21:54:57.105   luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
50   02/01/19 21:55:07.100   luup_log:6432: NETMON: debug: refreshDevices(6432) <0x748d8520>
50   02/01/19 21:55:07.102   luup_log:6432: NETMON: debug: refreshOneDevice(6432,null) <0x748d8520>
50   02/01/19 21:55:07.102   luup_log:6432: NETMON: debug: getDevicesStatus(6432) <0x748d8520>
50   02/01/19 21:55:07.104   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesNotification,,6432) <0x748d8520>
50   02/01/19 21:55:07.104   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { "name": "TV", "ipaddr": "172.29.45.17" }, { "name": "FAKE", "ipaddr": "172.29.45.18" } ],6432) <0x748d8520>
50   02/01/19 21:55:07.105   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50   02/01/19 21:55:07.105   luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
50   02/01/19 21:55:17.100   luup_log:6432: NETMON: debug: refreshDevices(6432) <0x748d8520>
50   02/01/19 21:55:17.102   luup_log:6432: NETMON: debug: refreshOneDevice(6432,null) <0x748d8520>
50   02/01/19 21:55:17.102   luup_log:6432: NETMON: debug: getDevicesStatus(6432) <0x748d8520>
50   02/01/19 21:55:17.104   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesNotification,,6432) <0x748d8520>
50   02/01/19 21:55:17.105   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { "name": "TV", "ipaddr": "172.29.45.17" }, { "name": "FAKE", "ipaddr": "172.29.45.18" } ],6432) <0x748d8520>
50   02/01/19 21:55:17.105   luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50   02/01/19 21:55:17.105   luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
^C
root@MiOS_50160552:/tmp/log/cmh# ping 172.29.45.17
PING 172.29.45.17 (172.29.45.17) 56(84) bytes of data.
64 bytes from 172.29.45.17: icmp_req=1 ttl=64 time=0.410 ms
64 bytes from 172.29.45.17: icmp_req=2 ttl=64 time=0.300 ms
64 bytes from 172.29.45.17: icmp_req=3 ttl=64 time=0.295 ms
^C
--- 172.29.45.17 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.295/0.335/0.410/0.053 ms
root@MiOS_50160552:/tmp/log/cmh# ping 172.29.45.18
PING 172.29.45.18 (172.29.45.18) 56(84) bytes of data.
From 172.29.45.250 icmp_seq=1 Destination Host Unreachable
From 172.29.45.250 icmp_seq=2 Destination Host Unreachable
From 172.29.45.250 icmp_seq=3 Destination Host Unreachable
^C
--- 172.29.45.18 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3999ms
pipe 4
root@MiOS_50160552:/tmp/log/cmh#


Title: Re: New Plugin : NETMON - a network device monitor
Post by: Buxton on February 01, 2019, 04:42:05 pm
Try going to Settings:Z-Wave Settings:Advanced and click the reload engine button.  This will reload the luup engine, which should create the child devices.  Then reload the browser to clear anything in the cache.  Offline devices take about a minute to show up as the plugin will poll (ping) on a set schedule.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: jvanhambelgium on February 02, 2019, 02:05:10 am
Thx for the feedback, in the meantime it seems to be working.
I've removed the app (through GUI) and SSH'ed in the box and removed all effective files too.
Then a clean install again from the app-store with version 0.5

Then I immediately assigned a room to it (while previously I left it as "No Room") and created some IP's to ping & saved.
Even then I would not see child-devices even after luup-reload.
I finally rebooted the whole unit ... then indeed child-devices showed up and are ready to use.

Now I'm running v0.5 of the plugin, I can simply fetch the github v0.7 code and transfer the files to the Vera (through GUI => Apps => Develop Apps) so effectively overwrite them ?


I've set a low timer on the pings (eg. 2 seconds) since I want to use it to detect if a smart-TV is on. Much faster then obtaining the Watt-usage on a port to make the decision if a TV is turned on.

Title: Re: New Plugin : NETMON - a network device monitor
Post by: jvanhambelgium on February 02, 2019, 03:10:00 am
I now simply uploaded the Github v0.7 files (all of them) onto the Vera and reloaded.

It seems the plugin does like a system reboot in order to clean things.
Eg. I removed my 2 ping "entries" on the mail NETMON-app , saved etc.
The child-devices remain in place, even after closing browser & login again etc.

Only after performing a system reboot, it seems my 2 child-devices are now effectively gone.
This is expected behaviour ? The same for renaming, when I rename the 2 defined probes in the Netmon-app , the child-devices do not follow and keep their original name given at time of creation.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: bobies on February 02, 2019, 02:00:23 pm
I installed update 0.7 for this plugin and change the settings to Invert, but the "motion" device is still untripped. Also after reload luup engine.
Does anyone have a solution.
Thanks
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on February 03, 2019, 10:02:05 am
I installed update 0.7 for this plugin and change the settings to Invert, but the "motion" device is still untripped. Also after reload luup engine.
Does anyone have a solution.
Thanks

here is a procedure to try to help
1 enable DEBUG mode,  reload the plugin
2 go to netmon STATUS tab, click on the TEST button for your device
3 get the log file from vera
4 share here or with me by email. 
( I need the whole sequence in debug from the NETMON startup )
thx
Title: Re: New Plugin : NETMON - a network device monitor
Post by: bobies on February 03, 2019, 10:56:37 am
Thanks for the reply, but were can I find this log file after debug is enabled?
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on February 03, 2019, 10:59:33 am
Thanks for the reply, but were can I find this log file after debug is enabled?

Q: How to get logs
A: Several methods
a) classic way
1) turn on DEBUG 2) open http://Your.Vera.IP.Address/cgi-bin/cmh/log.sh?Device=LuaUPnP 3) let it run for a while so the problem happens 4) in your browser save the file on your disk  5) open with an editor (notepad or whatever ) and search for your iCloud email , change email/pwd so I do not see it , save the file 6) send it to me using PM on this forum

b) using infoviewer
1) open InfoViewer, put the pattern to "netmon"
2) open Infoviewer page then View Logs
3) same as above a.4 a.5 a.6

c) using WinSCP / Windows
1) use WinSCP
2) chose SCP as file protocol
3) Hostname = your vera ip address , username=root , Password= your vera password
4) once logged in , go to folder /var/log/cmh/
5) select file LuaUPnP.log , drag and drop it on your desktop
6) same as a.5, a.6
Title: Re: New Plugin : NETMON - a network device monitor
Post by: wmwnd on March 01, 2019, 08:37:20 am
having the same problem, although I inverted a tested node, it is  mentioning off-line , but test button tells on-line
Title: Re: New Plugin : NETMON - a network device monitor
Post by: florianec on March 15, 2019, 03:44:12 pm
today i installed v0.7 and also struggled with the inverted option always showed off-line. I think the problem is in line 389 (L_NETMON.lua) always return "true" if inverted is set to 1. I am not very familiar with lua but i always had this urge to solve problems so i did a bit trial-and-error and changed your code for testing:

line 389 (L_NETMON.lua) >
Code: [Select]
local value = (inverted==1 and not success) or (inverted==0 and success)
it works but its probably not the correct way to code it.
Title: Re: New Plugin : NETMON - a network device monitor
Post by: amg0 on March 17, 2019, 06:42:18 pm
today i installed v0.7 and also struggled with the inverted option always showed off-line. I think the problem is in line 389 (L_NETMON.lua) always return "true" if inverted is set to 1. I am not very familiar with lua but i always had this urge to solve problems so i did a bit trial-and-error and changed your code for testing:

line 389 (L_NETMON.lua) >
Code: [Select]
local value = (inverted==1 and not success) or (inverted==0 and success)
it works but its probably not the correct way to code it.

please try version 0.8 on github and let me know how it goes. I refactored some important logics in it
https://github.com/amg0/NetMonitor