Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMK 2.2 #24

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

CMK 2.2 #24

wants to merge 13 commits into from

Conversation

gurubert
Copy link

@gurubert gurubert commented Aug 8, 2024

CMK 2.2 and 2.3 compatability

@grufocom
Copy link

when I try your patch I get the following error message (checkmk 2.3.0-p13-1)

Agent exited with code 1: /omd/sites/t/local/share/check_mk/agents/special/agent_unifi_controller:441: SyntaxWarning: invalid escape sequence '\d'
self.cloudkey_version = re.sub(".?v(\d+.\d+.\d+.[a-z0-9]+).","\1",self.cloudkey_version)

would love to see a functional vesion for 2.3.0! :-)

@grufocom
Copy link

Hi Robert,

tried that already and now I get this error:

Agent exited with code 1: Traceback (most recent call last):
File "/omd/sites/t/local/share/check_mk/agents/special/agent_unifi_controller", line 644, in
_api = unifi_controller_api(**args.dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Any idea for me?
Regrads
Manfred

@gurubert
Copy link
Author

There is half of the Traceback missing.

I have this current version running on a CMK 2.2 site without issues.

@grufocom
Copy link

Had it already running but since update to 2.3.0-p13 it failed and I tried your mkp :-)
Login did not change... -> login via web works.

OMD[t]:~$ cmk --debug UDMPro
[special_unifi_controller] unifi_api_exception: Login failed(!!), [piggyback] Success (but no data found for this host), Missing monitoring data for all plugins(!), execution time 0.4 sec | execution_time=0.420 user_time=0.030 system_time=0.000 children_user_time=0.230 children_system_time=0.040 cmk_time_ds=0.120 cmk_time_agent=0.000
Agent exited with code 1: Traceback (most recent call last):
File "/omd/sites/t/local/share/check_mk/agents/special/agent_unifi_controller", line 644, in
_api = unifi_controller_api(**args.dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/t/local/share/check_mk/agents/special/agent_unifi_controller", line 555, in init
self.login(username,password)
File "/omd/sites/t/local/share/check_mk/agents/special/agent_unifi_controller", line 589, in login
raise unifi_api_exception("Login failed")
unifi_api_exception: Login failed(!!)

@gurubert
Copy link
Author

I am not able to debug login issue in this pull request.

@grufocom
Copy link

found the solution and the reason why it did work until I installed your new package:

#19

def check_unifi_os(self):
_response = self.request("GET", url=self.url, allow_redirects=False)
self.is_unifios = _response.status_code == 200

now it works perfect!
thank you
manfred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants