Skip to content

File

The file health check can verify that either a file exists or doesn't exist.

Configuration Keys

The following configuration options apply to the file health check method:

Key Type Default
path String undef
exists Bool True

Path

The path to the file to test for.

Exists

If exists is set to True (the default), the file path must exist for the health check to return success. If set to False, the file path must not exist for the health check to return success.

Examples

These are some configuration examples for the file health check:

To verify that a file exists:

---

# The list of health checks
checks:

  - name: Example file exists check
    description: Verify that the file path "/var/run/exists" exists
    args:
      method: file
      path: /var/run/exists
    prefixes:
      - 192.0.2.255
    nexthop: self

To verify that a file does not exist:

---

# The list of health checks
checks:

  - name: Example file does not exist check
    description: Verify that the file path "/var/run/not-existing" does not exist
    args:
      method: file
      path: /var/run/not-existing
      exists: false
    prefixes:
      - 2001:db8::/64
    nexthop: self