edirectory_monitor_dclient.py 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #!/usr/bin/env python3
  2. # -*- encoding: utf-8; py-indent-offset: 4 -*-
  3. # (c) Michael Honkoop <mhonkoop@comsolve.nl>
  4. # License: GNU General Public License v2
  5. """parameters for eDirectory monitor Dclient"""
  6. from cmk.rulesets.v1 import Title, Help
  7. from cmk.rulesets.v1.form_specs import (
  8. DictElement,
  9. Dictionary,
  10. InputHint,
  11. Integer,
  12. LevelDirection,
  13. migrate_to_integer_simple_levels,
  14. SimpleLevels,
  15. String,
  16. )
  17. from cmk.rulesets.v1.rule_specs import (
  18. CheckParameters,
  19. Topic,
  20. HostAndItemCondition,
  21. )
  22. def _vaulespec_edirectory_monitor_dclient_outboundconnection() -> Dictionary:
  23. return Dictionary(
  24. title=Title("Dclient Outbound Connection"),
  25. elements={
  26. "RefusedOutBoundConnection": DictElement(
  27. required=False,
  28. parameter_form=SimpleLevels[int](
  29. title=Title("Refused OutBoundConnections"),
  30. level_direction=LevelDirection.UPPER,
  31. form_spec_template=Integer(),
  32. migrate=migrate_to_integer_simple_levels,
  33. prefill_fixed_levels=InputHint(value=(0, 5)),
  34. )
  35. ),
  36. "TotalOpenOutBoundConnection": DictElement(
  37. required=False,
  38. parameter_form=SimpleLevels[int](
  39. title=Title("Total Open OutBound Connections"),
  40. level_direction=LevelDirection.UPPER,
  41. form_spec_template=Integer(),
  42. migrate=migrate_to_integer_simple_levels,
  43. prefill_fixed_levels=InputHint(value=(0, 5)),
  44. )
  45. ),
  46. "MaxOutBoundConnection": DictElement(
  47. required=False,
  48. parameter_form=SimpleLevels[int](
  49. title=Title("Max OutBound Connections"),
  50. level_direction=LevelDirection.UPPER,
  51. form_spec_template=Integer(),
  52. migrate=migrate_to_integer_simple_levels,
  53. prefill_fixed_levels=InputHint(value=(0, 5)),
  54. )
  55. ),
  56. }
  57. )
  58. def _vaulespec_edirectory_monitor_dclient_outboundcontext() -> Dictionary:
  59. return Dictionary(
  60. title=Title("Dclient Outbound Context"),
  61. elements={
  62. "ActiveOutBoundContextCount": DictElement(
  63. required=False,
  64. parameter_form=SimpleLevels[int](
  65. title=Title("Active OutBound Context Count"),
  66. level_direction=LevelDirection.UPPER,
  67. form_spec_template=Integer(),
  68. migrate=migrate_to_integer_simple_levels,
  69. prefill_fixed_levels=InputHint(value=(0, 5)),
  70. )
  71. ),
  72. "TotalOutBoundContextCount": DictElement(
  73. required=False,
  74. parameter_form=SimpleLevels[int](
  75. title=Title("Total OutBound Context Count"),
  76. level_direction=LevelDirection.UPPER,
  77. form_spec_template=Integer(),
  78. migrate=migrate_to_integer_simple_levels,
  79. prefill_fixed_levels=InputHint(value=(0, 5)),
  80. )
  81. ),
  82. }
  83. )
  84. def _valuespec_edirectory_monitor_dclient() -> Dictionary:
  85. return Dictionary(
  86. title=Title("Dclient Service Parameters"),
  87. elements={
  88. "dclient_outboundconnection": DictElement(
  89. parameter_form=_vaulespec_edirectory_monitor_dclient_outboundconnection(),
  90. required=False),
  91. "dclient_outboundcontext": DictElement(
  92. parameter_form=_vaulespec_edirectory_monitor_dclient_outboundcontext(),
  93. required=False),
  94. },
  95. )
  96. def _item_spec() -> String:
  97. return String(
  98. help_text=Help("ServiceName")
  99. )
  100. rule_spec_edirectory_monitor_dclient_params = CheckParameters(
  101. name="edirectory_monitor_dclient",
  102. title=Title("eDirectory Monitor Dclient Statistics"),
  103. topic=Topic.APPLICATIONS,
  104. condition=HostAndItemCondition(
  105. item_title=Title("ServiceName"), item_form=_item_spec()
  106. ),
  107. parameter_form=_valuespec_edirectory_monitor_dclient,
  108. create_enforced_service=False,
  109. )