94e79becd8
- Agent sends group name (defaults to hostname) and richer metric notes (memory/disk include absolute GB values; CPU note includes system uptime) - push() accepts group param; server stores it as agent_group on deployments - Upsert key is now (company_id, agent_group, name) so two agents on the same company but different servers don't overwrite each other's CPU/Memory - Add widget config packs: linux-base, web-nginx, database-postgres/redis, docker-host, custom-cmd examples
22 lines
646 B
YAML
22 lines
646 B
YAML
# PostgreSQL — process check + port + optional replication lag custom check.
|
|
|
|
widgets:
|
|
- type: process_check
|
|
name: PostgreSQL
|
|
process: postgres
|
|
|
|
- type: port_check
|
|
name: PG Port
|
|
host: localhost
|
|
port: 5432
|
|
timeout: 5
|
|
|
|
# Optional: check replication lag (requires psql access).
|
|
# Exit 0 = ok, exit 1 = lag > threshold, exit 2 = cannot connect.
|
|
# - type: custom_cmd
|
|
# name: PG Replication lag
|
|
# cmd: |
|
|
# LAG=$(psql -U postgres -tAc "SELECT EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))::int" 2>/dev/null)
|
|
# [ -z "$LAG" ] && exit 2
|
|
# [ "$LAG" -gt 300 ] && exit 1 || exit 0
|