6. sensu

Konfigurujeme v /etc/smartops/sensu.yml. Toto je příklad konfiguračního souboru:

backend_url: http://127.0.0.1:8080
api_key: 12345678-1234-123-123-123456789012

6.1. sensu_process.py

Spuštění procesu a jeho zareportování do testing namespace v sensu.

# help
usage: sensu_process.py [-h] [--cwd CWD] script header server

Process reporting tool into sensu

positional arguments:
  script      Bash call to execute
  header      Name of check
  server      Server name

optional arguments:
  -h, --help  show this help message and exit
  --cwd CWD   Directory to execute in




# pytest v ops
./sensu_process.py '/root/ops/venv/bin/pytest -v -m "not integration"' 'ops unittest' 'slot1'

# pytest v saltstack-main
./sensu_process.py 'python3 -m pytest -v -s' 'saltstack-main test' 'slot1' --cwd /srv/salt

Výsledek najdete tady: https://sensu.smartops.cloud/c/~/n/testing/events