Beispiel #1
0
def _valuespec_special_agents_ucs_bladecenter():
    return Dictionary(
        title=_("UCS Bladecenter"),
        help=_(
            "This rule selects the UCS Bladecenter agent instead of the normal Check_MK Agent "
            "which collects the data through the UCS Bladecenter Web API"),
        elements=[
            (
                "username",
                TextInput(
                    title=_("Username"),
                    allow_empty=False,
                ),
            ),
            (
                "password",
                Password(
                    title=_("Password"),
                    allow_empty=False,
                ),
            ),
            (
                "no_cert_check",
                FixedValue(
                    value=True,
                    title=_("Disable SSL certificate validation"),
                    totext=_("SSL certificate validation is disabled"),
                ),
            ),
        ],
        optional_keys=["no_cert_check"],
    )
Beispiel #2
0
 def _vs_host(self):
     return Dictionary(
         required_keys=["hostname"],
         elements=[
             (
                 "hostname",
                 FixedValue(
                     self._hostname,
                     title=_("Hostname"),
                 ),
             ),
             (
                 "ipaddress",
                 HostAddress(
                     title=_("IPv4 address"),
                     allow_empty=False,
                     allow_ipv6_address=False,
                 ),
             ),
             (
                 "snmp_community",
                 Password(
                     title=_("SNMPv1/2 community"),
                     allow_empty=False,
                 ),
             ),
             (
                 "snmp_v3_credentials",
                 cmk.gui.plugins.wato.SNMPCredentials(
                     default_value=None,
                     only_v3=True,
                 ),
             ),
         ],
     )
Beispiel #3
0
def _special_agents_jolokia_mk_jolokia_elements():
    return [
        (
            "port",
            Integer(
                title=_("TCP port for connection"),
                default_value=8080,
                minvalue=1,
                maxvalue=65535,
            ),
        ),
        (
            "login",
            Tuple(
                title=_("Optional login (if required)"),
                elements=[
                    TextInput(
                        title=_("User ID for web login (if login required)"),
                        default_value="monitoring",
                    ),
                    Password(title=_("Password for this user")),
                    DropdownChoice(
                        title=_("Login mode"),
                        choices=[
                            ("basic", _("HTTP Basic Authentication")),
                            ("digest", _("HTTP Digest")),
                        ],
                    ),
                ],
            ),
        ),
        (
            "suburi",
            TextInput(
                title=_("relative URI under which Jolokia is visible"),
                default_value="jolokia",
                size=30,
            ),
        ),
        (
            "instance",
            TextInput(
                title=_("Name of the instance in the monitoring"),
                help=_(
                    "If you do not specify a name here, then the TCP port number "
                    "will be used as an instance name."
                ),
            ),
        ),
        (
            "protocol",
            DropdownChoice(
                title=_("Protocol"),
                choices=[
                    ("http", "HTTP"),
                    ("https", "HTTPS"),
                ],
            ),
        ),
    ]
Beispiel #4
0
 def _vs_key(self) -> Dictionary:
     return Dictionary(
         title=_("Properties"),
         elements=[
             (
                 "alias",
                 TextInput(
                     title=_("Description or comment"),
                     size=64,
                     allow_empty=False,
                 ),
             ),
             (
                 "passphrase",
                 Password(
                     title=_("Passphrase"),
                     help=self._passphrase_help(),
                     allow_empty=False,
                     is_stored_plain=False,
                     minlen=self._minlen,
                 ),
             ),
         ],
         optional_keys=False,
         render="form",
     )
Beispiel #5
0
 def _vs_key(self) -> Dictionary:
     return Dictionary(
         title=_("Properties"),
         elements=[
             (
                 "alias",
                 TextInput(
                     title=_("Description or comment"),
                     size=64,
                     allow_empty=False,
                 ),
             ),
             (
                 "passphrase",
                 Password(
                     title=_("Passphrase"),
                     help=self._passphrase_help(),
                     allow_empty=False,
                     is_stored_plain=False,
                 ),
             ),
             (
                 "key_file",
                 CascadingDropdown(
                     title=_("Key"),
                     choices=[
                         ("upload", _("Upload CRT/PEM File"), FileUpload()),
                         ("text", _("Paste PEM Content"), TextAreaUnicode()),
                     ],
                 ),
             ),
         ],
         optional_keys=False,
         render="form",
     )
