[文章作者:张宴 本文版本: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技术 | 评论(1135) | 引用(0) | 阅读(180441)
Escorts in Lahore Email Homepage
2024-7-22 15:16
Welcome the best VIP Model Service in Islamabad pleases visit our website  https://lhrescorts.site/
escort in lahore Email
2024-7-26 18:54
If you want the best service with one Escort in Lahore , you've come to the right place. When it comes to Lahore one-on-one escorts, we offer the most advanced and private service. They'll make sure you have a great time.
karachi call girl Email
2024-7-26 19:07
Our karachi call girl will give you a lot of sex in bed and the best physical pleasure in bed. Get them to a secret place where you can spend the night and make love to them. Kiss them all over and rub your lips against their soft, pink, and smelly cheeks.
call girls islamabad Email
2024-7-26 19:18
Our guests keep coming back, and they always call us to talk about the scene, no matter what megacity they visit. If you're by yourself in a big city and getting hot in a hotel room. Our call girls islamabad are trained to make you feel amazing at a club, party, or DJ night.
Call Girls in Lahore Email Homepage
2024-7-26 20:18
Call Girls in Lahore is one of the utmost educated and trusted call girl agencies in Lahore that always take care of authentic and genuine gentlemen who want to enjoy the company of our high-class sexy call girls with respect and love. Our Lahore call girls are enough to experience and know how to please their guests that time, of course, we’re known for genuine and authentic hospitality.
Santa Banta Email Homepage
2024-7-30 18:23
I found best blog on google, For more information visit my site:- Amritsar escorts[url=http://googlesantabanta.com]
jack Email Homepage
2024-7-30 19:24
Select escorts is an Agency which is High Profile Call Girls in Kolkata. We do have Services in all over Kolkata and Kolkata is one of the enjoyable nights stand place where lots of Clubs Bar Disco and Pubs. We give VIP Escorts Services Kolkata like from first to end up process if u want to know details let me explain- Flights Tickets, Train Tickets, Hotels booking, and also cab service pick and drop facilities. Basically we give A to Z services to our clients.Do you have any special need party and enjoyments need in desires that you want to go thought into real and wonderful fun in Kolkata? Then you have the better and all special opportunity to make those all need and hot fun sexual fun to get serve to you on demand Kolkata Escorts and also on any other need to you with all passing and new height of making love making session to you at best price with me. As my name are select escorts, and all interest and queen to make your all hot fun imagination to make in al real involvements to you with Kolkata Escorts anytime. To get all amazing fun with all High Class Escorts Services in Kolkata, you have arrived the best place and for don’t wait when it comes to get stunning and sizzling hot fun to you in Kolkata. As Kolkata is the great of glamour’s and all special stylish desires and I am all available to compel your need very much to you at best price.https://selectescorts.net
Rawalpindi Escort Email Homepage
2024-8-22 16:08
We have the best Escorts Service in Rawalpindi and Escorts in Rawalpindi are available 24 x 7.Call Girls in Bahria Town Rawalpindi
Rawalpindi Escort Email Homepage
2024-8-22 16:10
We have the best Escorts Service in Rawalpindi and Escorts in Rawalpindi are available 24 x 7.Call Girls in Bahria Town Rawalpindi
Rawalpindi Escorts Email Homepage
2024-8-22 16:11
Rawalpindi Escorts Know You're Going to Love Sharing Your Intimate Moments With Our Escorts Girls, So Don't Think About it So Much and Call or Visit My Website For VIP Escorts Services in Rawalpindi. Come and Enjoy an Encounter Filled With Extreme Pleasure. Call Girls in Bahria Town Rawalpindi
Rawalpindi Escorts Email Homepage
2024-8-22 16:11
Rawalpindi Escorts Know You're Going to Love Sharing Your Intimate Moments With Our Escorts Girls, So Don't Think About it So Much and Call or Visit My Website For VIP Escorts Services in Rawalpindi. Call Girls in Bahria Town Rawalpindi
chandagulabo Email Homepage
2024-8-29 15:15
Nice post I found on Internet
simrankaur Email Homepage
2024-9-4 18:31
I am Simran, a talented and stunning escort available through our Escort Agency in Gurgaon. At 24, I'm full of energy, offering wild, passionate encounters tailored to your desires. Whether in-call or out-call, I ensure your comfort and exceed your expectations. Book now for an unforgettable experience with me. Escort Agency in Gurgaon
asd Email Homepage
2024-9-14 03:39
dsd Email Homepage
2024-9-14 03:41
Nadi astro center in china https://nadiastrocenter.com/agastya
dsd Email Homepage
2024-9-14 03:42
Zirakpur Escort Email Homepage
2024-9-16 19:12
Escorts Service in Ghatkopar!!!! Escorts Service in Gorai!!!! Escorts Service in Goregaon!!!! Escorts Service in Grant Road!!!! Escorts Service in Jogeshwari!!!! Escorts Service in Kandivali!!!! Escorts Service in Khar Road!!!! Escorts Service in Kharghar!!!! Escorts Service in Kurla!!!! Escorts Service in Lokhandwala!!!! Escorts Service in Mahim!!!! Escorts Service in Marine Lines!!!! Escorts Service in Marol!!!!
分页: 56/57 第一页 上页 51 52 53 54 55 56 57 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]