CLI for Prometheus API
go get -d github.com/rejohnst/promclient/cmd
go build -o $GOPATH/bin/promclient github.com/rejohnst/promclient/cmd
promurl -version
promurl -promurl=<arg>|-promip=<arg> -command=runtime [-timeout=<# secs>] \
[-insecure]
promurl -promurl=<arg>|-promip=<arg> -command=targets [-active|-down] \
[-verbose] [-timeout=<# secs>] [-insecure]
-active
only display active targets
-down
only display active targets that are down (implies -active)
-job string
show only targets from specified job (implies -active)
promurl -promurl=<arg>|-promip=<arg> -command=alerts \
[-severity=<severity>] \
[-timeout=<# secs>] [-insecure]
-severity
filter results by specified severity
promurl -promurl=<arg>|-promip=<arg> -command=metrics [-job=<arg>] [-count] \
[-csv] [-timeout=<# secs>] [-insecure]
-csv
output metric metadata as CSV
-job string
show only metrics from specified job
promurl -promurl=<arg>|-promip=<arg> -command=rules [-rule=<arg>|-group=<arg>] \
[-timeout=<# secs>] [-insecure]
-rule
show detailed info for specified rule
-group
show only data for specified rule group
promurl -promurl=<arg>|-promip=<arg> -command=query -query=<arg> \
[-len=<arg>] [-step=<arg>] [-timed] [-timeout=<# secs>] [-insecure]
-len string
Length of query range
-query string
PromQL query string
-step string
Range resolution (default "1m")
-timed
Show query time
-command string
<alerts|metrics|query|rules|runtime|targets>
-count
only display a count of the requested items
-insecure
Skip certificate verification
-promip string
IP address of Prometheus server
-promurl string
URL of Prometheus server
-timeout int
Request timeout length in seconds (default 30)
-verbose
enable verbose mode
promclient -promurl=<Prometheus URL>|-promip=<Prometheus IP> -command=targets job=node-exporter -down
promclient -promurl=<Prometheus URL>|-promip=<Prometheus IP> -command=alerts -critical
promclient -promurl=<Prometheus URL>|-promip=<Prometheus IP> -command=metrics -job=kube-state-metrics -csv | sort -u