def _valuespec_special_agents_pure():
    return Dictionary(
        title=_("Pure via WebAPI"),
        help=_("This rule set selects the special agent for Pure"),
        elements=[
            ("token", Password(title=_("Web API token"), allow_empty=False)),
        ],
        optional_keys=[],
    )
Beispiel #7
0
def _valuespec_special_agents_vnx_quotas():
    return Dictionary(
        title=_("VNX quotas and filesystems"),
        elements=[
            ("user", TextInput(title=_("NAS DB user name"))),
            ("password", Password(title=_("Password"))),
            ("nas_db", TextInput(title=_("NAS DB path"))),
        ],
        optional_keys=[],
    )
def _valuespec_special_agents_cohesity():
    return Dictionary(
        title = _("Cohesity via WebAPI"),
        help = _("This rule set selects the special agent for Cohesity"),
        elements = [
            ("user", TextAscii(title = _("Username"), allow_empty = False)),
            ("password", Password(title = _("Password"), allow_empty = False)),
        ],
        optional_keys=[],
    )
Beispiel #9
0
def _valuespec_special_agents_ddn_s2a():
    return Dictionary(
        elements=[
            ("username", TextInput(title=_("Username"), allow_empty=False)),
            ("password", Password(title=_("Password"), allow_empty=False)),
            ("port", Integer(title=_("Port"), default_value=8008)),
        ],
        optional_keys=["port"],
        title=_("DDN S2A"),
    )
Beispiel #10
0
    def _vs_individual_elements(self):
        if config.user.may("wato.edit_all_passwords"):
            admin_element: List[ValueSpec] = [
                FixedValue(
                    None,
                    title=_("Administrators"),
                    totext=_("Administrators (having the permission "
                             "\"Write access to all passwords\")"),
                )
            ]
        else:
            admin_element = []

        elements: List[DictionaryEntry] = [
            ("password", Password(
                title=_("Password"),
                allow_empty=False,
            )),
            ("owned_by",
             Alternative(
                 title=_("Editable by"),
                 help=_(
                     "Each password is owned by a group of users which are able to edit, "
                     "delete and use existing passwords."),
                 elements=admin_element + [
                     DropdownChoice(
                         title=_("Members of the contact group:"),
                         choices=lambda: sorted_contact_group_choices(only_own=
                                                                      True),
                         invalid_choice="complain",
                         empty_text=_(
                             "You need to be member of at least one contact group to be able to "
                             "create a password."),
                         invalid_choice_title=_(
                             "Group not existant or not member"),
                         invalid_choice_error=_(
                             "The choosen group is either not existant "
                             "anymore or you are not a member of this "
                             "group. Please choose another one."),
                     ),
                 ])),
            ("shared_with",
             DualListChoice(
                 title=_("Share with"),
                 help=
                 _("By default only the members of the owner contact group are permitted "
                   "to use a a configured password. It is possible to share a password with "
                   "other groups of users to make them able to use a password in checks."
                   ),
                 choices=sorted_contact_group_choices,
                 autoheight=False,
             )),
        ]

        return elements
Beispiel #11
0
def _valuespec_special_agents_hivemanager():
    return Tuple(
        title=_("Aerohive HiveManager"),
        help=_(
            "Activate monitoring of host via a HTTP connect to the HiveManager"
        ),
        elements=[
            TextInput(title=_("Username")),
            Password(title=_("Password")),
        ],
    )
Beispiel #12
0
def _valuespec_special_agents_hivemanager_ng():
    return Dictionary(
        title=_("Aerohive HiveManager NG"),
        help=_("Activate monitoring of the HiveManagerNG cloud."),
        elements=[
            (
                "url",
                HTTPUrl(
                    title=_(
                        "URL to HiveManagerNG, e.g. https://cloud.aerohive.com"
                    ),
                    allow_empty=False,
                ),
            ),
            (
                "vhm_id",
                TextInput(
                    title=_("Numerical ID of the VHM, e.g. 102"),
                    allow_empty=False,
                ),
            ),
            (
                "api_token",
                TextInput(
                    title=_("API Access Token"),
                    size=64,
                    allow_empty=False,
                ),
            ),
            (
                "client_id",
                TextInput(
                    title=_("Client ID"),
                    allow_empty=False,
                ),
            ),
            (
                "client_secret",
                Password(
                    title=_("Client secret"),
                    allow_empty=False,
                ),
            ),
            (
                "redirect_url",
                HTTPUrl(
                    title=_("Redirect URL (has to be https)"),
                    allow_empty=False,
                ),
            ),
        ],
        optional_keys=False,
    )
