[文章作者:张宴 本文版本: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技术 | 评论(1083) | 引用(0) | 阅读(145567)
mxcrm01 Email Homepage
2019-9-24 19:27
CRM Software is a strategy that helps streamline your employers qualified prospects, opportunities, appointments, earnings and service, by trying to keep buyer as centre of the process. CRM Software |  Online CRM Software |  CRM Software Development
installkaspersky Email Homepage
2019-9-25 14:32
install kaspersky with activation code | How to install and activate kaspersky on multiple computers•  Each copy of a multiple-device license for Kaspersky Anti-Virus 2019 (for example, a 3 PCs license) is installed and activated in the same way on all computers you want to protect.•  In conclusion to activate Kaspersky Internet Security 2019 on all computers, use one and the same activation code you purchased.<a href="https://installkaspersky.com/kaspersky-support-number/">kaspersky support number and Kaspersky Total Security Download</a><a href="https://installkaspersky.com/kaspersky-download-and-install">kaspersky installation</a><a href="https://installkaspersky.com/kaspersky-setup/">kaspersky setup</a><a href="https://installkaspersky.com">install kaspersky with activation code</a><a href="http://installkaspersky.com/kaspersky-code-activation">kaspersky code activation and kaspersky lab</a><a href="https://installkaspersky.com/geek-squad-kaspersky-activation-code">Geek squad kaspersky activation code</a>
installvipre Email Homepage
2019-9-28 15:53
garmin maps Email Homepage
2019-9-28 16:32
jmaes124smith Email Homepage
2019-9-29 18:22
nice blog thanks for shring very useful information.
jonas57 Email Homepage
2019-10-5 19:12
Unable to Sign Up on Netflix than call at Netflix customer service numberWant to Sign Up on Netflix but not able to so than just simply contact at Netflix customer service number i.e. 1-833-293-1333. You can contact customer service whenever you feel free as we are 24/7 accessible to support the valuable clients. Now see your own choice of TV shows, web series, and movies on Netflix. Our specialists will accommodate you in fixing your problems within no time. https://www.pcmonks.net/netflix-customer-service-phone-number.htmlhttps://www.pcmonks.net/netflix-customer-service-phone-number.html
sTEVE Email Homepage
2019-10-6 16:53
Computer Repair in Shalimar BaghComputer Repair In PitampuraSeo services In Shalimar BaghBest Gym In Shalimar Bagh
sTEVE Email Homepage
2019-10-6 16:54
Computer Repair in Shalimar BaghComputer Repair In PitampuraSeo services In Shalimar BaghBest Gym In Shalimar Bagh
samsung printer installer Email Homepage
2019-10-11 19:55
Require printer software for your device? Software printer Software Installer will do the needful for you. The installer will download and print software for your device. visit samsung printer installer to download the Software printer Software Installer.
james1789smith Email
2019-10-14 23:02
Worry about how to become an SEO specialist? Hire the best SEO expert for your business if you really want to rank your business over Google. Because the best SEO company can provide the best and quality services for your business at very affordable prices. SEO and its services ie eMarketing Blogger. If you do not know anything about the SEO services and want to know about them then go for a blog.
james smith Email Homepage
2019-10-19 15:08
For Gmail help avail Gmail customer serviceIs your Gmail app creating trouble on the iPhone device? To get a proper technical solution, you need to contact us for availing of the Gmail customer service. Our team is there to help you out from every sort of technical problem. Right from listening to the users and providing the exact solution, we do everything for the Gmail users. https://www.pcmonks.net/gmail-customer-service.htmlhttps://www.pcmonks.net/gmail-customer-service.htmlhttps://www.pcmonks.net/gmail-customer-service.html
downloadcenter-trendmicro Email Homepage
2019-10-22 20:09
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>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>
Mcafee.Com/Activate Email Homepage
2019-10-30 17:40
Is your McAfee Antivirus expired or about to expire? Then it is the right time to act fast to activate your antivirus as quickly as possible. In the times of harmful virus attacks and cyber-attacks, it is significant to keep your system safe and running. Therefore, it is better to adapt the ways to activate, as not doing so will surely make your system vulnerable against various threats. If you are not acquainted with the right procedure for activating McAfee antivirus, then you should visit Mcafee.Com/Activate or consider taking help from McAfee support team. At here, you will get the chance to meet with deft team of technicians who will assist you out in doing the needful. https://l-mcafeecomactivate.com/
McAfee.com/activate Email Homepage
2019-11-1 18:21
McAfee activate - Simple Steps to Activate McAfee using McAfee Activate Product Key mentioned at the back of McAfee Retail card. McAfee Activate Now.http://www.mcafeeactivates.uk/
james smith Email Homepage
2019-11-5 19:09
Make Google Homepage for Using Faster Service  Make a Google Homepage for using faster service and for exercising the Google additional features. By building Google as your homepage you can simply and instantly can add an extension and bookmark the links. If you need any supervision concerning building Google homepage then just avail Gmail Help as they will support you in solving your doubt related to Gmail. https://google-homepage.mailsupportnumber.com/
preeti123 Email
2019-11-13 17:50
Event Ticketing: You can sell tickets online of concerts and events online through event ticketing system where you can register your events through these sites add the number of available tickets, seating arrangements, and prices as per the seating.
edwardpitt Email Homepage
2019-11-13 17:59
Looking for D-Link Support UK, visit on:dlink.support
james smith Email Homepage
2019-11-18 15:09
Get the Proper Answer to Your Queries Via Gmail Support Number Anytime•         How to fix login problems of Gmail?•         How do I get to know whether my Google mail account is safe or not?•         What to do to fix Gmail setting related problems?•         How do I get rid of password problems?   Simply, by making a call at our Gmail Support number, you will get the proper answer along with the one stop solution. https://www.yahoohome-page.com/gmail-support-phone-number/
james smith Email Homepage
2019-11-28 17:10
Resolve Your Query on Yahoo Homepage by Yahoo Customer Service For the Yahoo Homepage, you’ll need to look for solutions online first. Try solving it on your own. If still, you are not that successful after following the steps then it would be preferable to make a call at on our yahoo customer care service number. They will resolve every query of your instantly without any delay or obstruction. Immediately dial our number as we are available 24/7. https://www.yahoohome-page.com/yahoo-support-phone-number/
分页: 10/55 第一页 上页 5 6 7 8 9 10 11 12 13 14 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]