Esempio n. 1
0
def _parameter_valuespec_windows_updates() -> ValueSpec:
    return Transform(
        forth=_transform,
        valuespec=Dictionary(
            title=_("Parameters for the Windows Update Check with WSUS"),
            help=
            _("Set the according numbers to 0 if you want to disable alerting."
              ),
            elements=[
                (
                    "levels_important",
                    SimpleLevels(Integer,
                                 title="Levels for pending important updates",
                                 default_value=(1, 1)),
                ),
                (
                    "levels_optional",
                    SimpleLevels(Integer,
                                 title="Levels for pending optional updates",
                                 default_value=(1, 99)),
                ),
                (
                    "levels_lower_forced_reboot",
                    SimpleLevels(
                        Age,
                        title=
                        "Levels for time until forced reboot due to pending important updates",
                        default_value=(604800, 172800),
                    ),
                ),
            ],
        ),
    )
Esempio n. 2
0
def _vs_run_network() -> ValueSpec:
    return Dictionary(
        title=_("Levels on network traffic"),
        elements=[
            ("net_data_sent", SimpleLevels(title=_("Data sent"),
                                           unit="bytes/s")),
            ("net_data_recv",
             SimpleLevels(title=_("Data received"), unit="bytes/s")),
        ],
    )
Esempio n. 3
0
def _vs_redis_memory() -> ValueSpec:
    return Dictionary(
        title=_("Levels memory"),
        elements=[
            ("memory_util",
             SimpleLevels(Percentage, title=_("Memory utilitzation"))),
            ("system_memory_util",
             SimpleLevels(Percentage, title=_("System Memory utilitzation"))),
        ],
    )
Esempio n. 4
0
def _vs_gce_cpu() -> Dictionary:
    return Dictionary(
        title=_("Levels CPU"),
        elements=[
            ("util", SimpleLevels(Percentage, title=_("CPU utilization"))),
            ("vcores",
             SimpleLevels(Integer,
                          title=_("Number of vCPUs reserved for the VM"))),
        ],
    )
Esempio n. 5
0
def _vs_run_cpu() -> ValueSpec:
    return Dictionary(
        title=_("Levels CPU"),
        elements=[
            ("util", SimpleLevels(Percentage, title=_("CPU utilitzation"))),
        ],
    )
Esempio n. 6
0
def _vs_hitratio() -> Dictionary:
    return Dictionary(
        title=_("Parameters for the key hit ratio"),
        elements=[
            (
                "levels_upper_hitratio",
                SimpleLevels(Percentage,
                             title=_("Upper levels for hit ratio")),
            ),
            (
                "levels_lower_hitratio",
                SimpleLevels(Percentage,
                             title=_("Lower levels for hit ratio")),
            ),
        ],
    )
Esempio n. 7
0
def _vs_function_network() -> ValueSpec:
    return Dictionary(
        title=_("Levels on network"),
        elements=[
            ("net_data_sent", SimpleLevels(title=_("Data sent"),
                                           unit="bytes/s")),
        ],
    )
Esempio n. 8
0
def _vs_function_execution() -> ValueSpec:
    return Dictionary(
        title=_("Levels on performance"),
        elements=[
            ("execution_count", Levels(title=_("execution count"))),
            ("aws_lambda_memory_size_absolute",
             SimpleLevels(Filesize, title=_("memory"))),
            ("aws_lambda_duration", Levels(title=_("execution time"),
                                           unit="s")),
        ],
    )
Esempio n. 9
0
def _vs_run_memory() -> ValueSpec:
    return Dictionary(
        title=_("Levels memory"),
        elements=[
            (
                "memory_util",
                SimpleLevels(Percentage,
                             title=_("Memory utilitzation"),
                             default_value=(80, 90)),
            ),
        ],
    )