Beispiel #13
0
 def _vs_key(self):
     return Dictionary(
         title=_("Properties"),
         elements=[
             ("passphrase",
              Password(
                  title=_("Passphrase"),
                  allow_empty=False,
                  is_stored_plain=False,
              )),
         ],
         optional_keys=False,
         render="form",
     )
Beispiel #14
0
def _valuespec_special_agents_dellpowervault():
    return Dictionary(
        title=_("Dell Powervault M4 storage system"),
        elements=[
            ('user', TextAscii(
                title=_('Username'),
                allow_empty=False,
            )),
            ('password', Password(
                title=_("Password"),
                allow_empty=False,
            )),
        ],
        optional_keys=False,
    )
def _valuespec_special_agents_netappeseries():
    return Dictionary(
        title=_("Netapp eSeries storage system"),
        elements=[
            ('user', TextAscii(
                title=_('Username'),
                allow_empty=False,
            )),
            ('password', Password(
                title=_("Password"),
                allow_empty=False,
            )),
        ],
        optional_keys=False,
    )
Beispiel #16
0
 def _get_dynamic_valuespec_elements(self):
     return [
         (
             "site",
             CascadingDropdown(
                 choices=[
                     ("local", _("Connect to the local site")),
                     (
                         "url",
                         _("Connect to site url"),
                         HTTPUrl(help=_(
                             "URL of the remote site, for example https://10.3.1.2/testsite"
                         )),
                     ),
                 ],
                 sorted=False,
                 orientation="horizontal",
                 title=_("Site connection"),
             ),
         ),
         (
             "credentials",
             CascadingDropdown(
                 choices=[
                     ("automation",
                      _("Use the credentials of the 'automation' user")),
                     (
                         "configured",
                         _("Use the following credentials"),
                         Tuple(elements=[
                             TextInput(title=_("Automation Username"),
                                       allow_empty=True),
                             Password(title=_("Automation Secret"),
                                      allow_empty=True),
                         ], ),
                     ),
                 ],
                 help=_(
                     "Here you can configured the credentials to be used. Keep in mind that the <tt>automation</tt> user need "
                     "to exist if you choose this option"),
                 title=_("Login credentials"),
                 default_value="automation",
             ),
         ),
         ("filter", self._vs_filters()),
         ("assignments", self._vs_aggregation_assignments()),
         ("options", self._vs_options()),
     ]
Beispiel #17
0
 def _vs_host(self):
     return Dictionary(required_keys=['hostname'],
                       elements=[
                           ('hostname',
                            FixedValue(self._hostname, title=_('Hostname'), allow_empty=False)),
                           ('ipaddress',
                            HostAddress(
                                title=_("IPv4 Address"),
                                allow_empty=False,
                                allow_ipv6_address=False,
                            )),
                           ('snmp_community',
                            Password(title=_("SNMPv1/2 community"), allow_empty=False)),
                           ('snmp_v3_credentials',
                            cmk.gui.plugins.wato.SNMPCredentials(default_value=None,
                                                                 only_v3=True)),
                       ])
Beispiel #18
0
def _special_agents_ipmi_sensors_vs_ipmi_common_elements() -> DictionaryElements:
    return [
        (
            "username",
            TextInput(
                title=_("Username"),
                allow_empty=False,
            ),
        ),
        (
            "password",
            Password(
                title=_("Password"),
                allow_empty=False,
            ),
        ),
    ]
Beispiel #19
0
def _valuespec_special_agents_lenovo_xclarity():
    return Dictionary(
        title=_("Lenovo XClarity Management Controller"),
        help=_(
            "This rule selects the Agent Lenovo XClarity instead of the normal Check_MK Agent "
            "which collects the data through the Redfish REST API"),
        elements=[
            ('user', TextAscii(
                title=_('Username'),
                allow_empty=False,
            )),
            ('password', Password(
                title=_("Password"),
                allow_empty=False,
            )),
        ],
        optional_keys=False,
    )
