[Check_mk (english)] WATO parameters for custom plugin

Marcel Schulte schulte.marcel at gmail.com
Sat Oct 10 20:04:44 CEST 2015


Hi Paul,

the generated config is right, as it says: "that's the config for group
ssllabs_score". And your check file (as long as it's the one I sent)
defines group ssllabs_score.

Regards,
Marcel

Paul Bongers <paul at paul-bongers.nl> schrieb am Sa., 10. Okt. 2015 um
19:27 Uhr:

> I've been digging in the issue some more.
>
> If I understand the Check_MK code correctly, customized levels should be
> in the environment when 'read_autochecks_of'
> (~/share/check_mk/modules/discovery.py:709) is invoked at
> ~/share/check_mk/modules/check_mk.py:970 (I'm on version 1.2.6p12 now),
> as this method should merge customized levels into the default ones.
>
> I've added this bit of code at line 733 in discovery.py:
>     import pprint
>     sys.stderr.write("ssllabs_levels is defined for host " + hostname +
> " as:\n")
>     pprint.pprint(ssllabs_levels)
>     sys.stderr.write("\n")
>
> Then I refreshed inventory and recompiled on the shell (cmk -vII; cmk
> -vU), and I expected to see the defined levels, but instead I only got
> this (sample host):
> ssllabs_levels is defined for host dale as:
> {}
>
> Then I looked at the configuration created by WATO, and found the
> following entry in ~/etc/check_mk/conf.d/wato/rules.mk:
> checkgroup_parameters['ssllabs_score'] = [
> ( {'ignore_mismatch': True}, [], ALL_HOSTS ),
> ] + checkgroup_parameters['ssllabs_score']
>
> As I don't find any reference here to the ssllabs_levels variable, I
> should look at the WATO plugin, that doesn't create the right config at
> this point.
>
> On 10-10-2015 0:02, Paul Bongers wrote:
> > The rule still seems to be inactive.
> >
> > I've installed the updated files, restarted apache and configured a
> > rule. As the rule applies on discovered serviced, I did a reinventory of
> > the hosts services also. The rule should be active, but when viewing the
> > "Parameters of <hostname> / SSLLabs server score", the setting "Ignore
> > if certificate names don't match" is still set to "off".
> >
> > When I look at the generated python script in var/check_mk/precompiled,
> > I find that the code contains the default thresholds.
> >
> > def get_sorted_check_table(hostname, remove_duplicates=False,
> > world='config'):
> >     return [('ssllabs', '77.248.226.92', {'score': ('A', '[BC]',
> > '[D-FMT]'), 'ignore_mismatch': False}, 'SSLLabs server score for
> > 77.248.226.92', '')]
> >
> > Any ideas still?
> >
> > On 9-10-2015 15:03, Paul Bongers wrote:
> >> Hi Marcel,
> >>
> >> Thanks for your input. I'll test the updated files when I'm home.
> >>
> >> I am aware that a plugin already exists on the Check_MK exchange. I'm
> >> writing my own plugin, as the other one doesn't really match my needs.
> >>
> >> What I want is that I only get results for finished scans. To achieve
> >> this, I've written a Perl plugin that outputs cached data when the agent
> >> is called and only reruns the scan (in a forked process) when the age of
> >> the cached data meets a certain limit. The plugin is currently still
> >> working with piggyback data based on a host group, but I will probably
> >> update the plugin to be usable as special agent just like the one on the
> >> exchange. When I am happy with my plugin, I will share it on the
> >> exchange as well.
> >>
> >> Regards,
> >>
> >> Paul
> >>
> >> On 2015-10-09 11:08, Marcel Schulte wrote:
> >>
> >>> Hi Paul,
> >>>
> >>> please find the adjusted code attached (both files were changed). This
> >>> way you should get the right params displayed and used. But what do
> >>> you want to do with the summarize option? It's used nowhere but in the
> >>> inventory function...
> >>>
> >>> BTW: do you know the ssllabs plugin by Karsten Schoeke
> >>> (
> https://mathias-kettner.de/check_mk_exchange_file.php?HTML=&file=ssllabs-1.3.mkp
> >>> [1])?
> >>>
> >>> HTH,
> >>> Marcel
> >>>
> >>> Marcel Schulte <schulte.marcel at gmail.com> schrieb am Fr., 9. Okt. 2015
> >>> um 10:01 Uhr:
> >>> Thanks for the information. Settings changed between 1.2.4 and 1.2.6 I
> >>> think - that was the point in question.
> >>>
> >>> I'll check your code...
> >>>
> >>> Marcel
> >>>
> >>> Paul Bongers <Paul.Bongers at osudio.com> schrieb am Fr., 9. Okt. 2015 um
> >>> 09:57 Uhr:
> >>> Hi Marcel,
> >>>
> >>> I'm currently running 1.2.6p10.cre.
> >>>
> >>> Regards,
> >>>
> >>> Paul
> >>>
> >>> On 09/10/15 09:50, Marcel Schulte wrote:
> >>>
> >>> Hi Paul,
> >>>
> >>> the default setting depend on your used CMK version - which is it?
> >>>
> >>> Regards,
> >>> Marcel
> >>>
> >>> Paul Bongers <check-mk at paul-bongers.nl> schrieb am Do., 8. Okt. 2015
> >>> um 22:21 Uhr: Hi Marcel,
> >>>
> >>> Attached you'll find both the check script and the WATO plugin I've
> >>> written.
> >>>
> >>> I might add that I'm a little fuzzy on where I should pass the default
> >>> parameters, either in the inventory function or in the check_info (see
> >>> commented lines at the end of the check script).
> >>>
> >>> Thanks in advance.
> >>>
> >>> Regards,
> >>>
> >>> Paul
> >>>
> >>> On 8-10-2015 17:04, Marcel Schulte wrote:
> >>>> Hi Paul,
> >>>>
> >>>> Could you provide the check itself as well as the file providing the
> >>>> WATO rule section for your script?
> >>>>
> >>>> Regards,
> >>>> Marcel
> >>>>
> >>>>
> >>>> Paul Bongers <check-mk at paul-bongers.nl
> >>>> <mailto:check-mk at paul-bongers.nl>> schrieb am Do., 8. Okt. 2015
> 16:55:
> >>>>
> >>>> I haven't yet found any way to implement this correctly.
> >>>>
> >>>> Can someone comment on this?
> >>>>
> >>>> Regards,
> >>>>
> >>>> Paul
> >>>>
> >>>> On 4-10-2015 9:45, Paul Bongers wrote:
> >>>>> Hi list,
> >>>>>
> >>>>> I'm trying to set up a WATO plugin to configure parameters for a
> >>>> custom
> >>>>> agent based check. Thus far I have an option to create custom
> >>>> levels via
> >>>>> Hosts & Service Parameters -> Parameters for discovered services.
> >>>>>
> >>>>> When I go to the service and click the icon 'View and edit parameters
> >>>>> for this service' it says "Rule 1 in Main directory", but the
> >>>> parameter
> >>>>> values don't match the ones I specified in the rule.
> >>>>>
> >>>>> How will I be able to get this to work?
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>> Paul
> >>>>> _______________________________________________
> >>>>> checkmk-en mailing list
> >>>>> checkmk-en at lists.mathias-kettner.de
> >>>> <mailto:checkmk-en at lists.mathias-kettner.de>
> >>>>> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en [2]
> >>>>>
> >>>>> Well meet in Munich for the 2nd Check_MK Conference!
> >>>>> Book your place now and be part of it.
> >>>>> October 18th-20th, 2015
> >>>>> http://mathias-kettner.com/conference [3]
> >>>>>
> >>>>
> >>>> _______________________________________________
> >>>> checkmk-en mailing list
> >>>> checkmk-en at lists.mathias-kettner.de
> >>>> <mailto:checkmk-en at lists.mathias-kettner.de>
> >>>> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en [2]
> >>>>
> >>>> Well meet in Munich for the 2nd Check_MK Conference!
> >>>> Book your place now and be part of it.
> >>>> October 18th-20th, 2015
> >>>> http://mathias-kettner.com/conference [3]
> >>>>
> >>
> >> _______________________________________________
> >> checkmk-en mailing list
> >> checkmk-en at lists.mathias-kettner.de
> >> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en [2]
> >>
> >> Well meet in Munich for the 2nd Check_MK Conference!
> >> Book your place now and be part of it.
> >> October 18th-20th, 2015
> >> http://mathias-kettner.com/conference [3]
> >>
> >>
> >>
> >> Links:
> >> ------
> >> [1]
> >>
> https://mathias-kettner.de/check_mk_exchange_file.php?HTML=&file=ssllabs-1.3.mkp
> >>
> >> [2] http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
> >> [3] http://mathias-kettner.com/conference
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mathias-kettner.de/pipermail/checkmk-en/attachments/20151010/1d86f053/attachment-0001.html>


More information about the checkmk-en mailing list