chotko

module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: MIT

README

Chotko

Release Build Status Codecov Go Report Card License

A terminal UI for Zabbix 7.x built with Go and BubbleTea.

The name comes from the Russian slang word "чётко" (chotko), meaning "precise" or "on point" - fitting for a monitoring tool.

Features

  • View active Zabbix alerts with severity-based color coding
  • Acknowledge problems directly from the terminal
  • Host status overview (OK, Problem, Unknown, Maintenance)
  • Edit host triggers (enable/disable) and macros directly from TUI
  • Events history view with problem/recovery tracking
  • Graphs tab with time series charts for numeric metrics
  • Multiple built-in themes (Nord, Dracula, Gruvbox, Catppuccin, Tokyo Night, Solarized)
  • Custom theme support via YAML
  • Vim-style keyboard navigation
  • Mouse support (click tabs, select items, scroll wheel)
  • Filter alerts by severity or text
  • Auto-refresh with configurable interval

Installation

go install github.com/harpchad/chotko/cmd/chotko@latest

Or build from source:

git clone https://github.com/harpchad/chotko.git
cd chotko
go build -o chotko ./cmd/chotko

Usage

# Run with interactive setup wizard (first run)
chotko

# Connect with API token (recommended)
chotko -s https://zabbix.example.com -t YOUR_API_TOKEN

# Connect with username/password
chotko -s https://zabbix.example.com -u Admin -p password

# Use a specific theme
chotko --theme dracula

# Show only high severity alerts
chotko --min-severity 4

Configuration

For security, credentials should be provided via environment variables rather than CLI flags or config files:

Variable Description
CHOTKO_SERVER Zabbix server URL
CHOTKO_TOKEN API token (recommended for Zabbix 5.4+)
CHOTKO_PASSWORD Password (if using user/password auth)
# Recommended: Use environment variables
export CHOTKO_TOKEN=your-api-token
chotko -s https://zabbix.example.com

# Or inline for one-time use
CHOTKO_TOKEN=your-api-token chotko -s https://zabbix.example.com

Security note: Avoid using -p/--password flags as they are visible in process listings (ps). Use CHOTKO_PASSWORD environment variable instead.

Config File

Configuration is stored in ~/.config/chotko/config.yaml:

server:
  url: "https://zabbix.example.com"

auth:
  # API Token (recommended for Zabbix 5.4+)
  token: "your-api-token-here"
  # Or use username/password
  # username: "Admin"
  # password: "zabbix"

display:
  refresh_interval: 30  # seconds
  min_severity: 0       # 0=all, 1-5=filter
  theme: "nord"
  window_title: true    # show alert counts in terminal title
  emoji_title: true     # use emoji in title (disable for basic terminals)
  title_min_severity: 0 # minimum severity to show in title

graphs:
  categories:           # item categories for Graphs tab
    - "CPU"
    - "Memory"
    - "Disk"
    - "Network"
  history_hours: 24     # hours of history to fetch
  max_items_per_host: 50 # limit items fetched per host

Precedence: CLI flags > Environment variables > Config file

TLS Configuration

For servers with self-signed or internal CA certificates:

server:
  url: "https://zabbix.example.com"
  insecure_skip_verify: true  # Skip TLS certificate verification

Warning: Only use insecure_skip_verify: true for testing or when connecting to servers with self-signed certificates in trusted networks. This disables certificate validation and makes the connection vulnerable to man-in-the-middle attacks. For production use, configure proper CA certificates instead.

Rate Limiting

To prevent overwhelming the Zabbix server with API requests:

server:
  url: "https://zabbix.example.com"
  rate_limit: 10  # Max API requests per second (optional, default: unlimited)

Recommended values are 10-20 requests per second for most Zabbix servers. Set to 0 or omit for no rate limiting.

Key Bindings