Beispiel #20
0
def _valuespec_special_agents_netapp():
    return Transform(
        valuespec=Dictionary(
            elements=[
                (
                    "username",
                    TextInput(
                        title=_("Username"),
                        allow_empty=False,
                    ),
                ),
                (
                    "password",
                    Password(
                        title=_("Password"),
                        allow_empty=False,
                    ),
                ),
                (
                    "skip_elements",
                    ListChoice(
                        choices=[
                            ("ctr_volumes",
                             _("Do not query volume performance counters")),
                        ],
                        title=_("Performance improvements"),
                        help=
                        _("Here you can configure whether the performance counters should get queried. "
                          "This can save quite a lot of CPU load on larger systems."
                          ),
                    ),
                ),
            ],
            title=_("NetApp via WebAPI"),
            help=
            _("This rule set selects the NetApp special agent instead of the normal Check_MK Agent "
              "and allows monitoring via the NetApp Web API. To access the data the "
              "user requires permissions to several API classes. They are shown when you call the agent with "
              "<tt>agent_netapp --help</tt>. The agent itself is located in the site directory under "
              "<tt>~/share/check_mk/agents/special</tt>."),
            optional_keys=False,
        ),
        forth=lambda x: dict([("skip_elements", [])] + list(x.items())),
    )
Beispiel #21
0
 def spec(self):
     return Dictionary(
         title=_("Create notification with the following parameters"),
         optional_keys=None,
         elements=[
             ("destination",
              IPv4Address(title=_("Destination IP"),
                          help=_("IP Address of the Spectrum server receiving the SNMP trap"))),
             ("community",
              Password(
                  title=_("SNMP Community"),
                  help=_("SNMP Community for the SNMP trap"),
              )),
             ("baseoid",
              TextAscii(title=_("Base OID"),
                        help=_("The base OID for the trap content"),
                        default_value="1.3.6.1.4.1.1234")),
         ],
     )
Beispiel #22
0
def _valuespec_special_agents_activemq():
    return Transform(
        valuespec=Dictionary(
            elements=[
                (
                    "servername",
                    TextInput(
                        title=_("Server Name"),
                        allow_empty=False,
                    ),
                ),
                ("port", Integer(title=_("Port Number"), default_value=8161)),
                (
                    "protocol",
                    DropdownChoice(
                        title=_("Protocol"),
                        choices=[
                            ("http", "HTTP"),
                            ("https", "HTTPS"),
                        ],
                    ),
                ),
                ("use_piggyback",
                 Checkbox(title=_("Use Piggyback"), label=_("Enable"))),
                (
                    "basicauth",
                    Tuple(
                        title=_("BasicAuth settings (optional)"),
                        elements=[
                            TextInput(title=_("Username")),
                            Password(title=_("Password"))
                        ],
                    ),
                ),
            ],
            optional_keys=["basicauth"],
        ),
        title=_("Apache ActiveMQ queues"),
        forth=_special_agents_activemq_transform_activemq,
    )
Beispiel #23
0
def _valuespec_special_agents_storeonce():
    return Dictionary(
        title=_("HPE StoreOnce"),
        help=
        _("This rule set selects the special agent for HPE StoreOnce Applainces "
          "instead of the normal Check_MK agent and allows monitoring via Web API. "
          ),
        optional_keys=["cert"],
        elements=[
            ("user", TextInput(title=_("Username"), allow_empty=False)),
            ("password", Password(title=_("Password"), allow_empty=False)),
            (
                "cert",
                DropdownChoice(
                    title=_("SSL certificate verification"),
                    choices=[
                        (True, _("Activate")),
                        (False, _("Deactivate")),
                    ],
                ),
            ),
        ],
    )
Beispiel #24
0
def _valuespec_special_agents_prism():
    return Dictionary(
        title=_("Nutanix Prism"),
        elements=[
            (
                "port",
                Integer(
                    title=_("TCP port for connection"),
                    default_value=9440,
                    minvalue=1,
                    maxvalue=65535,
                ),
            ),
            (
                "username",
                TextInput(
                    title=_("User ID for web login"),
                ),
            ),
            ("password", Password(title=_("Password for this user"))),
        ],
        optional_keys=["port"],
    )
