Skip to Content
监控运维实践:原则与策略
book

监控运维实践:原则与策略

by Mike Julian
November 2020
Intermediate to advanced
142 pages
3h 12m
Chinese
Posts & Telecom Press
Content preview from 监控运维实践:原则与策略
服务器监控
|
87
出站邮件队列反映了有多少邮件正在等待被发送出去。最好通过对比日常的值来衡量它,
并在发生异常时进行告警。
监测发送和接收邮件的总量(包括总数以及按每个邮箱统计的数量)对于发现模式以及异
常行为(例如一个可能被盗用的邮箱)非常有帮助。
类似地,邮箱的大小可以很好地指示你需要规划多少容量。我喜欢按照总量以及每个邮箱
的大小来衡量,以便发现超级用户并在可能的情况下帮助他们降低存储量。
8.12
 监控定时任务
监控领域中最为棘手的事情之一看起来非常简单:如何监控定时任务
/cron
作业,其中数
据缺失是出错的征兆。
我们都曾有过这样的经历:备份没有执行并且几周都没人注意到。赶紧添加一些监控以防
再次出现这种情况……
因为大多数配置是成功后发送邮件或追加到日志中的,所以失败很容易被遗漏。处理数据
缺失的告警的一种方式是在原本没有数据的地方创建数据:
run-backup.sh 2>&1 backup.log || echo "Job failed" > backup.log
上面的写法会把脚本的
stderr
重定向到
stdout
中,并且把两者都写入
backup.log
。这需要脚
本实现可靠的错误处理。第二部分是真正的神奇之处——如果
run-backup.sh
完全失败,那
么
Job failed
会被记录到
backup.log
中。
一旦日志中有了这个数据,你就可以把它发送到你的日志管理系统并在这个数据上设置告警。
在某些情况下,这种办法没有用:不管出于什么原因,你无法将数据缺失转换为数据存
在。你真正需要的是能够检测数据不存在的功能。这种情况下的解决方案通常被称作 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java数据科学实战

Java数据科学实战

Michael R. Brzustowicz, PhD
可编程网络自动化

可编程网络自动化

Jason Edelman, Scott S. Lowe, Matt Oswalt
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115550750