GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CSV output not implemented · Issue #305 · unioslo/zabbix-cli

CSV output not implemented #305

New issue
Copy link
New issue
Copy link
Open
Open
CSV output not implemented#305
Copy link

Description

@mcbrineellis
mcbrineellis
opened on May 8, 2025
Issue body actions

I tried to use the csv output option which is listed in the documentation: https://unioslo.github.io/zabbix-cli/guide/configuration/#appoutput which returned the error ValueError: Unknown output format <OutputFormat.CSV: 'csv'>.

It seems that this has not yet been implemented, as it is listed as TODO in render.py:

zabbix-cli/zabbix_cli/output/render.py

Line 71 in 89a4eac

# TODO: implement CSV

Activity

  1. mcbrineellis commented on May 8, 2025

    @mcbrineellis
    mcbrineellis
    on May 8, 2025
    Author
    More actions

    I came up with a workaround for this using jq with the show_hosts command to generate a CSV of hosts from Zabbix.

    First set format = "json" under [app.output] in zabbix-cli.toml:

    [app.output]
    format = "json"
    color = true   
    paging = false 
    
    zabbix-cli show_hosts | jq -r \
      '(["hostid", "host", "groups", "templates", "zabbix_agent", "maintenance_status", "status", "proxy_name"] | @csv),
      ( .result[] | [.hostid, .host, (.groups | map(.name) | join("; ")), (.templates | map(.name) | join("; ")), .zabbix_agent, .maintenance_status, .status, (.proxy.name // "")] | @csv)' \
    >> output.csv
    
  2. mcbrineellis commented on May 9, 2025

    @mcbrineellis
    mcbrineellis
    on May 9, 2025
    Author
    More actions

    Here's the same thing but for alarms:

    zabbix-cli show_alarms | jq -r \
          '(["triggerid", "host", "description", "severity", "lastchange", "age"] | @csv),
          ( .result[] | [.triggerid, .hostname, .description, .severity, .lastchange, .age] | @csv)' \
        >> output.csv
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.