Key Action
j / Move down
k / Move up
PgDn / Ctrl+D Page down
PgUp / Ctrl+U Page up
g / Home Go to top
G / End Go to bottom
] / L Next tab
[ / H Previous tab
F1-F4 Jump to tab
Tab Next pane
Shift+Tab Previous pane
a Acknowledge selected alert
A Acknowledge with message
c Close alert (if trigger allows manual close)
i Ignore selected alert locally
I List all ignored alerts
t Edit triggers for selected host
m Edit macros for selected host
e Toggle host monitoring (Hosts tab)
r Refresh data
/ Filter mode
0-5 Filter by minimum severity
Ctrl+L Clear filter
: Command mode
? Show help
q Quit
Graphs Tab
Key Action
Enter / Space Toggle expand/collapse
E Expand all nodes
C Collapse all nodes
Trigger Editor
Key Action
Space Toggle enable/disable
Esc Close editor
Macro Editor
Key Action
e / Enter Edit macro value
d Delete macro
Esc Close editor

Mouse Support

  • Click tabs to switch between tabs
  • Click list items to select them
  • Click tree nodes to select and expand/collapse (Graphs tab)
  • Click panes to change focus
  • Scroll wheel scrolls the pane under the mouse cursor

Themes

Built-in themes:

  • default - Classic Zabbix-inspired colors
  • nord - Arctic, cool-toned (default)
  • dracula - Dark purple/pink aesthetic
  • gruvbox - Retro warm tones
  • catppuccin - Soothing pastels
  • tokyonight - Cool blues and purples
  • solarized - Precision-balanced
  • high-contrast - WCAG AAA compliant for accessibility
Custom Themes

Create a custom theme in ~/.config/chotko/themes/mytheme.yaml:

name: "mytheme"
description: "My custom theme"

colors:
  disaster: "#FF0000"
  high: "#FF6600"
  average: "#FFAA00"
  warning: "#FFCC00"
  information: "#6699FF"
  not_classified: "#999999"
  ok: "#00CC00"
  unknown: "#AAAAAA"
  maintenance: "#AA66FF"
  primary: "#6699FF"
  secondary: "#00CC00"
  background: "#1a1a1a"
  foreground: "#EEEEEE"
  muted: "#666666"
  border: "#444444"
  focused_border: "#6699FF"
  highlight: "#333366"
  surface: "#2a2a2a"

Then use it with --theme mytheme or set in config.

Requirements

  • Zabbix 7.x (API compatibility)
  • Terminal with true color support recommended

License

MIT

Directories

Path Synopsis
cmd
chotko command
Package main is the entry point for the chotko Zabbix TUI application.
Package main is the entry point for the chotko Zabbix TUI application.
internal
app
Package app contains the main application logic and UI model.
Package app contains the main application logic and UI model.
components/alerts
Package alerts provides the alerts list component displaying Zabbix problems.
Package alerts provides the alerts list component displaying Zabbix problems.
components/command
Package command provides the command input component for the TUI.
Package command provides the command input component for the TUI.
components/detail
Package detail provides the detail pane component for displaying problem and host information.
Package detail provides the detail pane component for displaying problem and host information.
components/editor
Package editor provides modal editing components for hosts, triggers, and macros.
Package editor provides modal editing components for hosts, triggers, and macros.
components/events
Package events provides the events list component displaying Zabbix event history.
Package events provides the events list component displaying Zabbix event history.
components/graphs
Package graphs provides the graphs tree component for displaying Zabbix items.
Package graphs provides the graphs tree component for displaying Zabbix items.
components/hosts
Package hosts provides the hosts list component displaying Zabbix hosts.
Package hosts provides the hosts list component displaying Zabbix hosts.
components/listview
Package listview provides shared list navigation and scrolling logic for list-based UI components.
Package listview provides shared list navigation and scrolling logic for list-based UI components.
components/modal
Package modal provides modal dialog components for errors, help, and confirmations.
Package modal provides modal dialog components for errors, help, and confirmations.
components/statusbar
Package statusbar provides the status bar component showing host counts and connection status.
Package statusbar provides the status bar component showing host counts and connection status.
components/tabs
Package tabs provides a tab bar component for navigation.
Package tabs provides a tab bar component for navigation.
config
Package config handles application configuration loading and saving.
Package config handles application configuration loading and saving.
format
Package format provides shared formatting utilities for numeric values and strings.
Package format provides shared formatting utilities for numeric values and strings.
ignores
Package ignores manages locally ignored alert patterns.
Package ignores manages locally ignored alert patterns.
logging
Package logging provides structured logging for the chotko application.
Package logging provides structured logging for the chotko application.
theme
Package theme provides theming support with built-in and custom themes.
Package theme provides theming support with built-in and custom themes.
zabbix
Package zabbix provides a client for the Zabbix JSON-RPC API.
Package zabbix provides a client for the Zabbix JSON-RPC API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL