Add events

This commit is contained in:
davidnewhall2 2020-06-20 03:57:58 -07:00
parent 12900b3e71
commit 4a4160d10c
6 changed files with 77 additions and 43 deletions

View File

@ -30,8 +30,11 @@
# InfluxDB does not require auth by default, so the user/password are probably unimportant. # InfluxDB does not require auth by default, so the user/password are probably unimportant.
url = "http://127.0.0.1:8086" url = "http://127.0.0.1:8086"
user = "unifipoller" user = "unifipoller"
# Password for InfluxDB user (above).
# If the password provided here begins with file:// then the password is read in from
# the file path that follows the file:// prefix. ex: file:///etc/influxdb/passwd.file
pass = "unifipoller" pass = "unifipoller"
# Be sure to create this database. # Be sure to create this database. See the InfluxDB Wiki page for more info.
db = "unifi" db = "unifi"
# If your InfluxDB uses a valid SSL cert, set this to true. # If your InfluxDB uses a valid SSL cert, set this to true.
verify_ssl = false verify_ssl = false
@ -47,7 +50,7 @@
# configuring controllers in this config file. Instead you configure them in # configuring controllers in this config file. Instead you configure them in
# your prometheus.yml config. Prometheus then sends the controller URL to # your prometheus.yml config. Prometheus then sends the controller URL to
# unifi-poller when it performs the scrape. This is useful if you have many, # unifi-poller when it performs the scrape. This is useful if you have many,
# or changing controllers. Most people can leave this off. See wiki for more. # or changing controllers. See wiki for more.
dynamic = false dynamic = false
# The following section contains the default credentials/configuration for any # The following section contains the default credentials/configuration for any
@ -69,7 +72,7 @@
# The following is optional and used for configurations with multiple controllers. # The following is optional and used for configurations with multiple controllers.
# You may repeat the following section to poll multiple controllers. # You may repeat the following section to poll multiple controllers.
# Any ommitted variables will have their values taken from the defaults, above. # Any omitted variables will have their values taken from the defaults, above.
#[[unifi.controller]] #[[unifi.controller]]
# URL for the UniFi Controller. Do not add any paths after the host:port. # URL for the UniFi Controller. Do not add any paths after the host:port.
# Do not use port 8443 if you have a UDM. # Do not use port 8443 if you have a UDM.
@ -77,6 +80,10 @@
# Make a read-only user in the UniFi Admin Settings, allow it access to all sites. # Make a read-only user in the UniFi Admin Settings, allow it access to all sites.
#user = "unifipoller" #user = "unifipoller"
# Password for UniFi controller user (above).
# If the password provided here begins with file:// then the password is read in from
# the file path that follows the file:// prefix. ex: file:///etc/unifi/password.file
# ex: file:///etc/unifi/passwd.file
#pass = "unifipoller" #pass = "unifipoller"
# If the controller has more than one site, specify which sites to poll here. # If the controller has more than one site, specify which sites to poll here.
@ -84,8 +91,18 @@
# A setting of ["all"] will poll all sites; this works if you only have 1 site too. # A setting of ["all"] will poll all sites; this works if you only have 1 site too.
#sites = ["all"] #sites = ["all"]
# Enable collection of UniFi Events (InfluxDB only).
# This may store a lot of information. Only recommended for testing and debugging.
# There are no dashboards to display this data. It can be used for annotations.
# This is a new (July, 2020) feature. Please provide feedback if you try it out!
# Enable this only if using InfluxDB. This may leak PII data!
#save_events = false
# Enable collection of Intrusion Detection System Data (InfluxDB only). # Enable collection of Intrusion Detection System Data (InfluxDB only).
# Only useful if IDS or IPS are enabled on one of the sites. # Only useful if IDS or IPS are enabled on one of the sites. This may store
# a lot of information. Only recommended for testing and debugging. There
# may not be any dashboards to display this data. It can be used for annotations.
# Enable this only if using InfluxDB. This may leak PII data!
#save_ids = false #save_ids = false
# Enable collection of Deep Packet Inspection data. This data breaks down traffic # Enable collection of Deep Packet Inspection data. This data breaks down traffic

View File

