binarybear-de / cmk_check_unifi-controller

Local Check for Check_MK to get information about UniFi devices from Controller
22 stars 2 forks source link

Problem with Unifi 6.0.41.0 #2

Closed n00rm closed 3 years ago

n00rm commented 3 years ago

Hey I'm running the latest Version of Unifi (6.0.41.0) on a Ubuntu 18.04 LTS. JQ is installed. If I run the script I get the following error:

SUDOUSER@UNIFISERVER:/usr/lib/check_mk_agent/local$ sudo ./check_unifi-controller.sh 
./check_unifi-controller.sh: Zeile 134: [: =: Einstelliger (unärer) Operator erwartet.
./check_unifi-controller.sh: Zeile 137: [: =: Einstelliger (unärer) Operator erwartet.
3 UniFi-Controller - Build 
./check_unifi-controller.sh: Zeile 153: [: =: Einstelliger (unärer) Operator erwartet.
./check_unifi-controller.sh: Zeile 162: [: =: Einstelliger (unärer) Operator erwartet.
3 UniFi-Devices -
it@SRV-UNIFY:/usr/lib/check_mk_agent/local$ 

I think the different API Version from Unifi is the Problem because the API that is included in the current Version only supports Unifi Controller 5.X. versions

n00rm commented 3 years ago

Got it to work now after I changed the Base URL to localhost. Weird but it's working on the 6.0.X versions.

binarybear-de commented 3 years ago

Happens when controller couldn't be contacted correctly / wrong user in my case. Added requirement of a successful login bind before continuing

Cheers.