[文章作者:张宴 本文版本: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) | 阅读(143986)
mj Email Homepage
2021-5-27 18:29
To begin the process of Office setup home student 2019, user should have an office account and office product key.  After that user will be able to complete the process of download, Install office home student 2019.Office.com/setup home & student 2019  
DisneyPlus.com/begin Email Homepage
2021-5-27 18:30
Disney Plus is a one-stop shop for all of your favorite Disney shows and movies. There’s plenty of programming from Pixar, Marvel Studios, and the Star Wars world, in addition to Disney is the most popular subscription channels in the world.DisneyPlus.com/begin  
Office.com/setup home & student 2019 Email Homepage
2021-5-27 18:31
Office.com/setup Home student 2019 is a collection of all Microsoft application software. In this, Word, Excel, PowerPoint, Outlook, and One Note are all included.Office.com/setup home & student 2019  
ganga Email Homepage
2021-5-28 01:19
A campaign management system (CMS) is a software solution designed to handle the various components of a marketing campaign.CMS
ganga Email Homepage
2021-5-28 01:20
Church software is any type of computer software specifically designed for use by a church. There are administrative packages tailored to handle membership databases and finances, and also worship presentation programs to generate images for video projectors.church
david230 Email
2021-5-31 13:40
Are you too busy to work on an assignment? or finding assignment services to complete the project, but you dont understand the topic? Sometimes youre just too tired from all the classes and exams, so an additional assignment was the straw that broke the camels back. If you encounter any obstacle with Do my assignment there is only one reasonable solution: hiring an assignment writing services.The fact that you can get professional My Assignment Help uk with your assignments goes to your advantage: you can always get the projects you need without missing the deadlines your professors imposed. No one will ever know that you relied on an expert writer, so you wont put your grade and academic record at risk. On the contrary; youll get a high grade and youll improve your own skills and knowledge in the topic youre supposed to work on.
darjeeling escort Email Homepage
2021-6-1 14:26
Bilaspur CALL GIRLS Surat CALL GIRLS Rajkot CALL GIRLS Junagadh CALL GIRLS Vadodara CALL GIRLS Chandigarh CALL GIRLS Faridabad CALL GIRLS Gurgaon CALL GIRLS Sonipat CALL GIRLS Panipat CALL GIRLS Ambala CALL GIRLS Chamba CALL GIRLS Ranchi CALL GIRLS Bokaro CALL GIRLS Deoghar CALL GIRLS Hazaribagh CALL GIRLS Dhanbad CALL GIRLS Mysore CALL GIRLS Dharwad CALL GIRLS Belgaum CALL GIRLS Thiruvananthapuram CALL GIRLS Kozhikode CALL GIRLS
shreedurgapg Email Homepage
2021-6-8 11:54
Thanks for publishing this details. I simply wish to let you know that I just look into your site and also I locate it really fascinating and useful.pg in gurgaon sohna road sector 49
Alex Bansk Email Homepage
2021-6-8 17:36
How To Fix ESET NOD32 Antivirus 0X101A Error Runtime Error 0x101A occurs when ESET NOD32 Antivirus crashes or stops functioning during its execution. This could allude to a glitch arising while getting implemented. This message can emerge anytime and without a preceding warning. This error would perturb continuously until this code is mitigated.Causes of this errorNo software is perfect and has a space for shortcomings. So encountering the Runtime Error 0x101A ESET NOD32 is common among ESET users. This issue could stem when there is a virus or malware in the system. But this error is not merely limited to virus infection, but could also occur due to other causes. When there are incompatible programs in the system, then also runtime error can occur. Also, a memory glitch can be another factor that could result in this issue. No matter what the cause of the problem is, it is important to resolve it immediately.Given below are some procedures to fix this issue.Method 1: Removal of incompatible programsRuntime errors primarily occur when there are conflicting programs. This procedure entails removing any such program.Open task manager on your system.Navigate to the Processes tab and close every running operation one by one.While turning it off check if the issue is resolved.If so, then this program is the one causing the issue.It is advisable to remove any such program.These are some ways to fix the ESET Error 0x101A. If these methods don’t work, please reach out to our ESET Antivirus Tech Support Number (806) 304-383 .https://antivirussupporthelpdesk.com/support-for-eset-antivirus
economicalcargopackers Email Homepage
2021-6-9 17:25
omkitchen Email Homepage
2021-6-10 17:03
Assignment Expert UK Email Homepage
2021-6-11 12:54
Allassignmenthelp offers assignment papers according to head writing format in the United Kingdom. Our assignment expert provides 24*7 online assignment services at an affordable cost. Also, you can ask us. , do my assignment online do my assignmentdo my assignment uk
jaibalajipackers Email Homepage
2021-6-15 20:20
Thanks for sharing. Always good to find a real expert.packers and movers in thanepackers and movers thanemovers and packers in thanemovers and packers thanehttps://jaibalajipackers.com/packers-and-movers-thane/
dpspackers Email Homepage
2021-6-16 20:27
I read this article! I hope you will continue to have such articles to share with everyone! thank you!
Do my Assignment USA Email Homepage
2021-6-17 17:00
Gotoassignmenthelp is team of leading professional writers for MyAssignmentHelp Writing Services to students all around the world. Contact us today for Best Assignment Experts at very affordable price. Under GotoAssignmentHelp we provide many types of help to the students. We are the most reliable assignment helpers. We have gained our specialization after spending most of our times in making ourselves perfect. We providing 100% plagiarism free Assignment Help. At the point when you pick our Math Homework Helper assistance, our faculty will consider the quality and your evaluation criteria.
shreebalaji packers Email Homepage
2021-6-18 00:21
I read this article! I hope you will continue to have such articles to share with everyone! thank you!packers and movers in thanepackers and movers thanemovers and packers in thane movers and packers thanehttp://packersandmoversthane.com/
shreebalaji packers Email Homepage
2021-6-18 00:22
I read this article! I hope you will continue to have such articles to share with everyone! thank you!packers and movers in thanepackers and movers thanemovers and packers in thane movers and packers thanehttp://packersandmoversthane.com/
分页: 26/54 第一页 上页 21 22 23 24 25 26 27 28 29 30 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]