Python Plugin: Network Pinger (Native ICMP) Topic is solved

Python and python framework
gerardwr
Posts: 45
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by gerardwr » Wednesday 15 November 2017 0:05

Dnpwwo wrote:
Tuesday 14 November 2017 23:18
@gerardwr,

You can change the name of the device in Domoticz to anything you want using the normal "Edit" button in the "Switches" tab. The plugin sets a default name but does not rely on it remaining the same.
Yes I understand.

But suppose I would like to Ping 20 devices, you would have to edit the names of these devices individually. Defining the relation between name and IP in 1 place sounded appealing to me.

User avatar
Dnpwwo
Posts: 630
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by Dnpwwo » Wednesday 29 November 2017 13:49

November 29th, 2017, version 3.0.1:
  • Devices are created in Domoticz the first time the plugin runs, one to show if the device is found and one to show the response time.
  • Devices that are not found are optionally shown with a red banner in the devices tab (if configured to do so)
  • New version handles DNS names where the IP addresses changes (e.g www.google.com) without creating new devices in Domoticz
Users of the previous version should 'Delete' then 'Add' the plugin via the Hardware page.
Requires recent beta for the response time devices to be updated.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

gerardwr
Posts: 45
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by gerardwr » Wednesday 29 November 2017 16:56

Dnpwwo wrote:
Wednesday 29 November 2017 13:49
November 29th, 2017, version 3.0.1:
Just installed the updated plugin, works excellent!

Defined 3 addresses to ping in setting up, and for every address a "switch" and a "utility" is created automagically.

Schermafbeelding 2017-11-29 om 15.37.52.png
Schermafbeelding 2017-11-29 om 15.37.52.png (58.08 KiB) Viewed 304 times
Schermafbeelding 2017-11-29 om 15.38.08.png
Schermafbeelding 2017-11-29 om 15.38.08.png (46.96 KiB) Viewed 304 times

For each "utility" sensor a graph is made by Domoticz, picture below after 6+ hours.
Schermafbeelding 2017-11-29 om 22.25.10.png
Schermafbeelding 2017-11-29 om 22.25.10.png (118.68 KiB) Viewed 294 times
Just as I wanted, well done, I'm happy :-)

schulpr
Posts: 97
Joined: Thursday 01 January 2015 10:10
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by schulpr » Friday 01 December 2017 13:21

Hi,

I'm getting errors on the last version (3.01):

2017-12-01 12:18:17.675 Error: (Pinger) 'onHeartbeat' failed 'IndexError':'list index out of range'.
2017-12-01 12:18:17.675 Error: (Pinger) ----> Line 181 in /home/pi/domoticz/plugins/pinger/plugin.py, function onHeartbeat
2017-12-01 12:18:17.675 Error: (Pinger) ----> Line 157 in /home/pi/domoticz/plugins/pinger/plugin.py, function onHeartbeat

Any idea what could be wrong?

Regards, Rob

User avatar
Dnpwwo
Posts: 630
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by Dnpwwo » Saturday 02 December 2017 3:53

@schulpr,

