[文章作者:张宴 本文版本: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技术 | 评论(784) | 引用(0) | 阅读(108699)
Lane Homepage
2020-12-18 14:44
Facebook accompanies numerous highlights to make it simple to use as per you. Square is a component of Facebook, where you can impede any of your companion list or some other whom you need. When you do it, at that point that specific individual not ready to see your profile or any action on Facebook. In the event that you can't hinder somebody on Facebook, at that point you need to affirm, you are associated with the solid web association, and you entered the right name. On the off chance that you actually can't do this, at that point go towards does Facebook have chat support to fix it in a quicker way.
research proposal help Email Homepage
2020-12-19 14:45
If you are looking for a professional research proposal help service, you have landed at the right destination. We are a leading assignment help writing service that aims to support aspirants of high school, universities, and colleges with every one of their writing requirements.
alexjones Email
2020-12-28 14:30
Make Delta AirLines Reservations within the US for domestic flight tickets reservation and for international worldwide destinations like UK, Canada, etc. Book Delta AirLine Tickets and Find all the necessary information to book a flight with Delta Air Lines. Visit on the given links for flight booking:delta airlines reservations usadelta airlines reservationdelta airline reservationsdelta book a flight
caitlinstasey Email Homepage
2021-1-4 17:13
When facing some kind of customer service question, most Netflix users start with the Netflix Help Page, plus information about the expected turnaround time to find support for your specific problem. You can contact our Netflix Customer Service Phone Number at +1877-209-1629 if you can't receive them on the call or the wait is too long. Often you need the assistance of someone from the customer service department when browsing through different help topics on help.netflix.com, in which case they can turn to email as the mode of communication. As an effect, the expected turnaround to address the issue becomes a little slower. Without having any response from the Netflix customer service team, you could face several hours or a day. Therefore, using 4 different types of media, i.e. phone, talk, web and twitter, you can contact Netflix customer service.Netflix Phone NumberSpirit Airlines Phone Number
webrott.com/safe Email
2021-1-6 13:11
Webroot and Geek Squad have partnered, so visit www.webroot.com/safe for Webroot download. Here, enter the product key and email associated with Webroot login. Get affordable and award-winning security from webroot.com/safe and fix all the threats.
jiseh Email Homepage
2021-1-6 20:19
Good post thanks for share information. https://edublackboards.com/uml-blackboard/
Alice Cook Email Homepage
2021-1-20 13:13
If you have been facing the TurboTax update error and you are not able to update TT, make sure that you have switched to a stable source of internet connection. And, if you still notice that TurboTax update not working properly, you should remember to run the disc cleaner tool, followed by manually updating the TurboTax software for both the version, TurboTax for Windows and TurboTax for Mac.For more details: https://contactforhelp.com/turbotax/
ssd Email Homepage
2021-1-28 18:26
https://printersupportdesk.us/https://printersupportdesk.us/
Assignment Help Email
2021-1-30 18:08
Gotoassignmenthelp is team of leading professional writers for Assignment Help Writing Services to students all around the world. Contact us today for Best Assignment Help Washington 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 MyAssignmentHelp assistance, our faculty will consider the quality and your evaluation criteria.
canon Email
2021-1-30 18:39
canon offers multiple benefits that you can receive from a Canon inkjet printer. You can also get Canon printer support from canon site with the direct chat option. ij.start canon , ij.start.canon ,
ij.start canon Email Homepage
2021-1-30 18:45
The driver is customizable based on your printing need. It is a complete package that contains many software applications for printing, scanning, auto-driver installation and many more.ij.start canon | ij.start canon | ij.start canon
poojakaur3435 Email
2021-2-10 14:46
Guys, you have reached to the home page of a professional escort agency working in Tirupati where you can find high-quality escort service in Tirupati offered by trustworthy girls. Here you meet genuinely high-class escort models who look extremely sexy and lovable. These pretty girls give you smooth relaxation during your stay in Tirupati and serve you with best of their talent.Visit us:- https://www.streetgirls.in/tirupati-escorts-serviceTwitter:- https://twitter.com/bangaloregirl24
joe Email
2021-2-12 20:15
I was looking for this information from enough time and now I reached your website. It's really good content. Thanks for writing such nice content for us. hope to see you again. Brother hl-2280dw Wireless Setup
smiths299 Email Homepage
2021-2-13 14:09
Amazing blog! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work. Thank you for this wonderful Blog! Using Dell printers and during usage got this Dell Printer Error Code 092-670? dont get hesitate or confused just visit us and follow our blog as well contact us on our toll-free number we had an amazing team for 24*7 support.https://www.delltechnicalsupportnumber.com/blog/how-to-fix-dell-printer-error-code-092-670/
Bruce Email Homepage
2021-2-13 18:13
An excellent resource of information I will certainly return to check on the latest posts. Are you not able to fix the problem with the Canon Printer? Just follow the steps which are mention on the blog to resolve the issue. Thanks! Canon Printer Printing Blank Pages
Agra Escorts Email Homepage
2021-2-17 17:06
Hi Guys! I am Anaisha Ved working girl from Agra. Once more present with the latest information in joining with your deep desire to call girls. As always I've brought new stuff of 18+ Agra call girls ready to satiate your hunger for sexy companionship. Just click the links for Booking.
trend micro activate Email
2021-2-26 17:27
Enter Trend micro activation code on www.trendmicro.com/activate to download and activate Trend Micro. To activate Trend micro activate, make sure you already have an activation code that you’ll probably enter on the trend micro site.
http //ij.start.canon Email
2021-3-1 14:48
http //ij.start.canon or in short ij.start.canon offers you to install the latest version of the Canon printer software. If you search for ij.start canon, you can see the options yourself, including Manuals, recommended functions
Henry Carey Email Homepage
2021-3-1 20:06
If you wish to keep your PC safe from threats like virus, Trojans, and malware, then McAfee antivirus software is your best choice. McAfee is a well-known and trusted America based multinational organization which produces and sells antivirus software for protection against malware. Mcafee.com/activate | Macfee.com/activate
Max Turner Email Homepage
2021-3-1 20:08
McAfee program is an antivirus that protects you from each risky site, dangerous virus. Security shield is important in every aspect, as you use the internet, social media, business, banking, shopping, and more.mcafee.cm/activate | Macfee.com/activate
分页: 22/40 第一页 上页 17 18 19 20 21 22 23 24 25 26 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]