kuhn-ruess / Checkmk-Checks

Checks and Stuff for Check_MK
MIT License
40 stars 22 forks source link

pure - AttributeError: 'NoneType' object has no attribute 'replace' #56

Closed rschitz closed 2 months ago

rschitz commented 1 year ago

In the 1.4 version i got this issue at the end of the script exec:

<<<pure_arraycertificates>>> Traceback (most recent call last): File "/omd/sites/xxx/local/share/check_mk/agents/special/agent_pure", line 212, in <module> get_arraycertificates() File "/omd/sites/xxx/local/share/check_mk/agents/special/agent_pure", line 198, in get_arraycertificates print(f"{certificate['name']} {certificate['common_name']} {certificate['status']} {certificate['valid_from']} {certificate['valid_to']} {certificate['organizational_unit'].replace(' ','_')}|{certificate['organization'].replace(' ','_')}") AttributeError: 'NoneType' object has no attribute 'replace'

bsplesnialy commented 1 year ago

Same for version 1.4.1, tested right now obraz

Bastian-Kuhn commented 1 year ago

Hello,

It seems you checking a Certificate which as missing the organization field? That's not usual, are you certain that certificate is right?

bsplesnialy commented 1 year ago

Hi,

Actually you are right, I need to regenerate CA. But why doesn't the plugin work with incomplete CA, shouldn't it show something like a critical service instead of not working at all? For now im using version 1.3.1 but I have been following all your versions so I know that in 1.4 you have implemented CA checking.

obraz

Sincerely,

Bastian-Kuhn commented 1 year ago

I pushed a 1.4.1, can you check if this fixes your problem? Thanks in advance

bsplesnialy commented 1 year ago

In 1.4.1 this issue persists as I said in my 1st comment. At the moment I have tested again and nothing has changed, I need to replace the CA to check again. When I do, I will let you know in this thread.

obraz

Bastian-Kuhn commented 1 year ago

Cant be the same error, the code line there is now diffrent? Can you send the new trace

bsplesnialy commented 1 year ago

Agent exited with code 1: Traceback (most recent call last): File "/omd/sites/^site^/local/share/check_mk/agents/special/agent_pure", line 212, in get_arraycertificates() File "/omd/sites/^site^/local/share/check_mk/agents/special/agent_pure", line 198, in get_arraycertificates print(f"{certificate['name']} {certificate['common_name']} {certificate['status']} {certificate['valid_from']} {certificate['valid_to']} {certificate['organizationalunit'].replace(' ','')}|{certificate['organization'].replace(' ','_')}") AttributeError: 'NoneType' object has no attribute 'replace'

Bastian-Kuhn commented 1 year ago

So sorry, the Push was not working, should be 1.4.2 not 1.4.1