patricegautier / unifiZabbix

Zabbix templates to monitor pretty much all Unifi devices
181 stars 36 forks source link

Version 1.3 templates - Can not pull any AP stats #83

Closed UntestedEngineer closed 1 year ago

UntestedEngineer commented 1 year ago

Zabbix Version: 6.2.6 (container) I have jq, expect and ssh installed in the container

I was using an older version of the templates and shell files so I decided to upgrade after reading the newer version of the templates/shell scripts results in less overall load on the Zabbix server (less SSH sessions). However, it appears none of the APs are able to have data extracted (worked without issues in an older version). I have a few nanoHD and one HD and various switches. There are no issues at all with pulling data from the switches. When trying to pull data from the APs I keep seeing the following in the logs. For reference I completely wiped the old templates and removed all items from the devices, then relinked the new templates.

255:20230122:013843.227 discovery rule "Garage AP:active_radio_discovery" became not supported: Preprocessing failed for: NaN

  1. Result: NaN
  2. Failed: cannot extract value from json by path "$.radio_table.[?(@.athstats.cu_total >0)]": invalid object format, expected opening character '{' or '[' at: 'NaN' 255:20230122:013843.311 discovery rule "Garage AP:wifi_network_discovery" became not supported: Preprocessing failed for: NaN
  3. Result: NaN
  4. Failed: cannot extract value from json by path "$.vap_table": invalid object format, expected opening character '{' or '[' at: 'NaN' 263:20230122:013843.714 item "Garage AP:memory" became not supported: Cannot evaluate function: not enough data at "last(//mem_used) / last(//mem_total)". 263:20230122:013843.714 item "Garage AP:client_count" became not supported: Preprocessing failed for: NaN
  5. Result: NaN
  6. Failed: cannot extract value from json by path "$.vap_table.[*].clientCount.sum()": invalid object format, expected opening character '{' or '[' at: 'NaN' 263:20230122:013843.714 item "Garage AP:cpu" became not supported: Preprocessing failed for: NaN
  7. Result: NaN
  8. Failed: cannot extract value from json by path "$.['system-stats'].cpu": invalid object format, expected opening character '{' or '[' at: 'NaN' 263:20230122:013843.714 item "Garage AP:hostname" became not supported: Preprocessing failed for: NaN
  9. Result: NaN
  10. Failed: cannot extract value from json by path "$.hostname": invalid object format, expected opening character '{' or '[' at: 'NaN' 263:20230122:013843.714 item "Garage AP:load_avg_1mn" became not supported: Preprocessing failed for: NaN
  11. Result: NaN
  12. Failed: cannot extract value from json by path "$.['sys_stats'].loadavg_1": invalid object format, expected opening character '{' or '[' at: 'NaN' 263:20230122:013843.714 item "Garage AP:load_avg_5mn" became not supported: Preprocessing failed for: NaN
  13. Result: NaN
  14. Failed: cannot extract value from json by path "$.['sys_stats'].loadavg_5": invalid object format, expected opening character '{' or '[' at: 'NaN' 263:20230122:013843.714 item "Garage AP:load_avg_15mn" became not supported: Preprocessing failed for: NaN
  15. Result: NaN
  16. Failed: cannot extract value from json by path "$.['sys_stats'].loadavg_15": invalid object format, expected opening character '{' or '[' at: 'NaN' 263:20230122:013843.715 item "Garage AP:mem_total" became not supported: Preprocessing failed for: NaN
  17. Result: NaN
UntestedEngineer commented 1 year ago

I actually found this was an issue with some find and replace magic I did to the .yaml. For the UnifiAP template CPU Utilization and Memory Utilization I found the preprocessing return Math.round(value) not applied. When I made the modifications to the yaml file directly I would ger those errors above. However, when I went into the Zabbix UI and added it to the template there it was no problem.

Very odd but this can be closed already.

patricegautier commented 1 year ago

I love issues to get closed like that :)