---
name: "cdist-type__consul_watch_service"
section: "7"
platform: "linux"
package: "cdist"
version: "7.0.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cdist-type__consul_watch_service"
---

# cdist-type\_\_consul\_watch\_service(7)

Manages consul service watches

## NAME

cdist-type\_\_consul\_watch\_service - Manages consul service watches

## DESCRIPTION

Generate and deploy watch definitions of type 'service' for a consul agent. See *http://www.consul.io/docs/agent/watches.html* for parameter documentation.

## REQUIRED PARAMETERS

- **handler**

  the handler to invoke when the data view updates

- **service**

  the service to watch for changes

## OPTIONAL PARAMETERS

- **datacenter**

  can be provided to override the agent's default datacenter

- **state**

  if this watch is 'present' or 'absent'. Defaults to 'present'.

- **token**

  can be provided to override the agent's default ACL token

- **tag**

  filter by tag

## BOOLEAN PARAMETERS

- **passingonly**

  specifies if only hosts passing all checks are displayed

## EXAMPLES

```
__consul_watch_service some-id \
   --service consul \
   --handler /usr/bin/my-handler.sh
__consul_watch_service some-id \
   --service redis \
   --tag production \
   --handler /usr/bin/my-handler.sh
__consul_watch_service some-id \
   --service redis \
   --tag production \
   --passingonly \
   --handler /usr/bin/my-handler.sh
```

## SEE ALSO

[**cdist-type\_\_consul\_agent**(7)](/cdist-type__consul_agent/7.md)

consul documentation at: \<*http://www.consul.io/docs/agent/watches.html*\>.

## AUTHORS

Steven Armstrong \<*steven-cdist--@--armstrong.cc*\>

## COPYING

Copyright (C) 2015 Steven Armstrong. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

## COPYRIGHT

ungleich GmbH 2021
