def _valuespec_special_agents_emcunity():
    return Dictionary(
        elements=[
            ("username", TextAscii(title=_("Username"))),
            ("password", IndividualOrStoredPassword(title=_("Password"))),
            ("lockbox",
             FixedValue(
                 True,
                 title=_("Use Credentials From:"),
                 totext=_("Lockbox"),
             )),
        ],
        title=_("EMC Unity"),
    )
def _valuespec_special_agents_ilo():
    return Transform(
        Dictionary(
            title=_("Agent HPE iLO Configuration"),
            elements=[
                ("user", TextAscii(
                    title=_("Username"),
                    allow_empty=False,
                )),
                ("password", IndividualOrStoredPassword(
                    title=_("Password"),
                    allow_empty=False,
                )),
            ],
        ),
    )
예제 #3
0
def _valuespec_special_agents_jb_fls():
    return Dictionary(
        title=_("JetBrains Floating License Server"),
        help=_("This rule selects the JetBrains Floating License agent"),
        elements=[
            ('url',
             HTTPUrl(
                 title=
                 _("URL of the JetBrains Floating License Server, e.g. https://host:1212/"
                   ),
                 allow_empty=False,
             )),
            ('token',
             IndividualOrStoredPassword(
                 title=_("JetBrains Floating License Report Token"),
                 allow_empty=True,
             )),
        ],
        optional_keys=['token'],
    )
예제 #4
0
def _valuespec_special_agents_dell_storage():
    return Dictionary(
        title=_('Dell Storage via Dell Storage API'),
        help=_('This rule selects the Dell Storage API agent instead of '
               'the normal Check_MK Agent and allows monitoring of '
               'Dell Storage Manager systems and volumes by REST. '
               'You can configure your connection settings here.'),
        elements=[
            ('url',
             HTTPUrl(
                 title=
                 _('URL of the Dell Storage API, e.g. https://host:3033/api/rest/'
                   ),
                 allow_empty=False,
             )),
            ('user',
             TextAscii(
                 title=_('Dell Storage API username.'),
                 allow_empty=False,
             )),
            ('password',
             IndividualOrStoredPassword(
                 title=_('Dell Storage API password'),
                 allow_empty=False,
             )),
            ('ignore_cert',
             Alternative(title=_('SSL certificate checking'),
                         elements=[
                             FixedValue(True,
                                        title=_('Ignore Cert'),
                                        totext=''),
                             FixedValue(False,
                                        title=_('Check Cert'),
                                        totext=''),
                         ],
                         default_value=False)),
        ])