Esempio n. 10
0
def _vs_gcs_bucket_objects() -> ValueSpec:
    return Dictionary(
        title=_("Parameters for the bucket objects io"),
        elements=[
            (
                "aws_bucket_size",
                SimpleLevels(Filesize,
                             title=_("Parameters of total bucket size")),
            ),
            ("aws_num_objects",
             Levels(title=_("Parameters of bucket object counts"))),
        ],
    )
Esempio n. 11
0
def _vs_gce_disk() -> Dictionary:
    return Dictionary(
        title=_("Levels disk IO"),
        elements=[
            (
                "disk_read_throughput",
                SimpleLevels(Filesize,
                             title=_("Disk read throughput per second")),
            ),
            (
                "disk_write_throughput",
                SimpleLevels(Filesize,
                             title=_("Disk read throughput per second")),
            ),
            ("disk_read_ios",
             SimpleLevels(Integer, title=_("Disk read opertions"),
                          unit="ops")),
            ("disk_write_ios",
             SimpleLevels(Integer, title=_("Disk read opertions"),
                          unit="ops")),
        ],
    )
Esempio n. 12
0
def _parameter_valuespec_mysql_db_size():
    return Transform(
        valuespec=Dictionary(
            elements=[(
                "levels",
                SimpleLevels(
                    Filesize,
                    help=_(
                        "The service will trigger a warning or critical state if the size of the "
                        "database exceeds these levels."),
                    title=_("Impose limits on the size of the database"),
                ),
            )],
            optional_keys=False,
        ),
        forth=_transform,
    )
Esempio n. 13
0
def _parameter_valuespec_systemd_services():
    return Dictionary(
        elements=[
            (
                "states",
                Dictionary(
                    title=_("Map systemd states to monitoring states"),
                    elements=[
                        (
                            "active",
                            MonitoringState(
                                title=_(
                                    "Monitoring state if service is active"),
                                default_value=0,
                            ),
                        ),
                        (
                            "inactive",
                            MonitoringState(
                                title=_(
                                    "Monitoring state if service is inactive"),
                                default_value=0,
                            ),
                        ),
                        (
                            "failed",
                            MonitoringState(
                                title=_(
                                    "Monitoring state if service is failed"),
                                default_value=2,
                            ),
                        ),
                    ],
                ),
            ),
            (
                "states_default",
                MonitoringState(
                    title=_("Monitoring state for any other service state"),
                    default_value=2,
                ),
            ),
            (
                "ignored",
                ListOf(
                    valuespec=RegExp(
                        title=_("Pattern (Regex)"),
                        size=40,
                        mode=RegExp.infix,
                    ),
                    title=_(
                        "Exclude services matching provided regex patterns"),
                    help=
                    _("<p>You can optionally define one or multiple regular expressions "
                      "where a matching case will result in the exclusion of the concerning service(s). "
                      "This allows to ignore services which are known to fail beforehand. </p>"
                      ),
                    add_label=_("Add pattern"),
                ),
            ),
            (
                "activating_levels",
                SimpleLevels(
                    Age,
                    title=
                    _("Define a tolerating time period for activating services"
                      ),
                    help=
                    _("Choose time levels for which a service is allowed to be in an 'activating' state"
                      ),
                    default_levels=(30, 60),
                ),
            ),
            (
                "deactivating_levels",
                SimpleLevels(
                    Age,
                    title=
                    _("Define a tolerating time period for deactivating services"
                      ),
                    help=
                    _("Choose time levels (in seconds) for which a service is allowed to be in an 'deactivating' state"
                      ),
                    default_value=(30, 60),
                ),
            ),
            (
                "reloading_levels",
                SimpleLevels(
                    Age,
                    title=_(
                        "Define a tolerating time period for reloading services"
                    ),
                    help=
                    _("Choose time levels (in seconds) for which a service is allowed to be in a 'reloading' state"
                      ),
                    default_value=(30, 60),
                ),
            ),
        ],
        help=_(
            "This ruleset only applies to the Summary Systemd service and not the individual "
            "Systemd services."),
    )