[文章作者:张宴 本文版本: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技术 | 评论(369) | 引用(0) | 阅读(83035)
SEO SERVICES Email Homepage
2019-6-20 21:28
We are a top rated and professional SEO company in USA, offering Best Seo services for various types of businesses. We offer on page and off page SEO services, which are first rated to give you more results. Our SEO professionals are very smart to improve your website’s ranking easily.
richardherry Email Homepage
2019-6-21 13:00
There are so many different glitches can be encountered by you when you do print job with your Epson printer device. So, it is our advice to shake your hands with our tech-geeks via dialing the provided Epson Printer Support Number. We provide you cost-effective support services suiting your budget.
donaldgeorge Email Homepage
2019-6-25 17:23
Hii i am doanldgeorge and i am a senior technician in Quickbooks .If you face any technical issues in quickbooks then must diaL Quickbooks Support Phone Number to get an instant solutions.https://www.quickbookssupportphonenumber247.co/
Camilamartin Email Homepage
2019-6-27 15:22
Thank you for the good information that makes more knowledge. We provide quicken customer service 24/7 hours.http://restorationofspirit.com/profile/CamilaMartinhttps://www.thelaegotist.com/members/camilamartin/http://www.plimbi.c...
downloadcenter.trendmicro.com Email Homepage
2019-6-29 15:23
downloadcenter.trendmicro.com is the best website to install and activate trendmicro on your computer<a href="https://downloadcenter-trendmicro.com/">downloadcenter.trendmicro.com</a><a href="https://downloadcenter-trendmicro.com/trend-micro-download-center/">trend micro download center</a><a href="https://downloadcenter-trendmicro.com/trend-micro-exe-file-download/">trend micro exe file download</a>
markroy327@gmail.com Email Homepage
2019-7-3 14:57
Email Tech Support Number USA is one of growing third-party Email Support providing companies with guaranteed customer satisfaction. We offer 24×7 online customer support for all email inquiries and errors. We have an expert tech team who is updated with all the latest technology. Our mission is to create error-free email services and available for all your email inquiries.https://www.emailsupporthelplinenumber.us/aol-support-number-usa.htmlEmail Support Number
Dell Printer Support Email
2019-7-10 13:47
Thanks for all the tips mentioned in this article! it’s always good to read things you have heard before and are implementing, but from a different perspective, always pick up some extra bits of information. Visit@  Dell Printer Support
Brother Printer Support Email
2019-7-10 13:49
Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well writtenBrother Pprinter Support
Dell Printer Support Email
2019-7-10 13:51
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.Dell Printer Support
savana123 Email Homepage
2019-7-19 17:37
Norton security projects, for example, Norton 360 and Norton Web are available in the market. As we definitely realize that the antivirus applications from Norton are truly adept at checking, filtering and clearing PC security dangers, for the most part we state infections, Trojans and malware. Nonetheless, they even once in a while over compensate their occupations by erasing each document that is suspected. That is the means by which individuals' significant archives, pictures and some paid projects were cleared alongside the infection contaminated ones. All things considered we can recoup our lost information through Norton Online Reinforcement. It is an online information reinforcement administration that enables you to back up a limit of five PCs at a reasonable cost. It works with the two Macintosh and Windows PCs, and your information is protected and secure. For more help for Norton, you can visit our website Norton.com/setup.
savana123 Email Homepage
2019-7-19 17:39
In the event that issue happened in Microsoft office arrangement establishment or refreshing? We'll just help you to yourMicrosoft Office setup establishment. We are constantly prepared to give help to reclamation client investigating. Simply get the contact with us whenever and we can settle your inconveniences concerning ms office issues. We will glad to cure your everything issues, on the off chance that you in the front of issue, we'll constantly be with you to help you without fail. Presently those day's most guardians pay ton within recent memory on our CPU. PC has developed as the most urgent thingamajig to the utilization of step by step for work. All applications that have introduced our PC which permits in our canvases are Office.com/setup will help you always when you have to associate with us we'll be there for you.
savana123 Email Homepage
2019-7-22 19:36
The Webroot Antivirus is the strong antivirus software which provides ultimate protection for your PC. The free antivirus software defends your PC against viruses, threats, malware, spyware, ransom ware, and other online threats. You can download it from the given link www.webroot.com/safe
smith98 Email Homepage
2019-7-22 19:58
Norton Security Deluxe and Norton Security Premium are our top picks for the best internet security and premium security suites because of their high malware detection scores, overall value and large selection of security features.download norton security from norton.com/setup   and Protect Your Computer From Viruses & Malware
American Airlines Customer Service Number Email Homepage
2019-7-23 19:44
When you are traveling you expect everything to go according to your plan. But the problem is you never what is going to happen in the future. So the best way to prepare yourself is to have an American Airlines Customer Service Number. Once you do that you will be able to resolve the issues regarding American Airlines.
Epson Printer Service Email Homepage
2019-8-8 13:51
If your Epson Printer not working properly and you are facing  trouble on it, then visit our website and fix printer related every issues with well-trained tech professionals. Epson Printer Help
Dell Printer Support Email Homepage
2019-8-12 15:13
Dell Printer Support is a team of well experienced experts who takes care of your dell device problems. If face any problem with your device like your device is crashed, device is not working properly, paper jamming or others then contact at Dell Printer Support Phone Number and get instant help.
sofi Email Homepage
2019-8-22 17:58
Nowadays many webmail services are used by the individuals but few provide faster service and few provide slower service so if you are looking for faster email service then just once try Gmail as it is very too easy to Sign up Gmail 1-833-293-8333 and it also provides many additional features apart from email. Mostly all the browser supports Gmail so you can easily access your Gmail account by using any browser. Read more-https://www.customercare-email.net/sign-up-gmail/
Canon error code 5b00 Email Homepage
2019-8-23 16:53
“Avail the assistance from our experts to eradicate Canon error code 5b00” To Resolve Canon Printer Error Code 5b00 is not such a difficult task for you if you come across an error, and particularly when the continuous ink systems are being installed all the time. These tend to push the printers to their very limits. The error encounters on the canon printers when the inkpad absorber has filled up with the ink. If you are also dealing with the same issue with your Canon printer, follow some given steps. First of all, turn off your printer, then hold the “Resume” button subsequent by holding the power button. Now, release the Resume and Power button. After that, Reset Counter Absorber and at last switch on your printer. If these steps won’t satisfy you, go for Canon Support to eradicate Canon error code 5b00. Dial our toll-free number and take assistance from our experts.
JONAS57 Email Homepage
2019-8-23 17:41
Forgotten your Hotmail password and know unable to perform Hotmail forgot password recovery +1-855-479-3999 than the first check whether you have entered correct recovery details or not and then after that check the internet connection. If after performing the above measures you are unable to perform Hotmail forgot password recovery then take Hotmail help. https://www.mailsupportnumber.com/hotmail-change-password-recovery-reset.htmlhttps://www.mailsupportnumber.com/
分页: 8/19 第一页 上页 3 4 5 6 7 8 9 10 11 12 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]