{
  "checks": [
    {
      "name": "Ping",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ping",
      "parameters": {},
      "sort_order": 0,
      "value_type": "duration",
      "description": "",
      "check_config": {},
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Postfix queue active",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "deb59c37-17f1-5395-8c0d-86fa9050ba21",
        "value_unit": "msgs",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 0,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "deb59c37-17f1-5395-8c0d-86fa9050ba21",
        "value_unit": "msgs",
        "extract_value": "^(\\d+)"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 500,
      "threshold_warn": 50,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Postfix queue deferred (stuck)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "d0b516d4-ecf3-5a57-b86f-aa599be6fcf3",
        "value_unit": "msgs",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 1,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "d0b516d4-ecf3-5a57-b86f-aa599be6fcf3",
        "value_unit": "msgs",
        "extract_value": "^(\\d+)"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 200,
      "threshold_warn": 20,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "SMTP",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 25
      },
      "sort_order": 1,
      "value_type": "status",
      "description": "",
      "check_config": {
        "port": 25
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Submission",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 587
      },
      "sort_order": 2,
      "value_type": "status",
      "description": "",
      "check_config": {
        "port": 587
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Dovecot connections",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "8a856712-6222-559d-9799-ef28e077b819",
        "value_unit": "conns",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 2,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "8a856712-6222-559d-9799-ef28e077b819",
        "value_unit": "conns",
        "extract_value": "^(\\d+)"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 2000,
      "threshold_warn": 500,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Postfix rejects (last 5min)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "39d0a44f-b6c7-52ec-a649-2fccbea00cd4",
        "value_unit": "rejects",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 3,
      "value_type": "info",
      "description": "",
      "check_config": {
        "script_id": "39d0a44f-b6c7-52ec-a649-2fccbea00cd4",
        "value_unit": "rejects",
        "extract_value": "^(\\d+)"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "IMAPS",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 993
      },
      "sort_order": 3,
      "value_type": "status",
      "description": "",
      "check_config": {
        "port": 993
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "CPU",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_cpu",
      "parameters": {},
      "sort_order": 4,
      "value_type": "gauge",
      "description": "",
      "check_config": {},
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95,
      "threshold_warn": 80,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "RBL self-check (your IP listed?)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "94558f96-2963-591e-bd0f-442b1fce4416",
        "value_unit": "listed",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 4,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "94558f96-2963-591e-bd0f-442b1fce4416",
        "value_unit": "listed",
        "extract_value": "^(\\d+)"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 1,
      "threshold_warn": 1,
      "interval_seconds": 3600,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Memory",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_mem",
      "parameters": {},
      "sort_order": 5,
      "value_type": "gauge",
      "description": "",
      "check_config": {},
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95,
      "threshold_warn": 85,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Disk /var/mail",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_disk",
      "parameters": {
        "mount": "/var/mail"
      },
      "sort_order": 6,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "mount": "/var/mail"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 90,
      "threshold_warn": 80,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Mail Queue",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "869da246-8404-5f50-8f49-4efc741ae281"
      },
      "sort_order": 7,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "869da246-8404-5f50-8f49-4efc741ae281"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 500,
      "threshold_warn": 100,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "SSL Certificate (SMTP)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssl_certificate",
      "parameters": {
        "port": 587,
        "hostname": "{host}",
        "crit_days": 7,
        "warn_days": 30
      },
      "sort_order": 8,
      "value_type": "duration",
      "description": "",
      "check_config": {
        "port": 587,
        "hostname": "{host}",
        "crit_days": 7,
        "warn_days": 30
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 86400,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "SSL Certificate (IMAP)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssl_certificate",
      "parameters": {
        "port": 993,
        "hostname": "{host}",
        "crit_days": 7,
        "warn_days": 30
      },
      "sort_order": 9,
      "value_type": "duration",
      "description": "",
      "check_config": {
        "port": 993,
        "hostname": "{host}",
        "crit_days": 7,
        "warn_days": 30
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 86400,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Spam Filter",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "5e97f93b-fa3c-582c-ade4-ee54799bc6c3",
        "match_regex": "^active$"
      },
      "sort_order": 10,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "5e97f93b-fa3c-582c-ade4-ee54799bc6c3",
        "match_regex": "^active$"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "IP Blacklist Check",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "118b2e2d-6c13-5fbf-8bc9-61869b07c539"
      },
      "sort_order": 11,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "118b2e2d-6c13-5fbf-8bc9-61869b07c539"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 1,
      "threshold_warn": 1,
      "interval_seconds": 86400,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    }
  ],
  "profile": {
    "icon": "server",
    "name": "Mail Server (SMTP/IMAP)",
    "tags": [
      "mail",
      "smtp",
      "imap",
      "ssl"
    ],
    "vendor": "generic",
    "category": "server",
    "os_family": "linux",
    "description": "Mail Server: Ports, Queue, SSL-Zertifikate, Blacklist-Check, Spam Filter.",
    "ip_required": true,
    "port_layout": null,
    "visual_type": null,
    "snmp_enabled": false,
    "agent_capable": false,
    "requires_snmp": true,
    "description_md": "Mail Server: Ports, Queue, SSL-Zertifikate, Blacklist-Check, Spam Filter.",
    "requires_agent": false,
    "sysoid_patterns": null,
    "sysdescr_patterns": null,
    "requires_collector": true
  },
  "scripts": [
    {
      "name": "Postfix queue active",
      "script_id": "deb59c37-17f1-5395-8c0d-86fa9050ba21",
      "is_builtin": true,
      "description": "Auto-registered builtin SSH script.",
      "interpreter": "bash",
      "script_body": "mailq 2>/dev/null | tail -1 | awk '/Request/{print $5+0; exit}/empty/{print 0; exit}' || echo 0",
      "expected_output": "nagios"
    },
    {
      "name": "Postfix queue deferred (stuck)",
      "script_id": "d0b516d4-ecf3-5a57-b86f-aa599be6fcf3",
      "is_builtin": true,
      "description": "Auto-registered builtin SSH script.",
      "interpreter": "bash",
      "script_body": "find /var/spool/postfix/deferred -type f 2>/dev/null | wc -l",
      "expected_output": "nagios"
    },
    {
      "name": "Dovecot connections",
      "script_id": "8a856712-6222-559d-9799-ef28e077b819",
      "is_builtin": true,
      "description": "Auto-registered builtin SSH script.",
      "interpreter": "bash",
      "script_body": "doveadm who 2>/dev/null | tail -n +2 | wc -l",
      "expected_output": "nagios"
    },
    {
      "name": "Postfix rejects (last 5min)",
      "script_id": "39d0a44f-b6c7-52ec-a649-2fccbea00cd4",
      "is_builtin": true,
      "description": "Auto-registered builtin SSH script.",
      "interpreter": "bash",
      "script_body": "journalctl -u postfix --since '5min ago' 2>/dev/null | grep -cE 'reject:|NOQUEUE' || echo 0",
      "expected_output": "nagios"
    },
    {
      "name": "RBL self-check (your IP listed?)",
      "script_id": "94558f96-2963-591e-bd0f-442b1fce4416",
      "is_builtin": true,
      "description": "Auto-registered builtin SSH script.",
      "interpreter": "bash",
      "script_body": "ip=$(curl -sf -4 ifconfig.me 2>/dev/null); r=$(echo $ip | awk -F. '{print $4\\\".\\\"$3\\\".\\\"$2\\\".\\\"$1}'); host -W 5 -t A $r.zen.spamhaus.org 2>&1 | grep -c '127\\\\.0\\\\.0\\\\.' || echo 0",
      "expected_output": "nagios"
    },
    {
      "name": "Mail Queue",
      "script_id": "869da246-8404-5f50-8f49-4efc741ae281",
      "is_builtin": true,
      "description": "Auto-registered from builtin profile-check 'Mail Queue'.",
      "interpreter": "bash",
      "script_body": "postqueue -p 2>/dev/null | tail -1 | grep -oP '\\d+(?= Requests)' || echo 0",
      "expected_output": "nagios"
    },
    {
      "name": "Spam Filter",
      "script_id": "5e97f93b-fa3c-582c-ade4-ee54799bc6c3",
      "is_builtin": true,
      "description": "Auto-registered from builtin profile-check 'Spam Filter'.",
      "interpreter": "bash",
      "script_body": "systemctl is-active rspamd || systemctl is-active spamassassin || systemctl is-active amavis",
      "expected_output": "nagios"
    },
    {
      "name": "IP Blacklist Check [e1f255]",
      "script_id": "118b2e2d-6c13-5fbf-8bc9-61869b07c539",
      "is_builtin": true,
      "description": "Auto-registered from builtin profile-check 'IP Blacklist Check'.",
      "interpreter": "bash",
      "script_body": "IP=$(hostname -I | awk '{print $1}'); REV=$(echo $IP | awk -F. '{printf \"%s.%s.%s.%s\",$4,$3,$2,$1}'); n=0; for bl in zen.spamhaus.org bl.spamcop.net b.barracudacentral.org dnsbl.sorbs.net; do [ -n \"$(dig +short +time=3 ${REV}.${bl} 2>/dev/null)\" ] && n=$((n+1)); done; echo $n",
      "expected_output": "nagios"
    }
  ],
  "schema_version": 1
}