patricegautier / unifiZabbix

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

Error on mca-dump-switch-discovery #81

Closed kekko1485 closed 1 year ago

kekko1485 commented 1 year ago

Sometimes i have this error on mca-dump-switch-discovery on some switches causing some unsupported items.

Preprocessing failed for: {. "reason": "Error remote invoking mca-dump-short: ",. "time": "Wed 18 Jan 09:23:05 CET 2023",...

  1. Failed: Error

What can be the reason?

patricegautier commented 1 year ago

can you look in /tmp/mcaDumpShort.err on your zabbix server?

kekko1485 commented 1 year ago

I have found this.

{ "reason":"jq --indent 0 del (.port_table[].mac_table) returned status 5; jq: error (at :42): Cannot iterate over null (null); JQ input was { anon_id: 834275d2-a273-404f-8345-ee5f48b9095d, architecture: armv7l, board_rev: 3, bootid: 0, bootrom_version: usw-v1.1.4.115-g14af1ee6, cfgversion: b8340b9563ffc9ab, connect_request_ip: 213.243.203.238, connect_request_port: 25452, default: false, discovery_response: false, dualboot: true, ever_crash: false, guest_kicks: 0, guest_token: 21DED4323E5574A5BBE183484F7ABE2F, hash_id: f345ee5f48b9095d, hostname: SW-SI-SMBI-1, inform_as_notif: true, inform_ip: 35.152.93.97, inform_min_interval: 30, inform_url: http://unifi:8080/inform, ip: 192.168.175.52, isolated: false, kernel_version: 3.6.5, last_error_conns: [], locating: false, mac: 18:e8:29:b4:3c:cc, manufacturer_id: 4, model: US48, model_display: US-48-G1, netmask: 255.255.255.0, notif_reason: device-busy, required_version: 3.3.13, selfrun_beacon: true, serial: 18E829B43CCC, state: 2, sys_error_caps: 0, time: 1674204120, tm_ready: true, uptime: 1150630, version: 6.4.18.14328}", "time":"Fri 20 Jan 09:42:00 CET 2023", "device":"192.168.175.52", "mcaDumpError":"Error" } { "anon_id": "834275d2-a273-404f-8345-ee5f48b9095d", "architecture": "armv7l", "board_rev": 3, "bootid": 0, "bootrom_version": "usw-v1.1.4.115-g14af1ee6", "cfgversion": "b8340b9563ffc9ab", "connect_request_ip": "213.243.203.238", "connect_request_port": "25452", "default": false, "discovery_response": false, "dualboot": true, "ever_crash": false, "guest_kicks": 0, "guest_token": "21DED4323E5574A5BBE183484F7ABE2F", "hash_id": "f345ee5f48b9095d", "hostname": "SW-SI-SMBI-1", "inform_as_notif": true, "inform_ip": "35.152.93.97", "inform_min_interval": 30, "inform_url": "http://unifi:8080/inform", "ip": "192.168.175.52", "isolated": false, "kernel_version": "3.6.5", "last_error_conns": [], "locating": false, "mac": "18:e8:29:b4:3c:cc", "manufacturer_id": 4, "model": "US48", "model_display": "US-48-G1", "netmask": "255.255.255.0", "notif_reason": "device-busy", "required_version": "3.3.13", "selfrun_beacon": true, "serial": "18E829B43CCC", "state": 2, "sys_error_caps": 0, "time": 1674204120, "tm_ready": true, "uptime": 1150630, "version": "6.4.18.14328" }

patricegautier commented 1 year ago

your switch was not sending back a lot of port info on this call.. In any case the latest commit for mca-dump-short.sh will now protect and not error out on those types of JSONs..