Closed DRK-Boll closed 1 year ago
So i try a little bit more.
In the Templates i remove the -b in the mca-dump mca-dump-short.sh["-d","{HOST.CONN}", "-u", "{$UNIFI_USER}", "-i", "{$UNIFI_SSH_PRIV_KEY_PATH}", "-t", "SWITCH", "-p", "{$UNIFI_SSHPASS_PASSWORD_PATH}", "-U", "{$UNIFI_VERBOSE_SSH}", "-o", "{$UNIFI_CHECK_TIMEOUT}","-b"]
Then it will work on our USW-Pro-48-PoE,.
On our US-16-150W it wont work. Do you know why?
I also solved it by removing the -b from the mca-dump items of the templates but the script to my US-8 still wont work and go in timeout.
Apologies I hadn't committed the correct mac-dump script to the right spot.. Please update and let me know..
It's all working for me. Thank you
For me its working too! Thanks
One question. I added the host with type Agent. But the agent is offline. Is it possible that it is online? Thanks
there's no zabbix agent on switches, so offline is right.. the script is using that connection info though, minus the port.
Good Evening, I am working to get your tools implemented. I am having an issue where Zabbix wont run things correctly. When I run sudo -u zabbix /usr/lib/zabbix/externalscripts/mca-dump-short.sh -d 192.168.0.109 -u admini -i /usr/lib/zabbix/.ssh/zb_id_rsa -t SWITCH
I get the output of the JSON.
When zabbix runs things I get something like this for each host. I am using AP and SWITCH currently. The @@@@ comes when I remove the password path. 1330:20230113:220228.289 error reason for "Production Closet Switch:mca-dump-short.sh["-d","{HOST.CONN}", "-u", "{$UNIFI_USER}", "-i", "{$UNIFI_SSH_PRIV_KEY_PATH}", "-t", "SWITCH", "-p", "{$UNIFI_SSHPASS_PASSWORD_PATH}", "-U", "{$UNIFI_VERBOSE_SSH}", "-o", "{$UNIFI_CHECK_TIMEOUT}","-b"]" changed: Preprocessing failed for: { "at":"22:02:28", "r":"Error remote invoking mca-dump-short: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...
Failed: Error This is what I get when I add the password path back.
Failed: cannot extract value from json by path "$.sys_stats.mem_total": invalid object format, expected opening character '{' or '[' at: 'Password file not found '/var/lib/zabbix/password'' 1330:20230113:220626.282 item "Production Closet Switch:mem_used" became not supported: Preprocessing failed for: Password file not found '/var/lib/zabbix/password'
Failed: cannot extract value from json by path "$.uptime": invalid object format, expected opening character '{' or '[' at: 'Password file not found '/var/lib/zabbix/password'' 1332:20230113:220629.430 error reason for "Production Closet Switch:memory" changed: Cannot evaluate function: item "/Production Closet Switch/mem_used" is not supported at "last(//mem_used) / last(//mem_total)". 1332:20230113:220724.940 error reason for "Production Closet Switch:cpu_smooth" changed: Cannot evaluate function: item "/Production Closet Switch/cpu" is not supported at "avg(//cpu,{$UNIFI_SMOOTHING_PERIOD})".
Any Help would be appreciated.
Couple of things:
• look in /tmp/mcaDumpShort.err, you should get a more complete error message. The '@@@@..' looks to me like ssh complaining about something
• from the zabbix server, are you able to ssh directly to the switch with that password?
Hi Patrice,
i want to install your Script to monitor our Unifi devices.
So i install everything in the readme:
sudo -u zabbix ssh -i yourUserName@oneOfYourUnifiDevicesIP --> This works fine
sudo -u zabbix /usr/lib/zabbix/externalscripts/mca-dump-short.sh -d -u -i -t <UDMP|AP|SWITCH|CK> --> This works also
When i then in Zabbix i create a host, I have the following problem Preprocessing failed for: /usr/lib/zabbix/externalscripts/mca-dump-short.sh: Ungültige Option -- b.Usage /usr/lib/zabbix/ex...
Can you help me please?
Thanks