[文章作者:张宴 本文版本: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) | 阅读(143939)
DelhiEscorts Email Homepage
2022-8-29 23:07
Top sexy babes are highly professional in dealing with their customers. Luxury escort service in Noida Delhi give you uttermost joy and satisfaction for fun night and you can enjoy your journey with the best experience you have encountered. Book Noida Escort Service:<a href="https://escortsfashion.com/call-girls-in-noida">Noida delhi escorts</a><a href="https://escortsfashion.com/call-girls-in-noida">noida escort service</a>From Being Trusting To Hiring the Delhi NCR Escorts Symbolizes Genuine Online Booking:1-  <a href="https://www.promorapid.com/read-blog/273904">Delhi-NCR-Escorts</a>2-  <a href="https://site-7985810-9271-1140.mystrikingly.com/blog/from-being-trustingto-hiring-the-delhi-ncr-escorts-symbolizes-genui... 3-  <a href="https://site-7985810-9271-1140.mystrikingly.com">Call-Girls-Delhi-NCR</a>4-  <a href="https://sites.google.com/view/ncr-escorts/call-girls-in-delhi-ncr">Call-Girls-Delhi-NCR</a>https://escortsfashion.com/call-girls-in-noidahttps://escortsfashion.com/call-girls-in-noidahttps://escortsfashion.com/call-girls-in-noida
DelhiEscorts Email Homepage
2022-8-29 23:10
Top sexy babes are highly professional in dealing with their customers. Luxury escort service in Noida Delhi give you uttermost joy and satisfaction for fun night and you can enjoy your journey with the best experience you have encountered. Book Noida Escort Service:https://escortsfashion.com/call-girls-in-noida
Denice Email
2022-9-2 23:52
A well-designed website not only builds a positive brand impression but also is important to drive organic traffic and boost sales. As a website designer, you have to focus on structure, presentation, user-friendly navigation, and aesthetic appeal. To build an effective design, you need good knowledge of PHP, HTML, XML, and JavaScript along with professional expertise. With such complexities and a lack of knowledge of tools to check the website performance, students prefer web design homework help. Assignment Global is the most reliable website popular among students for offering the best value at affordable prices.
Benmayes230 Email
2022-9-3 01:56
Manochikitsa is an organisation that has the goal of bettering people     & their lives and works hard toward that end by providing the Best Online Counselling in India. Everyone has a desire for someone who will just listen to them. An someone who is able to listen without passing judgement, comprehend, and maybe even contribute to the process of finding a solution. a resolution to the many ambiguities, challenging circumstances, or significant choices that each one of us must face at every stage of our lives at some point in time. We work hard to become that instrument.
florimapaul Email Homepage
2022-9-3 16:24
Hello Everyone I am Florima Paul and Delhi Escort and a fantastic person to meet. You can enjoy your night or a day in vacation with me. My charges for meet is very expensive so think before book me as a companion in delhi. i am a delhi girl who are love to enjoy every moment of life and never think what people think about me.Delhi Escort
Priya Batra Email Homepage
2022-9-3 16:39
I am Priya Batra an High Class Mumbai Escorts  Provide special service to genuine clientshousewife escort mumbai
Mumbai Divas Email Homepage
2022-9-3 16:51
Mumbai Escort Agency is offer the most valuable Juhu Escorts and give the value of your money that you spend on our escort girl, our girls give you full satisfaction and makes you happy. Our contact and whatsapp number is :- +91-9920046978  and mail is is :- info@mumbai-escorts.info Russian Mumbai Escorts
Ritika Email Homepage
2022-9-3 16:55
Meet Ritika Kothari an Extra Ordinary Top Class Model Escorts in South Goa Escorts Who Give the best service that you can get from any other goa escorts..High Class Goa Escorts
Anusa Email Homepage
2022-9-3 16:57
Goa Escorts.co is a premier escort agency providing top exclusive Goa Indian Escorts campaigns here. Our decent ladies are available all the time for you to enjoy the most desirable moments in the life. Goa escorts is the most prominant place to find the elegant and few extra ordinary escorts services. We offer both incall and Outcall services in Goa.  Mail now :- booking@goaescorts.co Goa High Profile Escorts
Top VIP Girls Email Homepage
2022-9-3 16:59
Singapore is very famous place where lots of people likes to come and stay and enjoy holidays or enjoy their life. They think of coming here for fun and enjoyment. Actually, Singapore is only place which can provide entertainment up to the level that the people are seeking. Independent Singapore Escorts are playing very essential role to make the moments which we splurge here fully unforgettable. Singapore is the main desirability for young people and bachelors who want lots of fun and joy in their life and Singapore Escorts are the best companion for them. Call +65-0000000000. Private Incall Escorts in Singapore
Manali Email Homepage
2022-9-14 00:02
you will get while searching for the profiles of escort agencies at our agency girls' profile, they also mention that they are an agency, independent, club or massage centre.Ahmedabad Escort || Jodhpur Escort
Payal Manali Email Homepage
2022-9-14 00:05
you will get while searching for the profiles of escort agencies at our agency Escorts in Manali profile, they also mention that they are an agency, independent, Manali Escorts Service club or massage centre,
Peekay Email Homepage
2022-9-15 19:00
Thank you for the valuable information
selinashetty Email Homepage
2022-9-20 15:13
nice !! keep it up you are doing really great. but, it’s possible that the comments are considered as spam in this new google update ???<a href="http://www.selinashetty.com/cheap-rate-escorts-delhi.html">Delhi Cheap Escorts</a><br>
selinashetty Email Homepage
2022-9-20 15:40
nice !! keep it up you are doing really great. but, it’s possible that the comments are considered as spam in this new google update ???Independent Delhi Escorts
Pinki Email Homepage
2022-9-20 15:42
I read this post your post so nice and very informative post thanks for sharing this post... Female Escorts in kolkata
Pinki Email Homepage
2022-9-20 15:43
I read this post your post so nice and very informative post thanks for sharing this post... Female Escorts in Kolkata
diptisinha303 Email Homepage
2022-9-20 15:44
very well explained, comments really do help us in gaining backlinks but we should always be careful about what we write in our comments..Pune Escorts Photos
sinha1kavya Email Homepage
2022-9-20 15:46
Actively commenting and being on a conversation with some cool topics always helps in building good backlinks..Mumbai Russian Escorts
kalyugkilaila Email Homepage
2022-9-20 15:48
Enjoyed reading the article above , really explains everything in detail, the article is very interesting and effective. Thank you and good luck in the upcoming articles..Escorts in Kharghar
分页: 41/54 第一页 上页 36 37 38 39 40 41 42 43 44 45 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]