{"id":16787133,"url":"https://github.com/yaacov/hawkular-client-cli","last_synced_at":"2025-08-01T12:06:41.526Z","repository":{"id":57436880,"uuid":"72991975","full_name":"yaacov/hawkular-client-cli","owner":"yaacov","description":"Hawkular client command line","archived":false,"fork":false,"pushed_at":"2017-04-13T06:20:58.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T10:52:14.494Z","etag":null,"topics":["cli","command-line-tool","hawkular","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaacov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-06T13:20:27.000Z","updated_at":"2017-03-14T08:47:58.000Z","dependencies_parsed_at":"2022-09-09T23:24:44.488Z","dependency_job_id":null,"html_url":"https://github.com/yaacov/hawkular-client-cli","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaacov%2Fhawkular-client-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaacov%2Fhawkular-client-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaacov%2Fhawkular-client-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaacov%2Fhawkular-client-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaacov","download_url":"https://codeload.github.com/yaacov/hawkular-client-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950792,"owners_count":20373664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line-tool","hawkular","python"],"created_at":"2024-10-13T08:14:18.516Z","updated_at":"2025-03-16T23:41:10.369Z","avatar_url":"https://github.com/yaacov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hawkular-client-cli\n\nThis repository includes a Python client script to access Hawkular metrics remotely.\n\n## Introduction\n\nUtility script for accessing Hawkular metrics server remotely, the script can query\na list of metric definitions and tags, update metrics tags, read and write metric data.\nThe script is using the python [hawkular-client](https://github.com/hawkular/hawkular-client-python) module.\n\n## License and copyright\n\n```\n   Copyright 2016 Red Hat, Inc. and/or its affiliates\n   and other contributors.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n```\n\n## Installation\n\nTo install, run ``python setup.py install`` if you installed from source code, or ``pip install hawkular-client-cli`` if using pip.\n\n### Copr repository\n\nPackages can be downloaded using Fedora Copr:\n\n```bash\ndnf copr enable @Hawkular/python-hawkular-client \ndnf copr enable yaacov/hawkular-cli \n\ndnf install hawkular-client-cli\n```\n\n## Usage\n\nThe `-h` flag will print out a help text, that list the command line arguments.\n\n```bash\nhawkular-cli -h\n\nusage: hawkular-cli [-h] [-U URL] [-i] [-t TENANT] [-c [CONFIG_FILE]]\n                           [-p [PASSWORD]] [-T [TOKEN]] [-u [USERNAME]]\n                           [-a [TAG=VALUE [TAG=VALUE ...]]]\n                           [-k [KEY [KEY ...]]] [-l] [-r]\n                           [-m {gauge,counter,string,availability}]\n                           [-s [START]] [-e [END]] [-b [BUCKETDURATION]]\n                           [--limit [LIMIT]] [-V] [--status] [--triggers] [-N]\n                           [-v]\n                           [KEY=VALUE [KEY=VALUE ...]]\n\nRead/Write data to and from a Hawkular metric server.\n\npositional arguments:\n  KEY=VALUE             key value pairs to send\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -U URL, --url URL     Hawkualr server url\n  -i, --insecure        allow insecure ssl connection\n  -t TENANT, --tenant TENANT\n                        Hawkualr tenenat name\n  -c [CONFIG_FILE], --config [CONFIG_FILE]\n                        Configurations file path\n  -p [PASSWORD], --password [PASSWORD]\n                        Hawkualr server password\n  -T [TOKEN], --token [TOKEN]\n                        Hawkualr server token\n  -u [USERNAME], --username [USERNAME]\n                        Hawkualr server username\n  -a [TAG=VALUE [TAG=VALUE ...]], --tags [TAG=VALUE [TAG=VALUE ...]]\n                        a list of tags [ when used with a list of keys, will\n                        update tags for this keys ]\n  -k [KEY [KEY ...]], --keys [KEY [KEY ...]]\n                        a list of keys [ when used with a list of tags, will\n                        update tags for this keys ]\n  -l, --list            list all registered keys, can be used with --tags\n                        argument for filtering\n  -r, --read            read data for keys or tag list [requires the --keys or\n                        --tags arguments]\n  -m {gauge,counter,string,availability}, --metric {gauge,counter,string,availability}\n                        use specific metrics type [gauge, counter, string,\n                        availability]\n  -s [START], --start [START]\n                        the start date for metrics reading\n  -e [END], --end [END]\n                        the end date for metrics reading\n  -b [BUCKETDURATION], --bucketDuration [BUCKETDURATION]\n                        the metrics atatistics reading bucket duration in\n                        secondes\n  --limit [LIMIT]       limit for metrics reading\n  -V, --verbose         be more verbose\n  --status              query hawkular status\n  --triggers            query hawkular alert triggers\n  -N, --no-autotags     do not update tags using the config file\n  -v, --version         print version\n\n```\n### Querying metric definitions [ --list ]\nMetric definitions list can also be filtered using tags.\n\n```bash\nhawkular-cli --list\nhawkular-cli --list --tags issue=42\n```\n\n### Querying alert triggers [ --triggers ]\nDisplay alert triggers list (Requires hawkular-client-python \u003e= 0.4.5).\n\n```bash\nhawkular-cli --triggers\n```\n\n### Querying metric data [ --read [--keys KEY] [--tags TAG=VALUE] ]\nQuery for metrics data can be done using a list of keys [ using the -keys argument ]\nor using a list of tag,value pairs [ using the --tags argument ]\n\n```bash\nhawkular-cli --read --keys machine/example.com/memory.usage\nhawkular-cli --read --tags issue=42\n```\n\n### Pushing new values [ KEY=VALUE ]\nWhen pushing new data, we also update the tag values of the keys we push data to,\nIf not explicit tags are defined ( e.g. using the --tags argument ) tags are set using\nrules in the config file.\n\n```bash\nhawkular-cli machine/example.com/memory.usage=300\n```\n\n### Modifying metric definition tags [ --keys KEY --tags TAG=VALUE ]\nIf a key match an auto-tagging rule from a config file, the tag value defined\nin the config file will be updated. Explicit tag values defined using the command line\nargument [ --tags ] will override tag values defined by rules in the config file.\n\n```bash\nhawkular-cli --keys machine/example.com/memory.usage --tags units=bytes\n```\n\n### Config file\nIf present, a yaml config file, can be used to store credentials information, and\ntagging rules. Command line arguments will override credentials and tags defined in\nthe config file.\n\nDefault path for the config file is `/etc/hawkular-client-cli/conifg.yaml`\n\nThe hawkuklar part of the yaml file can store information about the hawklar server,\nfor example, username and password.\n\nThe auto-tagging rules match the rules regex with pre-defined tags, for example, the rules\nin this example will add the tag `units` with value `bytes` to any key that match the regex pattern `.*memory.*`.\n\n#### Using key and password\n```yaml\nhawkular:\n  url: https://hawkular-metrics.com:443\n  username: hawkular\n  password: secret\n  tenant: _ops\nrules:\n  - regex: .*memory.*\n    tags:\n      units: byte\n  - regex: .*cpu.*\n    tags:\n      units: cpu\n```\n\n#### using a token\n```yaml\nhawkular:\n  url: https://hawkular-metrics.com:443\n  token: secret\n  tenant: _ops\n  insecure: False\nrules:\n  - regex: .*\n    tags:\n      type: node\n      hostname: example.com\n```\n\n### Environment variables\nIf present, environment variables, can be used to store credentials information. Command line arguments and config file settings, will override credentials defined in environment variables.\n\n```bash\n# supported vars\n# HAWKULAR_URL, HAWKULAR_TENANT, HAWKULAR_TOKEN, HAWKULAR_USERNAME and HAWKULAR_PASSWORD\n\nexport HAWKULAR_URL=https://example.com:8443\nexport HAWKULAR_TENANT=_system\nexport HAWKULAR_TOKEN=some.secret\nhawkular-client-cli -l\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaacov%2Fhawkular-client-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaacov%2Fhawkular-client-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaacov%2Fhawkular-client-cli/lists"}