Update readme.
This commit is contained in:
parent
023f5749b0
commit
0f47a79ac7
|
|
@ -13,7 +13,7 @@ unifi-poller(1) -- Utility to poll UniFi Controller Metrics and store them in In
|
|||
|
||||
## OPTIONS
|
||||
|
||||
`unifi-poller [-c <config-file>] [-h] [-v]`
|
||||
`unifi-poller [-c <config-file>] [-j <filter>] [-h] [-v]`
|
||||
|
||||
-c, --config <config-file>
|
||||
Provide a configuration file (instead of the default).
|
||||
|
|
@ -21,6 +21,17 @@ unifi-poller(1) -- Utility to poll UniFi Controller Metrics and store them in In
|
|||
-v, --version
|
||||
Display version and exit.
|
||||
|
||||
-j, --dumpjson <filter>
|
||||
This is a debug option; use this when you are missing data in your graphs,
|
||||
and/or you want to inspect the raw data coming from the controller. The
|
||||
filter only accept two options: devices or clients. This will print a lot
|
||||
of information. Recommend piping it into a file and/or into jq for better
|
||||
visualization. This requires a working config file that; one that contains
|
||||
working authentication details for a Unifi Controller. This only dumps
|
||||
data for sites listed in the config file. The application exits after
|
||||
printing the JSON payload; it does not daemonize or report to InfluxDB
|
||||
with this option.
|
||||
|
||||
-h, --help
|
||||
Display usage and exit.
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ func (c *Config) DumpJSON(filter string) error {
|
|||
return err
|
||||
}
|
||||
controller.ErrorLog = func(m string, v ...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, m, v...)
|
||||
fmt.Fprintf(os.Stderr, "[ERROR] "+m, v...)
|
||||
} // Log all errors to stderr.
|
||||
|
||||
switch sites, err := filterSites(controller, c.Sites); {
|
||||
|
|
@ -36,10 +36,6 @@ func (c *Config) DumpJSON(filter string) error {
|
|||
}
|
||||
}
|
||||
|
||||
func errorLog(m string, v ...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, m, v...)
|
||||
}
|
||||
|
||||
// DumpClientsJSON prints the raw json for clients in a Unifi Controller.
|
||||
func (c *Config) DumpClientsJSON(sites []unifi.Site, controller *unifi.Unifi) error {
|
||||
for _, s := range sites {
|
||||
|
|
|
|||
Loading…
Reference in New Issue