Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "0.2.0-dev" Commit = "none" BuildDate = "unknown" )
View Source
var RootCmd = &cobra.Command{ Use: "zbxctl", Short: "zbxctl - AI-Agent Friendly Zabbix 7 CLI", Long: `zbxctl is a high-performance command-line tool tailored for both human engineers and AI coding agents. It provides a Tier 1 ergonomic verb-noun interface for common operations and a Tier 2 raw JSON-RPC engine for 100% Zabbix 7 API coverage.`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { cfgPath, err := getConfigPath(cmd) if err != nil { return err } cfg, err = config.LoadConfig(cfgPath) if err != nil { return fmt.Errorf("failed to load config: %w", err) } if contextFlag != "" { cfg.ActiveContext = contextFlag } activeCtx, actCtxName, err = cfg.GetActiveContext() if err != nil { def := config.DefaultConfig() cfg = def activeCtx, actCtxName, _ = cfg.GetActiveContext() } if safetyFlag != "" { activeCtx.SafetyLevel = safetyFlag } if outputFlag != "" { activeCtx.OutputFormat = outputFlag } formatter = output.NewFormatter(activeCtx.OutputFormat) if cmd != nil && cmd.OutOrStdout() != nil { formatter.Writer = cmd.OutOrStdout() } zbxClient = zabbix.NewClient(activeCtx) return nil }, }
Functions ¶
func ResetCommandFlags ¶
Types ¶
type ClusterInfoReport ¶ added in v0.2.0
type ClusterInfoReport struct {
Context string `json:"context"`
ZabbixVersion string `json:"zabbix_version"`
SafetyLevel string `json:"safety_level"`
TotalHosts int `json:"total_hosts"`
TotalProblems int `json:"total_problems"`
TotalItems int `json:"total_items"`
TotalTriggers int `json:"total_triggers"`
TotalTemplates int `json:"total_templates"`
}
type CommandExport ¶
type CommandMeta ¶
type InventoryReport ¶
type InventoryReport = ClusterInfoReport
InventoryReport is an alias for backwards compatibility
type ManifestItem ¶
type ManifestItem struct {
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
Resource string `json:"resource,omitempty" yaml:"resource,omitempty"`
Method string `json:"method,omitempty" yaml:"method,omitempty"`
Params map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty"`
Spec map[string]interface{} `json:"spec,omitempty" yaml:"spec,omitempty"`
}
type VerbTree ¶
type VerbTree struct {
Verb string `json:"verb"`
Description string `json:"description"`
Resources []CommandMeta `json:"resources,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.