[文章作者:张宴 本文版本:v1.1 最后修改:2007.08.31 转载请注明出处:http://blog.zyan.cc]

  8月3日,我写了“Linux服务器监控系统 ServMon V1.0”,今天,ServMon V1.1 版本亮相。

  ServMon的原理是用shell脚本定时抓取被监控Linux服务器上的信息,再用curl POST到监控机的PHP接口程序上,由PHP接口程序对信息进行分析,如果存在异常,则发送报警邮件给管理员。报警邮件演示页面请见:http://blog.zyan.cc/read.php/276.htm

  点击在新窗口中浏览此图片

  ServMon V1.1 在 1.0 的基础上,增加了对Linux系统负载的监控,并编写了客户端自动安装包:

  1、被监控端服务器(Linux)
  (1)、下载并安装ServMon Client
引用
wget http://blog.zyan.cc/soft/linux/servmon/servmon-1.1.linux.tar.gz
tar zxvf servmon-1.1.linux.tar.gz
cd servmon-1.1
./install -i http://yourdomain/servmon/interface.php password

  注:此处的password为interface.php程序中设置的数据传输验证密码。

  客户端安装包源码:
  │
  ├─install
  ├─[src]
  │  ├─[bin]
  │  │  ├─diskstat_send
  │  │  ├─loadstat_send
  │  │  └─swapstat_send
  │  ├─[cron]
  │  │  └─servmon
  │  └─[data]

  屏幕演示:
  点击在新窗口中浏览此图片




  2、监控端服务器配置(Linux)
  (1)、启动sendmail
  /usr/sbin/sendmail -bd -q30m
  -b:指定Sendmail在后台运行,并且监听端口25的请求。
  -d:指定Sendmail以Daemon方式运行(守护进程)。
  -q:当Sendmail无法将邮件成功地发送到目的地时,它会将邮件保存在队列里。该参数指定邮件在队列里保存的时间。其中的30m表示保留30分钟。

  (2)、修改php.ini的[mail function]部分为以下内容,然后重启Apache,使PHP能够使用mail()函数发送电子邮件
引用
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i


  (4)、在MySQL上创建一个数据库servmon,然后在该数据库中执行以下SQL语句创建表:
引用
CREATE TABLE `tb_diskstat` (
 `ip` varchar(128) NOT NULL default '',
 `date` int(10) NOT NULL default '0',
 UNIQUE KEY `ip` (`ip`)
) TYPE=MyISAM;

  备注:这张表是PHP接口程序用来记录发送磁盘分区报警邮件的时间,避免在一段时间内重复发送大量报警邮件的。

  (3)、PHP接口程序
  http://yourdomain/servmon/interface.php


Tags:



技术大类 » 其他Unix技术 | 评论(1076) | 引用(0) | 阅读(143949)
Notary Ealing Email Homepage
2020-3-8 22:29
I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers
Nursing Writing Help Online Email Homepage
2020-3-13 14:42
It is important to seek help for all Nursing Coursework Writing Help Services needs from experienced writers for your Custom Nursing Assignment Services and Nursing Research Paper Writing Help Services.
Deno Email
2020-3-15 14:16
Computers and mobile devices were only used by few skilled people thus being too expensive and more complicated to use.  assignment helpassignment help
reinstalldesktopgold Email Homepage
2020-3-17 14:15
If you are facing any trouble with your AOL Desktop Gold for mac/Window. Get Contact Install AOL Gold Toll free Number or download AOL Desktop Gold link.Read more: - AOL Desktop Gold Install | Install AOL Desktop Gold for Mac
Avabrown Email Homepage
2020-3-18 14:43
Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.  vishnuyoga.ae/yoga-holidays-tours
Netflix help Email Homepage
2020-4-3 23:31
Are you experiencing some minor technical glitches with the service of late? Are you having trouble logging in to your Netflix account? Do you find it difficult to stream a particular movie or TV show? There is no need to press the panic button as we provide complete Netflix TV help to our customers.Netflix TV help
woodcarol19 Email Homepage
2020-4-8 16:44
Excellent information providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit the EssayCorp website, we providing thermodynamics assignment help at best prices ever.thermodynamics assignment help
EssayCorp Email Homepage
2020-4-16 18:05
Excellent information providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit the EssayCorp website, we providing chemistry assignment help at best prices ever.
KOLKATA QUEENS Email Homepage
2020-4-18 13:35
Kolkata escorts always try to provide the guys some outstanding escorts services; which can make any guy really happy and comfortable you can enjoy here at your demands you will feel that you are having some beautiful moments with the call girls in Kolkata.KOLKATA ESCORTSCALL GIRLS IN KOLKATA
isabill Email Homepage
2020-4-18 18:13
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking….Most beautiful places in the world ,.Bordeaux France ,Bali Indonesia
DAVID Email Homepage
2020-4-30 22:21
https://www.assistanceforall.com/services/antivirus-support/mcafee-support/Fast and easy McAfee activation helpMcAfee antivirus solutions are regarded as most advance and highly effective by the customers. If you have a McAfee antivirus inside your computer, you can breathe easy and forget all your worries about the safety and security of your system.You bought a license for McAfee and tried to install the antivirus on your computer? Is McAfee installer not working? Do not worry. We provide fast and easy McAfee activation help to our customers. Dual our toll free number 1-877-916-7666 from anywhere in the country and explain the problem to our qualified engineer. He will give you step by step instructions to activate and initiate your McAfee antivirus.
james Email Homepage
2020-5-2 12:22
we will only be grateful to the efficient ADT Security Services in Utah. Their systems are undoubtedly the simplest for the protection of our family.ADT Utah
james Email Homepage
2020-5-2 12:24
Fidelity warranty services and its affiliates provide many options to assist you to select the vehicle protection plan that's right for your needs. Learn more about how you'll protect yourself and your loved ones.Fidelity Warranty
att email Email Homepage
2020-5-3 12:03
Are you facing some difficulties with the serviced of the company in recent times? Is your connection lost at times or internet snaps without any signals? Whatever the problem, we have a solution for you. We provide genuine AT&T email technical support to our customers on phone.
Luca9080 Email Homepage
2020-5-4 17:03
See what representative’s state about what it resembles to work at American Auto Guardian. Compensations Discover organization look into, contender data, contact subtleties and budgetary information for American Guardian Warranty Services more information call us +1-833-831-9039
Peter007 Email Homepage
2020-5-4 19:03
See car shield reviews in Saint Peters, MO at 325 Mid Rivers Mall Dr from Angie's List individuals or join today to leave your own audit. Simply attempted to pursue carshield com utilizing your last name for the code any way they said Mr. Walters was not a genuine code lol simply joking. More information call us:- 1-877-393-3942
QuickBooks error 1603 Email Homepage
2020-5-8 18:33
We are a top-rated, reliable, and customer-oriented third-party QuickBooks support provider, having immense years of extensive experience, and depth knowledge of handling common errors associated to QuickBooks. If you are experiencing QuickBooks error 1603, our live QuickBooks professionals are always available to help you. This error code can take place, while installing QuickBooks desktop on your computer system. If you don’t have resolutions for this error code, our QuickBooks professionals are very experienced to sort out this error code permanently. Our live QuickBooks support services are the finest and quick to remove the worries of the QuickBooks users.https://www.quickbooksphonenumber.com/blog/quickbooks-error-1603-fix-installation-or-updating-html-error-status-1603/
hooeyapps Email Homepage
2020-5-9 23:59
For mobile users Android <a href="https://hooeyapps.com/">hooeyapps</a> market is a boon. Advanced mobile users make use of Android applications all over the world. There are numerous applications for Android enabled phone users. A lot of people are earning good money from Android application development. If you can develop an Android application yourself then it is best.文字
jasonry Email Homepage
2020-5-12 18:38
Homework help uk globally at all level academic. We work 24*7 for your convenience, so you don’t need to wait for any certain time, you can reach any time at our site, for any Assignment Help directly get into touch with our expert write college homework for me, you can concern directly with our Assignment Expert. UK assignment help websites in uk me at any time with good service and hire essay editor. https://www.allassignmenthelp.com/uk/https://www.allassignmenthelp.co.uk/java-assignment-help.htmlhttps://www.allassignm...
merinasusanti583 Email Homepage
2020-5-19 04:40
Hallo, teman-teman semua nya kami dari agen indowins ingin menawarkan berbagai jenis permainan dan bonus. whatshapp : +85587536868
分页: 13/54 第一页 上页 8 9 10 11 12 13 14 15 16 17 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]