LinuxCommandLibrary

grafana-cli

Manage Grafana plugins

TLDR

Install, update, or remove specific plugins

$ grafana-cli plugins [install|update|remove] [plugin_id1 plugin_id2 ...]
copy

List all installed plugins
$ grafana-cli plugins ls
copy

SYNOPSIS

grafana-cli [options]

PARAMETERS

plugins
    Lists all installed plugins.

plugins install
    Installs a plugin with the given ID.

plugins update
    Updates a plugin with the given ID to the latest version.

plugins update-all
    Updates all installed plugins to the latest version.

plugins uninstall
    Uninstalls a plugin with the given ID.

--pluginUrl
    The URL to download the plugin from, used with the install command.

--repo
    The plugin repository to use (default: 'grafana').

--pluginsDir
    The directory to install plugins into (default: your grafana plugins dir).

--insecure
    Skip TLS verification (insecure).

admin-password
    cli admin password, defaults to cli.adminPassword in grafana.ini.

admin-user
    cli admin user, defaults to cli.adminUser in grafana.ini.

help
    Shows help for the command.

version
    Shows the version of the `grafana-cli`.

DESCRIPTION

The `grafana-cli` command is a tool for managing Grafana plugins, providing functionalities to install, update, list, and remove them. It is essential for extending Grafana's capabilities by integrating various data sources, panels, and apps available as plugins. With `grafana-cli`, administrators can easily manage plugin installations and ensure a smooth Grafana environment. It simplifies the plugin management process allowing automation through scripting. Moreover, `grafana-cli` manages configurations related to plugins. Proper configuration is vital to ensure plugins function correctly. The tool is often used as part of automated deployment and update workflows. It allows administrators to scale plugin changes and rollouts across large deployments.

CAVEATS

Incorrect usage or insufficient permissions may lead to plugin installation failures. Some plugins may require specific Grafana versions or configurations to function correctly. Always back up your Grafana instance before making significant changes.

CONFIGURATION

grafana-cli reads configurations from grafana.ini, typically located in the Grafana installation directory. Settings such as the plugin directory and Grafana's admin credentials can be configured here. Ensure that the [plugins] section is configured correctly to avoid issues during plugin installation or updates. Also pay attention to [cli] section

TROUBLESHOOTING

Common issues include permission errors, network connectivity problems, and plugin compatibility issues. Ensure that the Grafana server has the necessary permissions to access the plugin directory. Check network connectivity to the plugin repository. If a plugin fails to install or function correctly, consult the plugin's documentation or Grafana's logs for more information.

HISTORY

The `grafana-cli` was developed to simplify plugin management in Grafana.

Prior to its existence, installing and managing plugins required manual downloading, file placement, and configuration adjustments. The CLI tool automated these processes, making plugin management more accessible and efficient.

Over time, the `grafana-cli` has evolved to include features such as updating plugins, managing repository settings, and providing better error handling. The development is aligned with Grafana's growth and the increasing importance of plugins within the Grafana ecosystem.

SEE ALSO

grafana-server(1)

Copied to clipboard