I am running RAW version on CentOS 7.9 fully updated.
I am running RAW version 2.0.0p1.
The same problem was present in version 2.0.0.
Manual agent execution outputs the same error I see in connection test web GUI.
Command output follows.
OMD[checkmk]:~/share/check_mk/agents/special$ ./agent_hp_msa -v --debug -u manage -p <hidden_password> msa2050a
Traceback (most recent call last):
File "./agent_hp_msa", line 12, in <module>
sys.exit(main())
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_hp_msa.py", line 179, in main
connection.login(args.username, args.password)
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_hp_msa.py", line 137, in login
session_key = self._get_session_key(hashlib.sha256, username, password)
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_hp_msa.py", line 147, in _get_session_key
login_hash.update("%s_%s" % (username, password))
TypeError: Unicode-objects must be encoded before hashing
MSA 2050 password complexity check requires the following:
it must contain at least one uppercase character, one lowercase character, one numeric character, and one non-alphanumeric character.
we’re getting this error with 2.0.0p1 too. The agent hp_msa had an error in version 2.0.0 before but it used to be a different message (“TypeError” like in werk #12377).
I think the problem is that the string for username and password are not correctly encoded.
This is some of the Python 3 changes. I had last week one system with also a own special agent and the same problem - how to encode the username and passwords.
In the special agent in the function “_get_session_key” the username and password must get the addition .encode('utf8') before it can passed to the hashlib function.
I didn’t succeed simply adding .encode(‘utf-8’) to username and password variables.
I’m not a python programmer so I may have coded it wrong.
Can you help please?
your patch is working fine.
I eventually managed to get my MSA 2050 under monitor.
Now you should have your patch merged in the nex release of Checkmk.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.