diff --git a/examples/MANUAL.md b/examples/MANUAL.md index 5e7c6a57..d65445c5 100644 --- a/examples/MANUAL.md +++ b/examples/MANUAL.md @@ -50,7 +50,10 @@ OPTIONS CONFIGURATION --- -* Config File Default Location: `/etc/unifi-poller/up.conf` +* Config File Default Location: + * Linux: `/etc/unifi-poller/up.conf` + * macOS: `/usr/local/etc/unifi-poller/up.conf` + * Windows: `C:\ProgramData\unifi-poller\up.conf` * Config File Default Format: `TOML` * Possible formats: `XML`, `JSON`, `TOML`, `YAML` diff --git a/examples/README.md b/examples/README.md index 4f067db3..fdefd7d2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,9 +1,13 @@ -# Grafana Dashboards & Examples +# Examples +This folder contains example configuration files in four +supported formats. You can use any format you want for +the config file, just give it the appropriate suffix for +the format. An XML file should end with `.xml`, a JSON +file with `.json`, and YAML with `.yaml`. The default +format is always TOML and may have any _other_ suffix. + +#### Dashboards This folder used to contain Grafana Dashboards. - -**They are now located at [Grafana.com](https://grafana.com/dashboards?search=unifi-poller).** More info is available on The [Grafana Dashboards Wiki Page](https://github.com/davidnewhall/unifi-poller/wiki/Grafana-Dashboards). - -This folder contains example configuration files in four supported formats. -You can use any format you want for the config file, just give it the appropriate suffix for the format. -ie. an xml file should end with `.xml`. +**They are now located at [Grafana.com](https://grafana.com/dashboards?search=unifi-poller).** +Also see [Grafana Dashboards](https://github.com/davidnewhall/unifi-poller/wiki/Grafana-Dashboards) Wiki. diff --git a/unifipoller/config.go b/unifipoller/config.go index a1f0a52f..eedc5d6a 100644 --- a/unifipoller/config.go +++ b/unifipoller/config.go @@ -13,7 +13,6 @@ var Version = "development" const ( // App defaults in case they're missing from the config. - defaultConfFile = "/etc/unifi-poller/up.conf" defaultInterval = 30 * time.Second defaultInfxDb = "unifi" defaultInfxUser = "unifi" @@ -26,6 +25,7 @@ const ( // Asset is used to give all devices and clients a common interface. type Asset interface { Points() ([]*influx.Point, error) + PointsAt(time.Time) ([]*influx.Point, error) } // UnifiPoller contains the application startup data, and auth info for UniFi & Influx. diff --git a/unifipoller/start.go b/unifipoller/start.go index 9b743302..5d762767 100644 --- a/unifipoller/start.go +++ b/unifipoller/start.go @@ -42,7 +42,7 @@ func (u *UnifiPoller) ParseFlags(args []string) { } u.Flag.StringVarP(&u.DumpJSON, "dumpjson", "j", "", "This debug option prints a json payload and exits. See man page for more.") - u.Flag.StringVarP(&u.ConfigFile, "config", "c", defaultConfFile, "Poller Config File (TOML Format)") + u.Flag.StringVarP(&u.ConfigFile, "config", "c", DefaultConfFile, "Poller Config File (TOML Format)") u.Flag.BoolVarP(&u.ShowVer, "version", "v", false, "Print the version and exit") _ = u.Flag.Parse(args) }