首页 > 其他分享 >夜莺nightingale的一些k8s指标

夜莺nightingale的一些k8s指标

时间:2024-06-07 11:14:16浏览次数:16  
标签:font color text 夜莺 right nightingale 告警 k8s margin

夜莺nightingale的安装与启动中已经二进制安装了夜莺系统,其web地址为http://<ip>:17000/,默认用户是 root,密码是 root.2020。登录后需要修改密码。

使用夜莺系统,主要是使用其告警功能,其告警功能方便易用。

本次项目告警设置为:项目通过邮件发送给各项目管理人,系统告警通过企业微信发送到企业微信告警群

1.设置人员组织

最后的告警是落在业务组管理的,用户-团队-业务组

 

2.设置告警通知

2.1邮件通知

在告警通知-通知设置里面需要设置SMTP设置,按照实际情况修改其默认配置。

在告警通知-通知模板中设置邮件模板email

<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>夜莺告警通知</title>
        <style type="text/css">
            
            .wrapper {
                background-color: #f8f8f8;
                padding: 15px;
                height: 100%;
            }
            .main {
                width: 600px;
                padding: 30px;
                margin: 0 auto;
                background-color: #fff;
                font-size: 12px;
                font-family: verdana,'Microsoft YaHei',Consolas,'Deja Vu Sans Mono','Bitstream Vera Sans Mono';
            }
            header {
                border-radius: 2px 2px 0 0;
            }
            header .title {
                font-size: 14px;
                color: #333333;
                margin: 0;
            }
            header .sub-desc {
                color: #333;
                font-size: 14px;
                margin-top: 6px;
                margin-bottom: 0;
            }
            hr {
                margin: 20px 0;
                height: 0;
                border: none;
                border-top: 1px solid #e5e5e5;
            }
            em {
                font-weight: 600;
            }
            table {
                margin: 20px 0;
                width: 100%;
            }
    
            table tbody tr{
                font-weight: 200;
                font-size: 12px;
                color: #666;
                height: 32px;
            }
    
            .succ {
                background-color: green;
                color: #fff;
            }
    
            .fail {
                background-color: red;
                color: #fff;
            }
    
            .succ th, .succ td, .fail th, .fail td {
                color: #fff;
            }
    
            table tbody tr th {
                width: 80px;
                text-align: right;
            }
            .text-right {
                text-align: right;
            }
            .body {
                margin-top: 24px;
            }
            .body-text {
                color: #666666;
                -webkit-font-smoothing: antialiased;
            }
            .body-extra {
                -webkit-font-smoothing: antialiased;
            }
            .body-extra.text-right a {
                text-decoration: none;
                color: #333;
            }
            .body-extra.text-right a:hover {
                color: #666;
            }
            .button {
                width: 200px;
                height: 50px;
                margin-top: 20px;
                text-align: center;
                border-radius: 2px;
                background: #2D77EE;
                line-height: 50px;
                font-size: 20px;
                color: #FFFFFF;
                cursor: pointer;
            }
            .button:hover {
                background: rgb(25, 115, 255);
                border-color: rgb(25, 115, 255);
                color: #fff;
            }
            footer {
                margin-top: 10px;
                text-align: right;
            }
            .footer-logo {
                text-align: right;
            }
            .footer-logo-image {
                width: 108px;
                height: 27px;
                margin-right: 10px;
            }
            .copyright {
                margin-top: 10px;
                font-size: 12px;
                text-align: right;
                color: #999;
                -webkit-font-smoothing: antialiased;
            }
        </style>
    </head>
    <body>
    <div class="wrapper">
        <div class="main">
            <header>
                <h3 class="title">{{.Cluster}}集群中{{.RuleName}}</h3>
                <p class="sub-desc"></p>
            </header>
    
            <hr>
    
            <div class="body">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tbody>
                    {{if .IsRecovered}}
                    <tr class="succ">
                        <th>级别状态:</th>
                        <td>S{{.Severity}} Recovered</td>
                    </tr>
                    {{else}}
                    <tr class="fail">
                        <th>级别状态:</th>
                        <td>S{{.Severity}} Triggered</td>
                    </tr>
                    {{end}}
                    {{if .RuleNote}}
                    <tr>
                        <th>告警类型:</th>
                        <td>{{.RuleNote}}</td>
                    </tr>
                    {{end}}
                    <tr>
                        <th>告警详情:</th>
                        <td>{{.Cluster}}集群中{{.RuleName}}</td>
                    </tr>  
                    <tr>
                        <th>告警集群:</th>
                        <td>{{.Cluster}}</td>
                    </tr> 
                    {{if .TargetNote}} 
                    <tr>
                        <th>设备备注:</th>
                        <td>{{.TargetNote}}</td>
                    </tr>
                    {{end}}
                    {{if not .IsRecovered}}
                    <tr>
                        <th>触发时值:</th>
                        <td>{{.TriggerValue}}</td>
                    </tr>
                    {{end}}
    
                    {{if .TargetIdent}}
                    <tr>
                        <th>监控对象:</th>
                        <td>{{.TargetIdent}}</td>
                    </tr>
                    {{end}}    
                    {{if .IsRecovered}}
                    <tr>
                        <th>恢复时间:</th>
                        <td>{{timeformat .LastEvalTime}}</td>
                    </tr>
                    {{else}}
                    <tr>
                        <th>触发时间:</th>
                        <td>
                            {{timeformat .TriggerTime}}
                        </td>
                    </tr>
                    {{end}}
    
                    <tr>
                        <th>发送时间:</th>
                        <td>
                            {{timestamp}}
                        </td>
                    </tr>
                    </tbody>
                </table>
    
                <hr>
    
                <footer>
                    <div class="copyright" style="font-style: italic">
                        报警太多?使用 <a href="https://flashcat.cloud/product/flashduty/" target="_blank">FlashDuty</a> 做告警聚合降噪、排班OnCall!
                    </div>
                </footer>
            </div>
        </div>
    </div>
    </body>
    </html>

 

 