Yes I do have an idea. I have been testing the plugin with multiple addresses lately and broke it for when only a single address is specified (which I'm guessing you have) :oops:

I've pushed an update to the Pinger example. Version 3.0.3 is here: https://github.com/domoticz/domoticz/bl ... /Pinger.py
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

schulpr
Posts: 97
Joined: Thursday 01 January 2015 10:10
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by schulpr » Saturday 02 December 2017 9:39

Hi Dnpwwo,

Thank you for the update, the script does work now but I still get an (different) error:

" 2017-12-02 08:27:45.743 Error: (Pinger) Transport not initialized, write directive to '192.168.2.12' ignored. Connectionless transport should be Listening."

I was indeed testing with only one IP-address. I'm trying different plugins to see which one of them fits best for my needs. I like this one because it's easy to install en managed within Domoticz. There is another one (Ultimate Wifi and Bluetooth Presence Detection) that also pings the bluetooth mac-address but this is another type of script.

So I was wondering if it is possible to ping the bluetooth device also in a Python script. (Combine the best of both worlds sort of speak :-).

Thanks for all your work in the Domoticz community. A lot of people are doing a great job here so people with less knowledge can benefit from this.

Kind regards, Rob

gerardwr
Posts: 45
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by gerardwr » Saturday 02 December 2017 23:54

schulpr wrote:
Saturday 02 December 2017 9:39
Hi Dnpwwo,

Thank you for the update, the script does work now but I still get an (different) error:

" 2017-12-02 08:27:45.743 Error: (Pinger) Transport not initialized, write directive to '192.168.2.12' ignored. Connectionless transport should be Listening."
Yes, I've got this error too, exactly ON the hour, but not EVERY hour. Error log says

Code: Select all

2017-12-02 14:00:36.358 Error: (pinger) Transport not initialized, write directive to '192.168.0.222' ignored. Connectionless transport should be Listening.
2017-12-02 16:00:36.310 Error: (pinger) Transport not initialized, write directive to '192.168.0.222' ignored. Connectionless transport should be Listening.
2017-12-02 17:01:05.180 Error: (pinger) Transport not initialized, write directive to '192.168.0.222' ignored. Connectionless transport should be Listening.
2017-12-02 18:00:37.015 Error: (pinger) Transport not initialized, write directive to '192.168.0.32' ignored. Connectionless transport should be Listening.
no more this error till 22:45
In addition my error log contains this error EVERY hour

Code: Select all

2017-12-02 22:00:41.612 Error: (pinger) 'onHeartbeat' failed 'KeyError'.
2017-12-02 22:00:41.612 Error: (pinger) ----> Line 181 in /home/pi/domoticz/plugins/Pinger/plugin.py, function onHeartbeat
2017-12-02 22:00:41.612 Error: (pinger) ----> Line 149 in /home/pi/domoticz/plugins/Pinger/plugin.py, function onHeartbeat
schulpr wrote:
Saturday 02 December 2017 9:39
Thanks for all your work in the Domoticz community. A lot of people are doing a great job here so people with less knowledge can benefit from this.
+1 Excellent work!

Despite the errors the plugin works fine !

User avatar
bizziebis
Posts: 530
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi
Domoticz version: 3.8337
Location: The Netherlands
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by bizziebis » Wednesday 06 December 2017 14:26

I cannot get it to work, also not with the latest version of the plugin

Code: Select all

2017-12-06 13:22:04.895 (Ping Status) Started.
2017-12-06 13:22:05.064 (Ping Status) Entering work loop.
2017-12-06 13:22:05.065 (Ping Status) Initialized version 3.0.3, author 'dnpwwo'
2017-12-06 13:22:05.122 Error: (Ping Status) 'onStart' failed 'AttributeError':''Domoticz.Device' object has no attribute 'TimedOut''.
2017-12-06 13:22:05.123 Error: (Ping Status) ----> Line 172 in /home/pi/domoticz/plugins/Pinger/plugin.py, function onStart
2017-12-06 13:22:05.123 Error: (Ping Status) ----> Line 106 in /home/pi/domoticz/plugins/Pinger/plugin.py, function onStart
2017-12-06 13:22:05.123 Error: (Ping Status) ----> Line 189 in /home/pi/domoticz/plugins/Pinger/plugin.py, function UpdateDevice
I'm running Domoticz Version: 3.8337 on a Raspberry Pi 3 with Raspbian Jessie.

The python plugin subsystem seems to be working. Buienradar plugin and NUT UPS plugin are working without any problems.

User avatar
Dnpwwo
Posts: 630
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by Dnpwwo » Wednesday 06 December 2017 22:50

@bizziebis,

ICMP and timed out devices are new features, you will need to be on a very recent beta. I'm on 3.8746
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

User avatar
bizziebis
Posts: 530
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi
Domoticz version: 3.8337
Location: The Netherlands
Contact:

Re: Python Plugin: Network Pinger (Native ICMP)

Post by bizziebis » Thursday 07 December 2017 15:25

Thanks, I was to quick with trying and not reading first.. I'm on V3.8775 now and it's working great.

Post Reply

Who is online

Users browsing this forum: four2six and 4 guests