Beispiel #25
0
def _valuespec_special_agents_hp_msa():
    return Dictionary(
        elements=[
            (
                "username",
                TextInput(
                    title=_("Username"),
                    allow_empty=False,
                ),
            ),
            (
                "password",
                Password(
                    title=_("Password"),
                    allow_empty=False,
                ),
            ),
        ],
        optional_keys=False,
        title=_("HP MSA via Web Interface"),
        help=_(
            "This rule selects the Agent HP MSA instead of the normal Check_MK Agent "
            "which collects the data through the HP MSA web interface"),
    )
Beispiel #26
0
def _valuespec_special_agents_emcvnx():
    return Dictionary(
        title=_("EMC VNX storage systems"),
        help=
        _("This rule selects the EMC VNX agent instead of the normal Check_MK Agent "
          "and allows monitoring of EMC VNX storage systems by calling naviseccli "
          "commandline tool locally on the monitoring system. Make sure it is installed "
          "and working. You can configure your connection settings here."),
        elements=[
            (
                "user",
                TextInput(
                    title=_("EMC VNX admin user name"),
                    allow_empty=True,
                    help=
                    _("If you leave user name and password empty, the special agent tries to "
                      "authenticate against the EMC VNX device by Security Files. "
                      "These need to be created manually before using. Therefor run as "
                      "instance user (if using OMD) or Nagios user (if not using OMD) "
                      "a command like "
                      "<tt>naviseccli -AddUserSecurity -scope 0 -password PASSWORD -user USER</tt> "
                      "This creates <tt>SecuredCLISecurityFile.xml</tt> and "
                      "<tt>SecuredCLIXMLEncrypted.key</tt> in the home directory of the user "
                      "and these files are used then."),
                ),
            ),
            (
                "password",
                Password(
                    title=_("EMC VNX admin user password"),
                    allow_empty=True,
                ),
            ),
            (
                "infos",
                Transform(
                    valuespec=ListChoice(
                        choices=[
                            ("disks", _("Disks")),
                            ("hba", _("iSCSI HBAs")),
                            ("hwstatus", _("Hardware status")),
                            ("raidgroups", _("RAID groups")),
                            ("agent", _("Model and revsion")),
                            ("sp_util", _("Storage processor utilization")),
                            ("writecache", _("Write cache state")),
                            ("mirrorview", _("Mirror views")),
                            ("storage_pools", _("Storage pools")),
                        ],
                        default_value=[
                            "disks",
                            "hba",
                            "hwstatus",
                        ],
                        allow_empty=False,
                    ),
                    title=_("Retrieve information about..."),
                ),
            ),
        ],
        optional_keys=[],
    )
Beispiel #27
0
def _valuespec_special_agents_azure():
    return Dictionary(
        title=_("Microsoft Azure"),
        help=
        _("To monitor Azure resources add this datasource to <b>one</b> host. "
          "The data will be transported using the piggyback mechanism, so make "
          "sure to create one host for every monitored resource group. You can "
          "learn about the discovered groups in the <i>Azure Agent Info</i> "
          "service of the host owning the datasource program."),
        # element names starting with "--" will be passed do cmd line w/o parsing!
        elements=[
            (
                "subscription",
                TextInput(
                    title=_("Subscription ID"),
                    allow_empty=False,
                    size=45,
                ),
            ),
            (
                "tenant",
                TextInput(
                    title=_("Tenant ID / Directory ID"),
                    allow_empty=False,
                    size=45,
                ),
            ),
            (
                "client",
                TextInput(
                    title=_("Client ID / Application ID"),
                    allow_empty=False,
                    size=45,
                ),
            ),
            (
                "secret",
                Password(
                    title=_("Client Secret"),
                    allow_empty=False,
                    size=45,
                ),
            ),
            (
                "config",
                Dictionary(
                    title=_("Retrieve information about..."),
                    # Since we introduced this, Microsoft has already reduced the number
                    # of allowed API requests. At the time of this writing (11/2018)
                    # you can find the number here:
                    # https://docs.microsoft.com/de-de/azure/azure-resource-manager/resource-manager-request-limits
                    help=
                    _("By default, all resources associated to the configured tenant ID"
                      " will be monitored.") + " " +
                    _("However, since Microsoft limits API calls to %s per hour"
                      " (%s per minute), you can restrict the monitoring to individual"
                      " resource groups and resources.") % ("12000", "200"),
                    elements=[
                        ("explicit",
                         _special_agents_azure_azure_explicit_config()),
                        ("tag_based",
                         _special_agents_azure_azure_tag_based_config()),
                    ],
                ),
            ),
            (
                "piggyback_vms",
                DropdownChoice(
                    title=_("Map data relating to VMs"),
                    help=
                    _("By default, data relating to a VM is sent to the group host"
                      " corresponding to the resource group of the VM, the same way"
                      " as for any other resource. If the VM is present in your "
                      " monitoring as a separate host, you can choose to send the data"
                      " to the VM itself."),
                    choices=[
                        ("grouphost", _("Map data to group host")),
                        ("self", _("Map data to the VM itself")),
                    ],
                ),
            ),
            (
                "sequential",
                DropdownChoice(
                    title=_("Force agent to run in single thread"),
                    help=_("Check this to turn off multiprocessing."
                           " Recommended for debugging purposes only."),
                    choices=[
                        (False, _("Run agent multithreaded")),
                        (True, _("Run agent in single thread")),
                    ],
                ),
            ),
        ],
        optional_keys=["subscription", "piggyback_vms", "sequential"],
    )
