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
    • 最新
    • 标签
主页 / server / 问题 / 104965
In Process
Arpanet
Arpanet
Asked: 2010-01-22 04:17:55 +0800 CST2010-01-22 04:17:55 +0800 CST 2010-01-22 04:17:55 +0800 CST

磁盘空间不足电子邮件警报

  • 772

很简单,我试图从 Windows 2003 服务器触发电子邮件警报,告诉我磁盘空间何时不足。

有没有人有设置这个的经验?

谢谢你。

windows-server-2003 email alerts
  • 4 4 个回答
  • 6367 Views

4 个回答

  • Voted
  1. John Gardeniers
    2010-01-22T12:42:03+08:002010-01-22T12:42:03+08:00

    与其只为这一项创建警报,不如考虑设置 Nagios 或类似的。然后,您可以让它监控您喜欢的任何东西,并在超出您的预定义参数时提醒您。通过将您从手动监控和检查中解放出来,设置它所需的相对较少的时间将超过回报。

    • 3
  2. user1804
    2010-01-22T09:46:22+08:002010-01-22T09:46:22+08:00

    几个选项:

    a) 安装监控代理(例如 nsclient++)并让监控系统(例如 Nagios)对其进行监控,并在磁盘空间不足时提醒您;

    b) 创建一个每分钟触发一次的计划任务,读取相应的 WMI 计数器(例如 \\LogicalDisk(C:)\\Free Megabytes)并使用 CDO.Message WScript 对象发送邮件(示例:http://blogs .technet.com/heyscriptingguy/archive/2004/11/29/how-can-i-attach-a-file-to-an-email-sent-using-cdo.aspx)

    • 2
  3. natxo asenjo
    2010-01-23T04:37:41+08:002010-01-23T04:37:41+08:00

    +1 用于 nagios(或类似 opsview 的衍生产品)和 nsclient++。如果您了解脚本,您可以轻松地为您可能需要的任何内容编写自己的自定义插件。

    如果您还没有监控,现在就开始吧!

    • 0
  4. Mike L
    2010-01-23T06:50:39+08:002010-01-23T06:50:39+08:00

    请参阅此处:Microsoft KB 324796

    我在我们的环境中使用它,效果很好。您确实需要一个 SMTP 服务器来发送消息,但它不必是同一个框。

    我会检查内存不足(每 5 分钟检查一次以查看可用内存是否低于 100 MB)、处理器监视器(每 30 秒检查一次以确保处理器未运行超过 95%)和磁盘空间不足(每 30 分钟检查一次磁盘空间不低于 20%)。它们非常容易添加,我没有遇到任何问题。

    这是我收到的有关 CPU 使用率高的警报的 VBScript 文件。如有必要,您可以修改脚本以包含凭据:

    ' Get command line parameters
    Dim ArgObj
    Set ArgObj = WScript.Arguments 
    Dim strFrom, strTo, strSubject, strBody, strIPAddress
    strFrom = "SERVERNA<E <mail@companyemail.com>"
    strTo = "RECIPIENT <person@companyemail.com>"
    strSubject = "Automated CPU Alert from SERVERNAME"
    strIPAddress = "IPADDRESS"
    
    ' get the body from the command line
    If ArgObj.Count > 0 Then
    strBody = ArgObj( 0 )
    
    ' if the subject is specified as an argument then add it
    If ArgObj.Count > 1 Then
    strSubject = ArgObj( 1 )
    End If
    Else
    strBody = "Default alert message body" 
    End if
    
    Call SendEmail( strFrom, strTo, strSubject, strBody )
    
    ' release memory
    Set ArgObj = Nothing
    
    ' Sub-routing to send an e-mail using the CDO component
    Sub SendEmail(sFromEmail, sToEmail, sSubject, sText )
    
    Dim objMail
    Set objMail = CreateObject( "CDO.Message" )
    objMail.From = sFromEmail
    objMail.To = sToEmail
    objMail.Subject = sSubject
    
    ' Send using an SMTP server
    objMail.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/sendusing" ) = 2
    
    ' Name or IP of remote SMTP server
    objMail.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ) = strIPAddress
    
    ' Server port
    objMail.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ) = 25 
    
    objMail.Configuration.Fields.Update
    objMail.TextBody = sText
    objMail.Send
    
    Set objMail = nothing
    
    End Sub
    
    • 0

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 从 2003 年迁移到 2008 年 Microsoft 群集技术

  • 有什么理由使用 Windows Server 2003 而不是 Server 2008?

  • Exchange 2007 的备份解决方案

  • 在 Windows Server 2003 下使用 wscipt 从 .asp 文件运行 .exe

Sidebar

Stats

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

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

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

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

    • 9 个回答
  • Marko Smith

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

    • 3 个回答
  • Marko Smith

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

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +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