Pings specified IP addresses in a defined interval and monitors the results.
This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.
You can ping any IP address from the JavaScript adapter with command:
sendTo('ping.0', 'ping', '192.168.1.1', (res) => {
console.log('Result: ' + JSON.stringify(res)); // Result: {"result": {"host": "192.168.1.1", "alive": true, "ms": 250}}
});
-
if it is not possible to ping your linux client, check if
iputils-ping
is correctly installed on a client. -
ping
command under linux requires root permissions.
You can give the adapter the rights to execute the ping
command as root.
For this, you need to add the following line to the /etc/sudoers
file with sudo visudo
command: iobroker ALL=(ALL) NOPASSWD: /bin/ping
.
Or you can allow the ping execution by sudo setcap cap_net_raw+ep /bin/ping
command.
You must install setcap
with sudo apt-get install libcap2-bin
before if setcup
not found.
- Implement the possibility to monitor TCP ports
- (@GermanBluefox) Small changes the layout of the dynamic messages
- (@GermanBluefox) Used
iobroker/eslint-config
- (@GermanBluefox) Fixed some errors with
setcup
- (@GermanBluefox) Corrected admin notification
- (@GermanBluefox) Corrected notification message
- (@GermanBluefox) Corrected small error about range length
- (@GermanBluefox) Added support for dynamic notifications
- (@GermanBluefox) Added custom range settings
- (@GermanBluefox) Added the functionality to poll the address range periodically
- (@GermanBluefox) Added resolution of IP addresses to MAC addresses
- (@GermanBluefox) Added possibility to browse the IP ranges
- (@GermanBluefox) Added possibility to execute
setcap
command to allow ping without root rights
- (@GermanBluefox) Updated the packages
- (McM1957) Handling of state updates causing crashes with js-controller 5 has been corrected. (Issue #106)
- (McM1957) Trailing spaces are now removed from ip address and name. Trailing spaces blocked correct operation. (Issue #98)
- (@GermanBluefox) Added JSON config
- (@GermanBluefox) Added different intervals for online and offline devices
- (@GermanBluefox) implemented export/import of devices
- (Apollon77) Fix the ping retry logic
- (basti4557) Number of retries can be defined if a ping request failed. This should minimize wrong offline detection.
- js-controller 2.0 required at least
- (Apollon77) optimize for js-controller 3.3
- (Apollon77) Prevented a crash case when no devices are defined (Sentry IOBROKER-PING-R)
- (Apollon77) update js-controller dependency to correct version (1.5.8)
- (Apollon77) Prevent adapter crashes with invalid state/channel names, see error log! (Sentry IOBROKER-PING-H, IOBROKER-PING-P, IOBROKER-PING-B)
- (Apollon77) finally try to catch spawn errors (Sentry IOBROKER-PING-2)
- (Apollon77) Make sure the adapter does not crash if ping command cannot be executed (Sentry)
- (Apollon77) Catch error when
ping.probe
could not be started (Sentry IOBROKER-PING-2)
- (Apollon77) Fixed a potential crash case (Sentry)
- (@GermanBluefox) Added support for Admin3
- (Apollon77) Add Sentry for js-controller 3.0
- (Apollon77) update dependencies
- (JayVee2) Sort the IP addresses
- (simatec) supported compact mode
- (vdemidov) refactored, added ping time and roundtrips per second for every host
- (ldittmar) object values are converted to the valid type
- (@GermanBluefox) allowed removing host name from state's name
- (@GermanBluefox) change configuration dialog
- (@GermanBluefox) catch error if no IP defined
- (@GermanBluefox) remove ms
- (@GermanBluefox) rewrite ping for windows
- (@GermanBluefox) support for freebsd and all windows languages
- (@GermanBluefox) add tests
- (@GermanBluefox) Fixed the error if the configuration changed
- (@GermanBluefox) Fixed the configuration page
- (@GermanBluefox) Enabled npm install
- (@GermanBluefox) Used ping npm module instead of static one
- (@GermanBluefox) Made possible to have shorter ping intervals (down to 5 seconds)
- (@GermanBluefox) fix ping node
- (@GermanBluefox) fix ping node (do not forget to remove package from git when the npm gets the update)
- (@GermanBluefox) support of server (actually no authentication)
The MIT License (MIT)
Copyright (c) 2014-2024, @GermanBluefox dogafox@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.