[文章作者:张宴 本文版本: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技术 | 评论(1138) | 引用(0) | 阅读(185072)
rubyrajput Email
2023-8-1 18:01
Goa is clearly where you will see yourself as satisfied. Unexpectedly, your totally regard Goa Call Girls Number is isolated until you experience the impacted female escorts in Goa. In any case, you can clearly see the value in various enchanting and splendid activities.
preeti Email Homepage
2023-8-1 18:24
Our stylish & professional female Escorts in Goa, understand the needs of the people looking to taste physical pleasure unleashed by the hottest courtesans from every inch of their voluptuous bodies. We have a pool of the most stunning high profile call girls in , who are well-versed with all the techniques of seduction and charming for their romantic clients in the best possible way like striptease, massages, role play and erotic dance in  clubs.
Heena Email Homepage
2023-8-1 20:27
These call girls have received training and are skilled at meeting the needs of their customers. These beautiful and lustful call girls are divas. Working a 9-to-5 job with a constant group of the same people has become tedious for many people across the country. When you want to unwind, the ideal Call Girl in Goa City will be the first person you think of.
preeti Email
2023-8-3 13:32
they didn't get that pleasure due to some reasons. As a results, Escorts in Ludhiana   began to feel depressed and lost their feelings and emotions in young age. If you are one of them and want to regain yourself, look no further than our gorgeous call girls in .
kallibo Email Homepage
2023-8-4 11:00
Ready for an exhilarating challenge? Ever heard of the only up game? Can you conquer the constantly changing landscapes, obstacles, and rewards? Brace yourself for an addictive adventure where you climb, jump, and explore upwards. Can you reach the pinnacle and claim victory in Only Up? Dare to ascend!
Call Girls in Goa Email Homepage
2023-8-4 18:50
The horny females are super-friendly and sweet in dealing with customers. Their elegance and curvy bring many imaginations to the mind of clients. Imagine what you can do with such alluring Call Girls in Goa .
preeti Email Homepage
2023-8-7 18:39
We have achieved an enviable reputation for ourselves by letting our customers meet the  of their dreams. Our college call girls turn the dream of clients into reality by making love and best Escorts in Goa for real time girlfriend experience to them in the most effective way.
Shreya Email Homepage
2023-8-9 14:16
You can plan your stay with any of our gorgeous babes and keep your lips lock with her juicy lips. Find the best match for your needs by calling Call Girls in Delhi . We assure your satisfaction by adding new features and a new face in our services. You will get everything here that you had dreamed of.
AKASH Email Homepage
2023-8-10 15:01
这是一条隐藏评论或留言。您需要以合适的身份登入后才能看到。
AKASH Email Homepage
2023-8-10 15:02
Swarna Email
2023-8-11 14:38
Some other agencies also provide http://www.escortserviceinaerocity.in/ for longer durations according to customers' demands, staying with the client or traveling on a holiday or business trip anywhere in India.
henryjame012 Email Homepage
2023-8-12 19:15
thanks for sharing your articlehttps://www.heptopic.com/
henryjame012 Email Homepage
2023-8-12 19:17
Thanks for sharing your article https://www.heptopic.com/
Delhi Escorts Email Homepage
2023-8-19 17:33
If you’re searching for amusement here so what could be better than appointing an escort in Delhi?. There is a range of glamorous call girls in Delhi those are outstanding not only for their charismatic figure, but also for their great sense of humour.
Escorts In Delhi Email Homepage
2023-8-19 17:59
We know to delight you with the best and to give you the pleasure that you required previously. Our female escorts in Delhi literally mean angels because they grasp the ability to fulfill your dreams.
Delhi Escorts Service Email Homepage
2023-8-19 18:19
If you have been alone for a long time, so your time has started. We are here to introduce the most essential services in Delhi to you. Yes, we are discussing over escort services in Delhi, which has an empire of the cutest girls of the town.
Delhi Call Girls Email Homepage
2023-8-19 19:21
If your trip is scheduled for a long time then you must add these pilgrimages into the list of your visiting destinations. You can appoint an independent Delhi escorts and explore the beauty of the town while accompanying a gorgeous girl. You don’t need to hesitate while calling us because we understand your needs perfectly.
Pune Escorts Email Homepage
2023-8-26 22:03
Pune Escorts our girls will reach your hotel room and home within minutes of confirming your booking. You will love the climate and the viewpoints just as you should book supreme female model girls that will satisfy every one of your dreams. Pune Escorts' Best Servicehttps://www.puneescortstars.com
메이저사이트 Email Homepage
2023-9-5 11:24
How amazing this article is. In my opinion, every paragraph is well explained so I could easily understand.  I can also share my opinion here. 메이저사이트
Akshat Email Homepage
2023-9-6 13:41
The vibrant nightlife and amusement parks are unmissable. There are historical palaces, museums, and monuments for tourists to explore with Russian Escort Delhi. It means Delhi has everything that a tourist craves on vacation.
分页: 50/57 第一页 上页 45 46 47 48 49 50 51 52 53 54 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]