Beispiel #28
0
def _valuespec_special_agents_appdynamics():
    return Dictionary(
        title=_("AppDynamics via REST API"),
        help=_(
            "This rule allows querying an AppDynamics server for information about Java applications"
            "via the AppDynamics REST API. You can configure your connection settings here."
        ),
        elements=[
            (
                "username",
                TextInput(
                    title=_("AppDynamics login username"),
                    allow_empty=False,
                ),
            ),
            (
                "password",
                Password(
                    title=_("AppDynamics login password"),
                    allow_empty=False,
                ),
            ),
            (
                "application",
                TextInput(
                    title=_("AppDynamics application name"),
                    help=_(
                        "This is the application name used in the URL. If you enter for example the application "
                        "name <tt>foobar</tt>, this would result in the URL being used to contact the REST API: "
                        "<tt>/controller/rest/applications/foobar/metric-data</tt>"
                    ),
                    allow_empty=False,
                    size=40,
                ),
            ),
            (
                "port",
                Integer(
                    title=_("TCP port number"),
                    help=_("Port number that AppDynamics is listening on. The default is 8090."),
                    default_value=8090,
                    minvalue=1,
                    maxvalue=65535,
                ),
            ),
            (
                "timeout",
                Integer(
                    title=_("Connection timeout"),
                    help=_(
                        "The network timeout in seconds when communicating with AppDynamics."
                        "The default is 30 seconds."
                    ),
                    default_value=30,
                    minvalue=1,
                    unit=_("seconds"),
                ),
            ),
        ],
        optional_keys=["port", "timeout"],
    )
Beispiel #29
0
def _valuespec_active_checks_disk_smb():
    return Dictionary(
        title=_("Check SMB share access"),
        help=_(
            "This ruleset helps you to configure the classical Nagios "
            "plugin <tt>check_disk_smb</tt> that checks the access to "
            "filesystem shares that are exported via SMB/CIFS."
        ),
        elements=[
            (
                "share",
                TextInput(
                    title=_("SMB share to check"),
                    help=_(
                        "Enter the plain name of the share only, e. g. <tt>iso</tt>, <b>not</b> "
                        "the full UNC like <tt>\\\\servername\\iso</tt>"
                    ),
                    size=32,
                    allow_empty=False,
                ),
            ),
            (
                "workgroup",
                TextInput(
                    title=_("Workgroup"),
                    help=_("Workgroup or domain used (defaults to <tt>WORKGROUP</tt>)"),
                    size=32,
                    allow_empty=False,
                ),
            ),
            (
                "host",
                TextInput(
                    title=_("NetBIOS name of the server"),
                    help=_("If omitted then the IP address is being used."),
                    size=32,
                    allow_empty=False,
                ),
            ),
            (
                "port",
                Integer(
                    title=_("TCP Port"),
                    help=_("TCP port number to connect to. Usually either 139 or 445."),
                    default_value=445,
                    minvalue=1,
                    maxvalue=65535,
                ),
            ),
            (
                "levels",
                Tuple(
                    title=_("Levels for used disk space"),
                    elements=[
                        Percentage(title=_("Warning if above"), default_value=85, allow_int=True),
                        Percentage(title=_("Critical if above"), default_value=95, allow_int=True),
                    ],
                ),
            ),
            (
                "auth",
                Tuple(
                    title=_("Authorization"),
                    elements=[
                        TextInput(title=_("Username"), allow_empty=False, size=24),
                        Password(title=_("Password"), allow_empty=False, size=12),
                    ],
                ),
            ),
        ],
        required_keys=["share", "levels"],
    )
