[文章作者:张宴 本文版本: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技术 | 评论(154) | 引用(0) | 阅读(69039)
5fp0y Email Homepage
2019-3-1 19:22
5fp0y
david05 Email Homepage
2019-3-2 14:35
https://www.google.com<a href="https://www.google.com">keyword</a>keywordkeyword[www.google.com](keyword)
celinewilliams Email Homepage
2019-3-22 16:44
A printer is one of the prominent output devices that are needed for a computer for printing out the documents. It is used for output documents such as images or word documents. All the computers are incomplete without a printer.call the Brother Printer support phone number, and you will get several certified professionals.Dell printer support
SahibKumarKhan Email
2019-4-9 15:21
SahibKumarKhan
dragon dictation Email Homepage
2019-4-15 15:39
This is really helpful post and very informative there is no doubt about it. I found this one pretty fascinating and it should go into my collection. Very good work! http://www.onlinecomputersolution.comhttp://pogogamehelpline.comhttp://nortonsetup.store
vfgjfhyjit Email Homepage
2019-4-20 19:05
roy rahul Email
2019-4-25 14:30
Nice Post!! Hey Guys, Are you facing problems in Printer, Take help of Printer Support Number. At here, we provide you online technical help for your Printer Setup call toll-free and get quick help. https://printersupporthelplinenumber.us/love
royveer Email
2019-4-25 14:33
Thank you for sending great information. Your website is very cool. I admire the details you have on this website. You will see that you understand this topic well. Bookmarked on the page of this website and extra articles will come back. You, my friend, rock! I found the information I was looking for somewhere already. It was not easy to find it. What a wonderful website.Email Support numberhttps://emailsupporthelplinenumber.us/zan
ashu Email Homepage
2019-4-27 14:35
ashu Email Homepage
2019-4-27 14:36
mywifiext local Email Homepage
2019-5-1 14:03
printer
2019-5-4 15:27
Antivirus Support Helpline Number USA is third-party antivirus support providing service to prevent and protect your personal computers, laptops, and mobile applications from computer viruses. We offer guaranteed antivirus support through call, chat and remote access across. We have an extremely qualified tech support team to serve the best antivirus support 24x7. We troubleshoot all antivirus software issues and provide assistance for antivirus programmes include Avast Antivirus, AVG Antivirus, Norton Antivirus, Kaspersky Antivirus, McAfee Antivirus, AOL Active Virus Shield, ESET Antivirus, and Panda Cloud Antivirus, etc.https://www.antivirussupporthelplinenumber.us/Antivirus Support number
Eva Smith Email Homepage
2019-5-6 17:18
Epson Printer is the one of the best printer company in the world. Epson printers have too many customers across the globe. But Some Time People Facing Several Types of Error Who is really irritating. And that’s time people need professional help and we providing a technical support for Epson Printer. We have Microsoft certified professional team who are able to solve any problem of your Epson Printer. Just Dial Our Epson Printer Toll Free Number 1-800-436-0509 USA/CA. And Get Free Supporthttps://www.epsonprintersupportnumber.com/
ContactYahoohelpdesk Email Homepage
2019-5-11 15:06
Our Yahoo Mail Customer service offering the services about Account recovery solution, Instant Yahoo Mail Password Recovery, Remove Yahoo hacked email account, recover delete emails in yahoo like as other solutions. We are ready to offer 24*7 services for our clients.https://www.contactyahoohelpdesk.com/yahoo-account-recovery/
JENIFFER
2019-6-8 13:30
Nowadays Imagining work without printers seems too old-fashioned because printers have newly become an essential  computer minor which is used in home and offices for printing photos, documents, presentation, images, logos, school  projects and many more.Have you any doubt regarding Printer and you want to clear all the doubts then you should click here: Epson Printer Support | Canon Printer Support | Lexmark Printer Support | HP Printer Support
ASHLEY
2019-6-8 13:32
Want to install Webroot Antivirus into your device but you are facing any issue with this process then no need to worry just link up with Webroot Support  Experts and get the instant solution for your issue.
Rondalee Email Homepage
2019-6-10 15:22
we are providing to our Customer how to contact yahoo mail support facility and we also working on some critical issues related with yahoo as Instant Yahoo mail Password Recovery, instant all yahoo temporary errors, Spam mail removal support, recovery of Blocked account support and all these issues can resolve by phone or email.https://www.contactyahoohelpdesk.com/contact-yahoo-helpdesk/
Activate Avg Email Homepage
2019-6-11 13:57
Activate Avg on your mac and pc.When you activate avg antivirus, it protects your device from unwanted threats and spywares. Below mentioned are the services provided by avg activation<a href="https://activationavg.com/">activation.avg.com</a><a href="https://activationavg.com/avg-activation-code/">download and install avg ultimate</a><a href="https://activationavg.com/avg-activation-page/">activate avg without cd</a><a href="https://activationavg.com/avg-retail-activation/">avg.com/retail</a><a href="https://activationavg.com/avg-ultimate-activation/">avg retail installation</a>https://activationavg.com/http://activationavg.com/
Martinlutharz Email Homepage
2019-6-19 15:49
From last couple of months, I am working with https://www.applesupportphonenumber.co/ team and eliminating customer’s problems at ease. If you want to know about my service, then you see the happy faces of customers who take services at their door steps. At this support, not only me but my whole team is available all the time and working efficiently to provide best-in-class service. Thus, if you need guidance in getting rid of your Apple device’s issues, then you can call at Apple support number +1-800-692-7753  which is also reachable throughout the day and night.
分页: 7/8 第一页 上页 2 3 4 5 6 7 8 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]