* feat(SSH): Add support for SSH endpoint
This commit adds support for SSH endpoint monitoring. Users can now configure an endpoint to be monitored using an SSH command by prefixing the endpoint's URL with ssh:\\. The configuration options for an SSH endpoint include the username, password, and command to be executed on the remote server. In addition, two placeholders are supported for SSH endpoints: [CONNECTED] and [STATUS].
This commit also updates the README to include instructions on how to configure SSH endpoints and the placeholders that can be used in their conditions. The README has been updated to include the new SSH-related options in the endpoints[] configuration object.
Here's a summary of the changes made in this commit:
Added support for SSH endpoint monitoring
Updated the documentation to include instructions on how to configure SSH endpoints and the placeholders that can be used in their conditions
* feat: support monitoring WebSocket endpoints
WebSocket endpoints are automatically identified by the URL protocol
specification: `wss://` or `ws://`. The request body is used as the
"message" written to the server, and the answer is stored in the
`[BODY]`.
Optionally, the user can set the `jsonrpc` flag to automatically wrap
the request body in a JSON RPC 2.0 method call.
* core:websocket: close connection after using it
* test: add tests related to WebSocket support
- test we can identify the endpoint type for WebSockets based on the URL
supplied: `wss://` (with SSL/TLS) and `ws://` (plain text).
- test we can generate a JsonRPC 2.0 message via the new endpoint flag
`JsonRPC`.
* core:endpoint: fix name of jsonrpc parameter
See https://en.wikipedia.org/wiki/JSON-RPC#Version_2.0
* core:websocket: fix dangling open connection on error
Move the `defer ws.Close()` to after opening the connection, so the
socket is closed also in case of errors.
* remove jsonrpc flag
* core:websocket: fix nil pointer dereference
The connection should only be closed if successfully opened.
* Move websocket function to client
* update go.mod
* Fix build errors
* Fix errors
* Update client/client.go
---------
Co-authored-by: TwiN <twin@linux.com>
* Basic setup to serve HTTPS
* Correctly handle the case of missing TLS configs
* Documenting TLS
* Refactor TLS configuration setup
* Add TLS Encryption section again to README
* Extending TOC in README
* Moving TLS settings to subsection of web settings
* Adding tests for config/web
* Add test for handling TLS
* Rename some variables as suggested
* Corrected error formatting
* Update test module import
* Polishing the readme file
* Error handling for TLSConfig()
---------
Co-authored-by: TwiN <twin@linux.com>
update go-ping to pro-ping maintained fork
additionally add a hint in the README for previliged mode
Co-authored-by: floj <floj@users.noreply.github.com>
Co-authored-by: TwiN <twin@linux.com>
* docs: Don't include Pushover in alerting provider examples
* fix(condition): Partially support numbers with floating point
Fixes#433
Does not add support for decimal numbers, but it converts float64 to int64.
The reason why I'm not just using float64 instead of int64 is because float64 does not support all the numbers that int64 supports, which means this would be a breaking change. Instead, this change at least supports the non-decimal part of floating point numbers.
This is an improvement over the current implementation, as right now, numbers with decimals are just converted to 0 when compared using a non-equal operator
* Add a new Pushover provider (#129)
- Adds new provider named Pushover with corresponding tests
- Adds Pushover as a provider to the configuration and adjusts test accordingly
- Adds Pushover to alerting_test.go, provider.go and type.go
- Updates the readme with configuration details
* Correct import order
* Fix some missing pushover references
* Apply suggestions from code review
* Rename application-key to application-token for Pushover
---------
Co-authored-by: TwiN <twin@linux.com>