Open toxicvengeance opened 1 year ago
As a workaround:
In web/plugins/wato/ssllabs_check_pameters.py
add:
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Tuple,
Age,
RegExpUnicode,
RegExp,
TextAscii,
)
from cmk.gui.wato import (
subgroup_applications,
)
from cmk.gui.plugins.wato.utils import (
register_check_parameters,
)
before the actual code.
And in special/agent_ssllabs
change the definition of cache_dir
:
cache_dir = os.environ.get("OMD_ROOT") + "/tmp/check_mk" + "/agents/agent_ssllabs"
If @schoekek would bring the plugin version in this repo up-to-date (#17), I would provide my changes as a PR. :wink:
You also need some more code in ssllabs_datasource_programs.py:
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Integer,
TextAscii,
Transform,
)
from cmk.gui.watolib.rulespecs import (
register_rule,
)
before the actual code.
i plan to upload a new mkp version to exchange..
There is a new version 3.1.1 on exchange which has the fixes for ssllabs_check_pameters.py and agent_ssllabs but it misses the fixes to ssllabs_datasource_programs.py
3.1.1 runs error-free on my installation.
It only runs error-free if you have mkp packages installed which get called before your plugin and already define these imports. Try to load ssllabs mkp with no other mkps installed.
Doesn't work anymore on 2.3.0b4-cre.
Error running automation call restart (exit code 5), error:
Error in plugin file /omd/sites/<site>/local/share/check_mk/checks/ssllabs_grade: name 'factory_settings' is not defined
Error precompiling checks for host <hostname>: Cannot find check file needed for agent_ssllabs```
We won't switch to 2.3 until QIII/2024. Unfortunately there is no new mkp before then.
We won't switch to 2.3 until QIII/2024. Unfortunately there is no new mkp before then.
Any update on this?
@christmart is right about the additional lines needed in ssllabs_datasource_programs.py.
@dnlldl The 2.3.0 error is a mystery. I get it too. I'll try to get to the bottom of it in the next week or so.
I'm not familiar enough with the checkmk plugin api to be able to do this one quickly, alas.
OK, if we install into 2.1.0 it works as expected, and if we then upgrade that site to 2.2.0 it still works.
However, when I create a test site in 2.2.0 the mkp installs but we are missing the "Check SSL Server via ssllabs API" other integrations ruleset.
Looks like the whole thing needs updating to the 2.0 API as a first step.
OK, if we install into 2.1.0 it works as expected, and if we then upgrade that site to 2.2.0 it still works.
However, when I create a test site in 2.2.0 the mkp installs but we are missing the "Check SSL Server via ssllabs API" other integrations ruleset.
Looks like the whole thing needs updating to the 2.0 API as a first step.
This doesn't work on 2.3 either but you might want to check https://thl-cmk.hopto.org/gitlab/checkmk/various/agent_ssllabs
Sorry to hijack this issue, but I got the latter working in 2.3 by making the following change to local/lib/python3/cmk/special_agents/agent_ssllabs.py
from cmk.special_agents.v0_unstable.agent_common import special_agent_main
from cmk.special_agents.v0_unstable.argument_parsing import create_default_argument_parser
Cloned it to github and created a cmk23 branch which has a working mkp for cmk 2.2.0 and 2.3.0
Sorry to hijack this issue, but I got the latter working in 2.3 by making the following change to local/lib/python3/cmk/special_agents/agent_ssllabs.py
from cmk.special_agents.utils.agent_common import special_agent_main from cmk.special_agents.v0_unstable.agent_common import special_agent_main
from cmk.special_agents.utils.argument_parsing import create_default_argument_parser from cmk.special_agents.v0_unstable.argument_parsing import create_default_argument_parser
Cloned it to github and created a cmk23 branch which has a working mkp for cmk 2.2.0 and 2.3.0
I assume using the "v0_unstable" libraries won't work forever though? There must be something new that needs to be done to make it properly working.
I assume using the "v0_unstable" libraries won't work forever though? There must be something new that needs to be done to make it properly working.
At the moment these are the correct imports. This API is not fixed for a version 1 release. I think with 2.4 next year this will be then v1.
Hi,
there seems to be an issue with the ssllabs api check Plugin(downloaded from https://exchange.checkmk.com/p/ssllabs) in Checkmk 2.2.0. When I activate the plugin the following error message appears
I then tried adding the check to a specific host and got the following error
[agent] Success, [special_ssllabs] TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'CRIT, [piggyback] Success (but no data found for this host), execution time 1.3 sec
Do you have an idea what could be wrong ?
Cheers