标签:font,color,text,夜莺,right,nightingale,告警,k8s,margin
From: https://www.cnblogs.com/xiaoxiaomuyuyu/p/18236829

相关文章

  • k8s——pod控制器
    一、pod控制器定义  Pod控制器,又称之为工作负载(workload),是用于实现管理pod的中间层,确保pod资源符合预期的状态,pod的资源出现故障时,会尝试进行重启,当根据重启策略无效,则会重新新建pod的资源。二、pod控制器类型ReplicaSet:代用户创建指定数量的pod副本,确保pod副本数量符......
  • k8s——secret配置资源管理
    一、Secret 1.1Secret定义  Secret是用来保存密码、token、密钥等敏感数据的k8s资源,这类数据虽然也可以存放在Pod或者镜像中,但是放在Secret中是为了更方便的控制如何使用数据,并减少暴露的风险。 1.2Secret类型kubernetes.io/service-account-token:由Kubernetes......
  • k8s——安全机制
    一、安全机制说明  Kubernetes作为一个分布式集群的管理工具,保证集群的安全性是其一个重要的任务。APIServer是集群内部各个组件通信的中介,也是外部控制的入口。所以Kubernetes的安全机制基本就是围绕保护APIServer来设计的。 比如kubectl如果想向APIServer请求资......
  • k8s 集群升级
    1.升级概要k8s版本:以x.y.z表示,其中x是主要版本,y是次要版本,z是补丁版本,不能跳过次要版本升级,比如1.28.0->1.30.0,补丁版本可以跳跃更新,比如1.28.0->1.28.10推荐使用与版本匹配的kubelet和kubeadm,最好各组件版本保持一致升级后,因为容器spec的哈希值已更改,所有容器都......
  • k8s - namespace
    简介命名空间,可以根据ns区分业务线、应用、权限一般默认命名空间指向default,可以在kubeconfig中修改默认配置清单文件apiVersion:v1kind:Namespacemetadata:#命名空间名称name:yky常用操作#创建名为yky的nskubectlcreatensyky#删除名为yky......
  • 修改k8s pod的hosts文件
    当我们服务需要使用自定义的域名解析时,就需要修改pod内hosts文件。而如果我们在pod内部修改后,下次重启依然会丢,所有下面用两种方式实现持久化修改: 1.当集群内所有或者大部分服务都需要修改hosts文件时,我们可以修改CoreDNS的configmap文件 kubectleditcm-nkube-systemco......
  • k8s-pod参数详解
    目录概述创建Pod编写一个简单的Pod添加常用参数为Pod的容器分配资源网络相关Pod健康检查启动探针存活探针就绪探针作用整个Pod参数配置创建docker-registry卷挂载结束概述  k8s中的pod参数详解。官方文档  版本k8s1.27.x、busybox:stable-musl、nginx:sta......
  • k8s 证书过期处理
    问题kubeadm安装的集群默认签发的证书有效期为1年,到期后集群组件之间无法正常通信。证书修复流程1.检查当前证书状态$kubeadmcertscheck-expiration[check-expiration]Readingconfigurationfromthecluster...[check-expiration]FYI:Youcanlookatthisconfig......
  • k8s配置节点亲和性yaml示例:根据节点名称来配置节点亲和性(node affinity)
    在Kubernetes中,根据节点名称来配置节点亲和性(nodeaffinity)通常不是直接通过节点名称实现的,而是通过为节点添加特定的标签,然后在Pod的亲和性规则中匹配这些标签。不过,有一种特殊情况是使用NodeAffinity的nodeSelectorTerms中的matchExpressions,通过设置operator为In并使用......
  • k8s - 二进制部署[阿里云]
    概述部署前先了解一下k8s需要的组件和所处的位置,并且为了保证安全,k8s各组件之间通信都需要信任,这就引出了k8s从入门到放弃的证书部署步骤我这次是在阿里云上部署,所以包括了一些云产品云产品介绍eip动态公网ip,和nat网关绑定后,内网服务器才可以访问公网nat网关,所有k8s......