Beispiel #30
0
 def spec(self):
     return Dictionary(
         title=_("Create notification with the following parameters"),
         optional_keys=[
             'priority', 'resolution', 'host_summary', 'service_summary',
             'ignore_ssl', 'timeout', 'label'
         ],
         elements=[
             ("url",
              HTTPUrl(
                  title=_("JIRA URL"),
                  help=_("Configure the JIRA URL here."),
              )),
             ("ignore_ssl",
              FixedValue(
                  True,
                  title=_("Disable SSL certificate verification"),
                  totext=_("Disable SSL certificate verification"),
                  help=
                  _("Ignore unverified HTTPS request warnings. Use with caution."
                    ),
              )),
             ("username",
              TextAscii(
                  title=_("User Name"),
                  help=_("Configure the user name here."),
                  size=40,
                  allow_empty=False,
              )),
             ("password",
              Password(
                  title=_("Password"),
                  help=
                  _("You need to provide a valid password to be able to send notifications."
                    ),
                  size=40,
                  allow_empty=False,
              )),
             ("project",
              TextAscii(
                  title=_("Project ID"),
                  help=_(
                      "The numerical JIRA project ID. If not set, it will be retrieved from a "
                      "custom user attribute named <tt>jiraproject</tt>. "
                      "If that is not set, the notification will fail."),
                  size=10,
              )),
             ("issuetype",
              TextAscii(
                  title=_("Issue type ID"),
                  help=_(
                      "The numerical JIRA issue type ID. If not set, it will be retrieved from a "
                      "custom user attribute named <tt>jiraissuetype</tt>. "
                      "If that is not set, the notification will fail."),
                  size=10,
              )),
             ("host_customid",
              TextAscii(
                  title=_("Host custom field ID"),
                  help=_(
                      "The numerical JIRA custom field ID for host problems."
                  ),
                  size=10,
              )),
             ("service_customid",
              TextAscii(
                  title=_("Service custom field ID"),
                  help=
                  _("The numerical JIRA custom field ID for service problems."
                    ),
                  size=10,
              )),
             ("monitoring",
              HTTPUrl(
                  title=_("Monitoring URL"),
                  help=_(
                      "Configure the base URL for the Monitoring Web-GUI here. Include the site name. "
                      "Used for link to check_mk out of jira."),
              )),
             ("priority",
              TextAscii(
                  title=_("Priority ID"),
                  help=
                  _("The numerical JIRA priority ID. If not set, it will be retrieved from a "
                    "custom user attribute named <tt>jirapriority</tt>. "
                    "If that is not set, the standard priority will be used."
                    ),
                  size=10,
              )),
             ("host_summary",
              TextUnicode(
                  title=_("Summary for host notifications"),
                  help=_(
                      "Here you are allowed to use all macros that are defined in the "
                      "notification context."),
                  default_value="Check_MK: $HOSTNAME$ - $HOSTSHORTSTATE$",
                  size=64,
              )),
             ("service_summary",
              TextUnicode(
                  title=_("Summary for service notifications"),
                  help=_(
                      "Here you are allowed to use all macros that are defined in the "
                      "notification context."),
                  default_value=
                  "Check_MK: $HOSTNAME$/$SERVICEDESC$ $SERVICESHORTSTATE$",
                  size=64,
              )),
             ("label",
              TextUnicode(
                  title=_("Label"),
                  help=_("Here you can set a custom label for new issues. "
                         "If not set, 'monitoring' will be used."),
                  size=16,
              )),
             ("resolution",
              TextAscii(
                  title=
                  _("Activate resolution with following resolution transition ID"
                    ),
                  help=_("The numerical JIRA resolution transition ID. "
                         "11 - 'To Do', 21 - 'In Progress', 31 - 'Done'"),
                  size=3,
              )),
             ("timeout",
              TextAscii(
                  title=_("Set optional timeout for connections to JIRA"),
                  help=_("Here you can configure timeout settings."),
                  default_value=10,
              )),
         ],
     )