README.md 2.5 KB
Newer Older
Spencer Krum's avatar
Spencer Krum committed
1
# puppet-healthcheck
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

## Types

### tcp_conn_validator

`tcp_conn_validator` is used to verify that a service is listening on a given port.
It could be used to test either a remote or a local service. It support both IPv4 and
IPv6 connection strings. It also works with hostname.

```puppet
tcp_conn_validator { 'foo-machine ssh service' :
  host => '192.168.0.42',
  port   => 22,
}
```

The namevar of this resource can also be the connection string. It comes handy when
one already have an array of ip:port or hostname:port string to test.

```puppet
mongodb_cluster_nodes = ['192.168.0.2:27017', 'node02.foo.bar.com:27017']
tcp_conn_validator { $mongodb_cluster_nodes : }
```

Dean Wilson's avatar
Dean Wilson committed
26
#### `host`
27 28 29

IP address or server DNS name on which the service is supposed to be bound to. Required if the namevar is not a connection string.

Dean Wilson's avatar
Dean Wilson committed
30
#### `port`
31 32 33

Port on which the service is supposed to listen. Required if the namevar is not a connection string.

Dean Wilson's avatar
Dean Wilson committed
34
#### `try_sleep`
35 36 37

The time to sleep in seconds between ‘tries’. Default: 1

Dean Wilson's avatar
Dean Wilson committed
38
#### `timeout`
39 40

Number of seconds to wait before timing out. Default: 60
41 42 43 44 45 46 47 48 49

### http_conn_validator

`http_conn_validator` is used to verify that an http server is answering on a given port.
It could be used to test either a remote or a local service. It support both IPv4 and
IPv6 connection strings. It also works with hostname.

```puppet
http_conn_validator { 'foo-machine home' :
duritong's avatar
duritong committed
50
  host    => '127.0.0.1',
51 52 53 54 55 56 57 58 59 60 61 62 63
  port    => 80,
  use_ssl => true,
}
```

The namevar of this resource can also be the connection string. It comes handy when
one already have an array of URLs string to test.

```puppet
appli_cluster_nodes = ['https://server1.com/test-url', 'https://server2.com/test-url']
http_conn_validator { $appli_cluster_nodes : }
```

Dean Wilson's avatar
Dean Wilson committed
64
#### `host`
65 66 67

IP address or server DNS name on which the service is supposed to be bound to. Required if the namevar is not a connection string.

Dean Wilson's avatar
Dean Wilson committed
68
#### `port`
69 70 71

Port on which the service is supposed to listen. Required if the namevar is not a connection string.

Dean Wilson's avatar
Dean Wilson committed
72
#### `use_ssl`
73 74 75

Whether the connection will be attempted using https. Default: false

Dean Wilson's avatar
Dean Wilson committed
76
#### `test_url`
77 78 79

URL to use for testing if the HTTP server is up. Default: /

Dean Wilson's avatar
Dean Wilson committed
80
#### `try_sleep`
81 82 83

The time to sleep in seconds between ‘tries’. Default: 1

Dean Wilson's avatar
Dean Wilson committed
84
#### `timeout`
85 86 87

Number of seconds to wait before timing out. Default: 60

Dean Wilson's avatar
Dean Wilson committed
88
#### `expected_code`
89 90 91

Expected HTTP result code to consider success. Default: 200

Dean Wilson's avatar
Dean Wilson committed
92
#### `verify_peer`
duritong's avatar
duritong committed
93 94 95

Whether to verify the peer credentials, if possible. Verification will not take place if the CA certificate is missing