AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-177966

Marshall Davis's questions

Martin Hope
Marshall Davis
Asked: 2023-07-17 23:55:01 +0800 CST

如何使用动态阈值对 Datadog 监视器进行 Terraform

  • 5

我正在尝试从 DataDog 提供程序创建许多资源。我希望为每种资源定义尽可能少的内容。对于许多属性来说,都有一些合理的默认值。我很难决定如何处理监视器阈值,特别是有些阈值可能是可选的。

resource "datadog_monitor" "monitor" {
  for_each = {
    faulty_deploy = {
      message    = "A deployment failed."
      name       = "Deployment Failure"
      query      = "someLongQuery"
      type       = "alert"
      thresholds = {critical = "0"}
    }
  }

  message            = each.value["message"]
  query              = each.value["query"]
  name               = each.value["name"]
  type               = each.value["type"]
  escalation_message = coalesce(each.value["escalation_message"], "")
  evaluation_delay   = coalesce(each.value["evaluation_delay"], "0")
  include_tags       = coalesce(each.value["include_tags"],"true")
  
  dynamic "monitor_thresholds" {
    for_each = each.value["thresholds"]
    iterator = threshold
    content {
      # Dynamically adding these properties is the issue.
      "${threshold.key}" = threshold.value
    }
  }

  # These and more would use coalesce to set defaults.
  new_group_delay      = "60"
  notify_audit         = "false"
  on_missing_data      = "default"
  priority             = "0"
  renotify_interval    = "0"
  renotify_occurrences = "0"
  require_full_window  = "false"
  tags                 = []
  timeout_h            = "0"
}

考虑到某些阈值可能已设置,也可能未设置,如何以这种方式添加动态属性?它们是否应该始终以0or 的形式存在"",并且可以选择性地被覆盖?

terraform
  • 1 个回答
  • 19 Views
Martin Hope
Marshall Davis
Asked: 2022-01-08 07:55:42 +0800 CST

Bash 的起始目录

  • 1

我有一个 Docker 容器正在运行。我使用如下命令连接到容器:

docker exec -it container_name bash

这以 root 身份登录/var/www/html。我想知道为什么这个目录,以及我将如何改变它。这实际上是一个 Web 应用程序的容器,我确实想从 Web 应用程序内容根目录开始,但它位于docker-compose.yml文件中定义的不同名称的卷上。

我检查了一下.profile,.bashrc似乎没有任何迹象表明它会从这个目录开始并且很明显会改变。

bashrc docker
  • 1 个回答
  • 173 Views
Martin Hope
Marshall Davis
Asked: 2015-01-09 20:44:05 +0800 CST

nginx 在 *:80 之前匹配 127.0.0.1

  • 1

我通过包含 conf.d/*.conf 设置了以下两个服务器指令。当我通过公共的外部 IP 地址导航到服务器时,它似乎与 127.0.0.1 的服务器匹配,因为条目被添加到 localhost.access_log 文件中。我希望这只会在通过 localhost 访问时发生。我希望从外部 IP 匹配 .host.tldserver_name指令或default_server参数。

我需要确保如何加载 conf 文件的顺序吗?为什么127.0.0.1上的监听会这样匹配?它是空的第二个位置指令吗?

server {
    listen 127.0.0.1;
    server_name localhost;

    access_log /var/log/nginx/localhost.access_log main;
    error_log /var/log/nginx/localhost.error_log info;

    root /var/www/localhost/htdocs;
}

server {
    listen 80 default_server;
    server_name .host.tld;

    access_log /var/log/nginx/host.access_log main;
    error_log /var/log/nginx/host.error_log info;

    root /var/www/host/htdocs;

    location = / {
            index index.php index.html;
    }

    location / {
    }
}
nginx
  • 1 个回答
  • 4320 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve