
Add support for connecting the exporter directly to the fail2ban server's socket to send requests and receive data. The path to the socket file is optional and specified on startup. Export a new metric based on the response of the `ping` command sent to the fail2ban server. The metric is set to 1 if the server responds with `pong` and 0 in any other case. This metric is only shown if the path to the socket file was provided on startup.
9 lines
254 B
Go
9 lines
254 B
Go
package socket
|
|
|
|
// Py_builtins_str is used by the pickle decoder to parse the server response into a format Go can understand
|
|
type Py_builtins_str struct{}
|
|
|
|
func (c Py_builtins_str) Call(args ...interface{}) (interface{}, error) {
|
|
return args[0], nil
|
|
}
|