예제 #5
0
    def _connection_elements(self):
        connection_elements = [
            (
                "directory_type",
                CascadingDropdown(
                    title=_("Directory type"),
                    help=
                    _("Select the software the LDAP directory is based on. Depending on "
                      "the selection e.g. the attribute names used in LDAP queries will "
                      "be altered."),
                    choices=[
                        ("ad", _("Active Directory"),
                         self._vs_directory_options("ad")),
                        ("openldap", _("OpenLDAP"),
                         self._vs_directory_options("openldap")),
                        (
                            "389directoryserver",
                            _("389 Directory Server"),
                            self._vs_directory_options("389directoryserver"),
                        ),
                    ],
                ),
            ),
            (
                "bind",
                Tuple(
                    title=_("Bind credentials"),
                    help=
                    _("Set the credentials to be used to connect to the LDAP server. The "
                      "used account must not be allowed to do any changes in the directory "
                      "the whole connection is read only. "
                      "In some environment an anonymous connect/bind is allowed, in this "
                      "case you don't have to configure anything here."
                      "It must be possible to list all needed user and group objects from the "
                      "directory."),
                    elements=[
                        LDAPDistinguishedName(
                            title=_("Bind DN"),
                            help=
                            _("Specify the distinguished name to be used to bind to "
                              "the LDAP directory, e. g. <tt>CN=ldap,OU=users,DC=example,DC=com</tt>"
                              ),
                            size=63,
                        ),
                        IndividualOrStoredPassword(
                            title=_("Bind password"),
                            help=_(
                                "Specify the password to be used to bind to "
                                "the LDAP directory."),
                        ),
                    ],
                ),
            ),
            (
                "port",
                Integer(
                    title=_("TCP port"),
                    help=_("This variable allows to specify the TCP port to "
                           "be used to connect to the LDAP server. "),
                    minvalue=1,
                    maxvalue=65535,
                    default_value=389,
                ),
            ),
            (
                "use_ssl",
                FixedValue(
                    title=_("Use SSL"),
                    help=
                    _("Connect to the LDAP server with a SSL encrypted connection. The "
                      '<a href="wato.py?mode=edit_configvar&site=&varname=trusted_certificate_authorities">trusted '
                      "certificates authorities</a> configured in Check_MK will be used to validate the "
                      "certificate provided by the LDAP server."),
                    value=True,
                    totext=_("Encrypt the network connection using SSL."),
                ),
            ),
            (
                "connect_timeout",
                Float(
                    title=_("Connect timeout"),
                    help=
                    _("Timeout for the initial connection to the LDAP server in seconds."
                      ),
                    unit=_("Seconds"),
                    minvalue=1.0,
                    default_value=2.0,
                ),
            ),
            (
                "version",
                DropdownChoice(
                    title=_("LDAP version"),
                    help=_(
                        "Select the LDAP version the LDAP server is serving. Most modern "
                        "servers use LDAP version 3."),
                    choices=[(2, "2"), (3, "3")],
                    default_value=3,
                ),
            ),
            (
                "page_size",
                Integer(
                    title=_("Page size"),
                    help=
                    _("LDAP searches can be performed in paginated mode, for example to improve "
                      "the performance. This enables pagination and configures the size of the pages."
                      ),
                    minvalue=1,
                    default_value=1000,
                ),
            ),
            (
                "response_timeout",
                Integer(
                    title=_("Response timeout"),
                    unit=_("Seconds"),
                    help=_("Timeout for LDAP query responses."),
                    minvalue=0,
                    default_value=5,
                ),
            ),
            (
                "suffix",
                TextInput(
                    allow_empty=False,
                    title=_("LDAP connection suffix"),
                    help=
                    _("The LDAP connection suffix can be used to distinguish equal named objects "
                      "(name conflicts), for example user accounts, from different LDAP connections.<br>"
                      "It is used in the following situations:<br><br>"
                      "During LDAP synchronization, the LDAP sync might discover that a user to be "
                      "synchronized from from the current LDAP is already being synchronized from "
                      "another LDAP connection. Without the suffix configured this results in a name "
                      "conflict and the later user not being synchronized. If the connection has a "
                      "suffix configured, this suffix is added to the later username in case of the name "
                      "conflict to resolve it. The user will then be named <tt>[username]@[suffix]</tt> "
                      "instead of just <tt>[username]</tt>.<br><br>"
                      "In the case a user which users name is existing in multiple LDAP directories, "
                      "but associated to different persons, your user can insert <tt>[username]@[suffix]</tt>"
                      " during login instead of just the plain <tt>[username]</tt> to tell which LDAP "
                      "directory he is assigned to. Users without name conflict just need to provide their "
                      "regular username as usual."),
                    regex=re.compile(r"^[A-Z0-9.-]+(?:\.[A-Z]{2,24})?$", re.I),
                    validate=self._validate_ldap_connection_suffix,
                ),
            ),
        ]

        return connection_elements
                 title = _("Thread stat type"),
                 help = _('The threading statistics type. Available options: thread-count, peak-thread-count, total-started-thread-count, daemon-thread-count'),
                 allow_empty = True,
             )
         ),
         ( "user",
             TextAscii(
                 title = _("JBoss User"),
                 help = _('The username used to connect to the JBoss'),
                 allow_empty = False,
             )
         ),
         ( "password",
             IndividualOrStoredPassword(
                 title = _("JBoss Password"),
                 help = _('The password used to connect to the JBoss'),
                 allow_empty = False,
             )
         ),
         ( "thresholds",
             Tuple(
                 title = _("State change thresholds"),
                 elements=[
                     Integer(title=_("Warning at")),
                     Integer(title=_("Critical at")),
                 ],
                 allow_empty = True,
             )
         ),
     ]
 ),