@ -1,50 +1,52 @@
{ {
"poller": { "poller": {
"debug": false, "debug": false,
"quiet": false, "quiet": false,
"plugins": [] "plugins": []
}, },
"prometheus": { "prometheus": {
"disable": false, "disable": false,
"http_listen": "0.0.0.0:9130", "http_listen": "0.0.0.0:9130",
"report_errors": false "report_errors": false
}, },
"influxdb": { "influxdb": {
"disable": false, "disable": false,
"url": "http://127.0.0.1:8086", "url": "http://127.0.0.1:8086",
"user": "unifipoller", "user": "unifipoller",
"pass": "unifipoller", "pass": "unifipoller",
"db": "unifi", "db": "unifi",
"verify_ssl": false, "verify_ssl": false,
"interval": "30s" "interval": "30s"
}, },
"unifi": { "unifi": {
"dynamic": false, "dynamic": false,
"defaults": { "defaults": {
"user": "unifipoller", "user": "unifipoller",
"pass": "unifipoller", "pass": "unifipoller",
"url": "https://127.0.0.1:8443", "url": "https://127.0.0.1:8443",
"sites": ["all"], "sites": ["all"],
"save_ids": false, "save_events": false,
"save_dpi": false, "save_ids": false,
"save_sites": true, "save_dpi": false,
"hash_pii": false, "save_sites": true,
"verify_ssl": false "hash_pii": false,
"verify_ssl": false
}, },
"controllers": [ "controllers": [
{ {
"user": "unifipoller", "user": "unifipoller",
"pass": "unifipoller", "pass": "unifipoller",
"url": "https://127.0.0.1:8443", "url": "https://127.0.0.1:8443",
"sites": ["all"], "sites": ["all"],
"save_ids": false, "save_events": false,
"save_dpi": false, "save_ids": false,
"save_sites": true, "save_dpi": false,
"hash_pii": false, "save_sites": true,
"verify_ssl": false "hash_pii": false,
"verify_ssl": false
} }
] ]
} }

View File

@ -31,6 +31,7 @@ NOTE: <plugin> and <site> are lists of strings and may be repeated.
<user>unifipoller</user> <user>unifipoller</user>
<pass>unifipoller</pass> <pass>unifipoller</pass>
<url>https://127.0.0.1:8443</url> <url>https://127.0.0.1:8443</url>
<save_events>false</save_events>
<save_ids>false</save_ids> <save_ids>false</save_ids>
<save_dpi>false</save_dpi> <save_dpi>false</save_dpi>
<save_sites>true</save_sites> <save_sites>true</save_sites>
@ -44,6 +45,7 @@ NOTE: <plugin> and <site> are lists of strings and may be repeated.
<user>unifipoller</user> <user>unifipoller</user>
<pass>unifipoller</pass> <pass>unifipoller</pass>
<url>https://127.0.0.1:8443</url> <url>https://127.0.0.1:8443</url>
<save_events>false</save_events>
<save_ids>false</save_ids> <save_ids>false</save_ids>
<save_dpi>false</save_dpi> <save_dpi>false</save_dpi>
<save_sites>true</save_sites> <save_sites>true</save_sites>

View File

@ -32,11 +32,12 @@ unifi:
pass: "unifipoller" pass: "unifipoller"
sites: sites:
- all - all
save_ids: false save_events: false
save_dpi: false save_ids: false
save_sites: true save_dpi: false
hash_pii: false save_sites: true
verify_ssl: false hash_pii: false
verify_ssl: false
controllers: controllers:
@ -46,8 +47,9 @@ unifi:
pass: "unifipoller" pass: "unifipoller"
sites: sites:
- all - all
save_ids: false save_events: false
save_dpi: false save_ids: false
hash_pii: false save_dpi: false
save_sites: true save_sites: true
verify_ssl: false hash_pii: false
verify_ssl: false

10
go.mod
View File

@ -10,9 +10,9 @@ require (
github.com/prometheus/procfs v0.1.3 // indirect github.com/prometheus/procfs v0.1.3 // indirect
github.com/russross/blackfriday v2.0.0+incompatible // indirect github.com/russross/blackfriday v2.0.0+incompatible // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/unifi-poller/influxunifi v0.0.9 github.com/unifi-poller/influxunifi v0.0.10-0.20200620104500-bd1a036c5754
github.com/unifi-poller/inputunifi v0.0.7 github.com/unifi-poller/inputunifi v0.0.8-0.20200620104121-47689f50d8e3
github.com/unifi-poller/poller v0.0.7 github.com/unifi-poller/poller v0.0.8-0.20200619104117-a5e263a36ac9
github.com/unifi-poller/promunifi v0.0.8 github.com/unifi-poller/promunifi v0.0.9-0.20200620104707-26208eb4336b
github.com/unifi-poller/unifi v0.0.5 github.com/unifi-poller/unifi v0.0.5-0.20200620103801-b927287ea1cd
) )

11
go.sum
View File

@ -138,6 +138,8 @@ github.com/unifi-poller/influxunifi v0.0.9-0.20200614094130-d25a8fece6bc h1:IwCB
github.com/unifi-poller/influxunifi v0.0.9-0.20200614094130-d25a8fece6bc/go.mod h1:CfMvHVp3TPnp8flNvsiUSz09LWop1kmig/Sukg+hkAg= github.com/unifi-poller/influxunifi v0.0.9-0.20200614094130-d25a8fece6bc/go.mod h1:CfMvHVp3TPnp8flNvsiUSz09LWop1kmig/Sukg+hkAg=
github.com/unifi-poller/influxunifi v0.0.9 h1:ZDiDbFwoGfNWTXgVOUkkxTOUvkvS8RwweiDRhtntfCU= github.com/unifi-poller/influxunifi v0.0.9 h1:ZDiDbFwoGfNWTXgVOUkkxTOUvkvS8RwweiDRhtntfCU=
github.com/unifi-poller/influxunifi v0.0.9/go.mod h1:CfMvHVp3TPnp8flNvsiUSz09LWop1kmig/Sukg+hkAg= github.com/unifi-poller/influxunifi v0.0.9/go.mod h1:CfMvHVp3TPnp8flNvsiUSz09LWop1kmig/Sukg+hkAg=
github.com/unifi-poller/influxunifi v0.0.10-0.20200620104500-bd1a036c5754 h1:yp07xJG/OiYCl+2DtDEUghaYMBt1gxRgvjB4iE6v2Zg=
github.com/unifi-poller/influxunifi v0.0.10-0.20200620104500-bd1a036c5754/go.mod h1:8uchM41Th2buvjKYsD5Lu/9fu4d8qBqs4f+ETA8O5a4=
github.com/unifi-poller/inputunifi v0.0.5 h1:go+5j7WS1y0N/2pKKPvjzn8bkPpFXurQnoYGYajJD04= github.com/unifi-poller/inputunifi v0.0.5 h1:go+5j7WS1y0N/2pKKPvjzn8bkPpFXurQnoYGYajJD04=
github.com/unifi-poller/inputunifi v0.0.5/go.mod h1:X1Vd5uAtO5etZveY0WpMVMQBM/iLoMwZ/SvN1iXLxHo= github.com/unifi-poller/inputunifi v0.0.5/go.mod h1:X1Vd5uAtO5etZveY0WpMVMQBM/iLoMwZ/SvN1iXLxHo=
github.com/unifi-poller/inputunifi v0.0.6-0.20200203055955-411a49dea2e7 h1:CXMB+6tTJJZEoyMmH24PN/7evm3yuvily9Df4sujeT0= github.com/unifi-poller/inputunifi v0.0.6-0.20200203055955-411a49dea2e7 h1:CXMB+6tTJJZEoyMmH24PN/7evm3yuvily9Df4sujeT0=
@ -178,6 +180,8 @@ github.com/unifi-poller/inputunifi v0.0.7-0.20200615121955-129eacb5681d h1:qhrqV
github.com/unifi-poller/inputunifi v0.0.7-0.20200615121955-129eacb5681d/go.mod h1:sNdMyJPSSxm+IfM6H2g2ovWzn+fXOeIPhRGJbK35tOw= github.com/unifi-poller/inputunifi v0.0.7-0.20200615121955-129eacb5681d/go.mod h1:sNdMyJPSSxm+IfM6H2g2ovWzn+fXOeIPhRGJbK35tOw=
github.com/unifi-poller/inputunifi v0.0.7 h1:P5KJrvM9JPEzc1wRA9QYccFd7uipcbStbk7gIhFUrd8= github.com/unifi-poller/inputunifi v0.0.7 h1:P5KJrvM9JPEzc1wRA9QYccFd7uipcbStbk7gIhFUrd8=
github.com/unifi-poller/inputunifi v0.0.7/go.mod h1:sNdMyJPSSxm+IfM6H2g2ovWzn+fXOeIPhRGJbK35tOw= github.com/unifi-poller/inputunifi v0.0.7/go.mod h1:sNdMyJPSSxm+IfM6H2g2ovWzn+fXOeIPhRGJbK35tOw=
github.com/unifi-poller/inputunifi v0.0.8-0.20200620104121-47689f50d8e3 h1:4EMN1Bp4nxe1wq5QprApyxdORrM/BUn8bL694DEugTY=
github.com/unifi-poller/inputunifi v0.0.8-0.20200620104121-47689f50d8e3/go.mod h1:kmEi1hpjxDzizBeQ5c4gqrpZke8aHu64yfIK0O2T+bE=
github.com/unifi-poller/poller v0.0.3/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ= github.com/unifi-poller/poller v0.0.3/go.mod h1:ugy3FyZEH1rFyC3panBiJpXbLf7EZ4GkjiOtydB2CwQ=
github.com/unifi-poller/poller v0.0.4 h1:TYCdQeCYwUmmFcj1H75iGKAFbAOBFwo/XIJDX2Id+cY= github.com/unifi-poller/poller v0.0.4 h1:TYCdQeCYwUmmFcj1H75iGKAFbAOBFwo/XIJDX2Id+cY=
github.com/unifi-poller/poller v0.0.4/go.mod h1:LbOCEdNth7invhaOTpcadW/sDlD2WsU+IE3GRXKzOCg= github.com/unifi-poller/poller v0.0.4/go.mod h1:LbOCEdNth7invhaOTpcadW/sDlD2WsU+IE3GRXKzOCg=
@ -191,6 +195,8 @@ github.com/unifi-poller/poller v0.0.7-0.20200615130505-b2becb340fdc h1:XgiLe8xg9
github.com/unifi-poller/poller v0.0.7-0.20200615130505-b2becb340fdc/go.mod h1:RkRJ4pAc2dAN8Xu9+VOumeE3BdN5QDQ3PC+jBx8hWW0= github.com/unifi-poller/poller v0.0.7-0.20200615130505-b2becb340fdc/go.mod h1:RkRJ4pAc2dAN8Xu9+VOumeE3BdN5QDQ3PC+jBx8hWW0=
github.com/unifi-poller/poller v0.0.7 h1:waSPusZd7yPz1zKJgxPSTwjhIUzA+qj8PwVyfLSLjns= github.com/unifi-poller/poller v0.0.7 h1:waSPusZd7yPz1zKJgxPSTwjhIUzA+qj8PwVyfLSLjns=
github.com/unifi-poller/poller v0.0.7/go.mod h1:RkRJ4pAc2dAN8Xu9+VOumeE3BdN5QDQ3PC+jBx8hWW0= github.com/unifi-poller/poller v0.0.7/go.mod h1:RkRJ4pAc2dAN8Xu9+VOumeE3BdN5QDQ3PC+jBx8hWW0=
github.com/unifi-poller/poller v0.0.8-0.20200619104117-a5e263a36ac9 h1:BYNOSvttR91a0F+ttG2ecD3DenVI9p9oi1W7m36zH98=
github.com/unifi-poller/poller v0.0.8-0.20200619104117-a5e263a36ac9/go.mod h1:q2tufLljemUR/blyhjIj+T0sdAOZo0kdlv3h79kEMgU=
github.com/unifi-poller/promunifi v0.0.6-0.20200202075223-eecff9bfcebd h1:go68sWVWpQSrk9MVWTaH7Sx12C/mbeX7lpYxo91DWy8= github.com/unifi-poller/promunifi v0.0.6-0.20200202075223-eecff9bfcebd h1:go68sWVWpQSrk9MVWTaH7Sx12C/mbeX7lpYxo91DWy8=
github.com/unifi-poller/promunifi v0.0.6-0.20200202075223-eecff9bfcebd/go.mod h1:xgUekNECq3gVfJrbBKBctL0VTJShd7bzlNBRXkwl4uk= github.com/unifi-poller/promunifi v0.0.6-0.20200202075223-eecff9bfcebd/go.mod h1:xgUekNECq3gVfJrbBKBctL0VTJShd7bzlNBRXkwl4uk=
github.com/unifi-poller/promunifi v0.0.6 h1:0b+2gmTYqY+WVLpN4GiKZ0qsfYDHTbrErrJFCBNL8nE= github.com/unifi-poller/promunifi v0.0.6 h1:0b+2gmTYqY+WVLpN4GiKZ0qsfYDHTbrErrJFCBNL8nE=
@ -215,6 +221,8 @@ github.com/unifi-poller/promunifi v0.0.8-0.20200615120918-62e66b15dc1a h1:MCrM2Q
github.com/unifi-poller/promunifi v0.0.8-0.20200615120918-62e66b15dc1a/go.mod h1:YXNpofH3Tw707nHJaHXZWVnTlosc4Jdia1RpaVkLTd4= github.com/unifi-poller/promunifi v0.0.8-0.20200615120918-62e66b15dc1a/go.mod h1:YXNpofH3Tw707nHJaHXZWVnTlosc4Jdia1RpaVkLTd4=
github.com/unifi-poller/promunifi v0.0.8 h1:cSoDYZnpFGxyht7sAMytl1wmbHSKem3OOHQXPL3mrrI= github.com/unifi-poller/promunifi v0.0.8 h1:cSoDYZnpFGxyht7sAMytl1wmbHSKem3OOHQXPL3mrrI=
github.com/unifi-poller/promunifi v0.0.8/go.mod h1:YXNpofH3Tw707nHJaHXZWVnTlosc4Jdia1RpaVkLTd4= github.com/unifi-poller/promunifi v0.0.8/go.mod h1:YXNpofH3Tw707nHJaHXZWVnTlosc4Jdia1RpaVkLTd4=
github.com/unifi-poller/promunifi v0.0.9-0.20200620104707-26208eb4336b h1:HgmbS5cKfvw3x0ie6IV/FfhxNtKwAvICKxXL7gg2sgM=
github.com/unifi-poller/promunifi v0.0.9-0.20200620104707-26208eb4336b/go.mod h1:jOcYehhsOrs4ctswSKEqGuqSgVBpConaWmRYskycbUc=
github.com/unifi-poller/unifi v0.0.2/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM= github.com/unifi-poller/unifi v0.0.2/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
github.com/unifi-poller/unifi v0.0.3 h1:6pmjW7MuEEDKKvYoxjL3EZlaLOgmhYyxJBAg4X7GliI= github.com/unifi-poller/unifi v0.0.3 h1:6pmjW7MuEEDKKvYoxjL3EZlaLOgmhYyxJBAg4X7GliI=
github.com/unifi-poller/unifi v0.0.3/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM= github.com/unifi-poller/unifi v0.0.3/go.mod h1:DagVD/I+VMnVUHmTT4Fi76lPI+DHbuMwwtMIzanwMxM=
@ -230,6 +238,9 @@ github.com/unifi-poller/unifi v0.0.4/go.mod h1:bTUtctrf56aapjKH+L+98eThBaVFbQXw5
github.com/unifi-poller/unifi v0.0.5-0.20200614031431-bd4934fc585b h1:g3nleMBVzn/0PVwzoNYCwioFgYjzOxMByAO66a/tTf0= github.com/unifi-poller/unifi v0.0.5-0.20200614031431-bd4934fc585b h1:g3nleMBVzn/0PVwzoNYCwioFgYjzOxMByAO66a/tTf0=
github.com/unifi-poller/unifi v0.0.5-0.20200614031431-bd4934fc585b/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8= github.com/unifi-poller/unifi v0.0.5-0.20200614031431-bd4934fc585b/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8=
github.com/unifi-poller/unifi v0.0.5-0.20200614034623-f4c1d18157c2/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8= github.com/unifi-poller/unifi v0.0.5-0.20200614034623-f4c1d18157c2/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8=
github.com/unifi-poller/unifi v0.0.5-0.20200619092006-d24c776a42f5/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8=
github.com/unifi-poller/unifi v0.0.5-0.20200620103801-b927287ea1cd h1:jrwuiY1AdoPi+b+R8zjt/e8h8ZqULNB9izcyQnf3pSw=
github.com/unifi-poller/unifi v0.0.5-0.20200620103801-b927287ea1cd/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8=
github.com/unifi-poller/unifi v0.0.5 h1:Izeun32YxcQOeKZUXY0Sy4ltKYFuYxWGcN9JS6xkIJU= github.com/unifi-poller/unifi v0.0.5 h1:Izeun32YxcQOeKZUXY0Sy4ltKYFuYxWGcN9JS6xkIJU=
github.com/unifi-poller/unifi v0.0.5/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8= github.com/unifi-poller/unifi v0.0.5/go.mod h1:L1kMRH2buZhB31vZnRC1im7Tk/4uD3ET4biwl2faYy8=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=