[文章作者:张宴 本文版本: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技术 | 评论(824) | 引用(0) | 阅读(110318)
MackJonshon Email Homepage
2020-10-9 13:48
Get best offers on Qatar Airways booking at SkyTripMart. Check Qatar Airways reservations flight status, baggage, group travel, pet policy. Zero cancellation.
ij.start canon Email Homepage
2020-10-10 12:26
Canon ij.start canon printer is a complete solution for multiple works that you can easily learn to set up from ij.start.canon and get a better experience. This is the official online support site that provides you https //ij.start.canon  online manuals, function information, and more. What’s more at the http //ij.start.canon  site is download and installation steps for Canon ij setup that is required for the complete Canon set up process.
seorankagency Email Homepage
2020-10-11 12:58
Are you thinking about SEO Services? Seo Rank Agency is the best SEO services provider in India. We provide SEO, SMO, PPC, Web Design, and Website Development services at affordable prices with 100% satisfaction. Call at 8287878854.No1 Seo services providers company in India offering the best SEO solutions to Archive top Ranking and 10x your Business sales With a team of top SEO specialist India, Best Seo plans.https://seorankagency.com/https://seorankagency.com/
Critical Thinking Writing Services Email Homepage
2020-10-13 13:16
Critical thinking assignment writing services have become very popular among students seeking Critical Thinking Writing Services and critical thinking essay writing services.
Digi@123 Email Homepage
2020-10-13 16:26
If you are looking for HP printer tech support you are in right place. Here you can find how can you get connected to HP printer tech support. As we all know about HP is a reputed tech and gadget company manufacturing Laptops, computers, Printer, Softwares, and other gadgets as well. HP has billions of customers across the world. So it is not too easy to get support easily from them but you can reach to hp printer tech support and contact hp printer support easily online.<a href="https://worldzine.org/help/hp-printer-tech-support-phone-number/">hp-printer-tech-support-phone</a>
Digi@123 Email Homepage
2020-10-13 16:33
<a href="https://worldzine.org/crypto/paxful-customer-service/">paxful-customer-service</a>Paxful provides customer service to its users and customer. There are 2 kinds of Paxful customer services one for vendors and another for users and customers. If you have any issue with your Paxful account like, you are unable to do trade or you are unable to sign in into your Paxful account, Unable to send or receive BTC, and much more.
Medical Research Paper Services Email Homepage
2020-10-19 12:56
Medical research paper help services have become very popular among medical coursework writing service seekers in need of Medical Research Paper Services and online medical research writing services.
cheapest car lease no money down Email Homepage
2020-10-21 11:25
cheapest car lease no money down can help you in bad credit auto financing, this is the best way to get leasing for your auto
Cooper056 Email Homepage
2020-10-21 17:37
99 reviews from Virgin Australia Airlines representatives about Virgin Australia Airlines culture, compensations, benefits, work-life balance, the executives, employer stability. Virgin Australia Airlines Reviews. A free inside gander at organization reviews and pay rates posted secretly by workers.
James Smith Email Homepage
2020-10-22 12:01
Hi! I am James Smith, an experienced technical writer who covers a wide range of CANON PRINTER PAPER JAM issues. Canon printer is an error state is the one common error encountered by mostly users during print job. That’s why; I have written the blog-post to provide fruitful information about the printer in error state issue. When you read my post, you will be able to very effectively annihilate this issue in a short span of time. Moreover, you can make direct connection to me via the given Canon printer customer care number. I am available all day all night continuously on phone call to respond quickly and deliver top-notch services in no time. There are numbers of talented techies working with the organizations where I work only for your better assistance.
sophia Email Homepage
2020-10-23 22:14
I loved this post! This is really interesting blog, thanks for sharing..
درب ضد سرقت لابی Email Homepage
2020-10-24 13:53
یکی از مسائلی که نقش منفی در  <a href="https://sepahandarb.com ">درب ضد سرقت لابی</a>           دارند قیمت درب ضد سرقت در درب های ضد سرقت ترک  که به دلیل افزایش قیمت دلار قیمت درب ضد سرقت ترک نیز به مراتب از درب ضد سرقت ایرانی بالاتر می شود
joseph
2020-10-26 18:40
Why my Yahoo mail down on chrome?If you are getting that Yahoo mail down brief occurs, while you access Yahoo email on the chrome program. Accordingly, to fix this issue, you have to restart this program. By restarting the program, it will fix the glitch that impacts Yahoo to work suitably. You can similarly enable javascript to fix this. For extra inquiries, contact us.
evasmith427 Email Homepage
2020-10-27 14:41
Epson Printer Error Code 0XE5If you are getting Epson Printer Error Code 0XE5 it is a very irritating error. Here is the full solution of Epson Printer Error Code 0XE5? Just follow the steps which are mention on the blog to fix the Epson Printer Error Code 0XE5. We give online help for Any problem with printers.Epson Printer Error Code 0XE5
black friday discount Homepage
2020-10-28 17:30
nrilegaladvisors
2020-10-29 13:10
Are you searching for the best divorce lawyers in Punjab then visit the official website of rk legal advisors - best nri legal advisors in India. It is the only nri legal advisors who will provide you the best and free consultation to you regarding your divorce related issues. From their professional nri divorce lawyers you'll get the best divorce related nri legal services in India.*******************************************best jpeg image optimizer online free
microsoft365.cpm/setup Email Homepage
2020-10-29 14:13
Microsoft Store – you may follow another method rather than microsoft365.cpm/setup method, in case of Microsoft Store purchase . Download Microsoft Office 365 and install it after ensuring that your system meets basic Office 365 requirements.visit microsoft365.cpm/setup and install the setup using the product key.
Canon.com/ijsetup Email Homepage
2020-10-29 14:13
Canon printer into your pc, your system does not need to install the driver on it. Canon printer that can be downloaded via canon page is the best wireless printer that you can connect to your device and print data smoothly. Canon ij setup CD is not the well-suited technique to use canon.comijsetup setup installation for longer.canon.com/ijsetup , www.canon.com/ijsetup.
Mumbai Escorts Service Email Homepage
2020-11-2 14:06
Thanks For Sharing informative content for my skill I am waiting for your next informative information. I also share yours into other people.https://www.modelinmumbai.in/kufri-escorts.htmlhttps://www.modelinmumbai.in/una-escorts.htmlhttps://www.modelinmumbai.in...
lisabrownusa789 Email Homepage
2020-11-2 14:48
Changing the Gmail theme, especially on PC, requires you to check-in through your account and navigate to the Settings > Themes. After that, choose a theme of your choice, and once you do that automatically, the background theme will be changed. So this is the way you can simply go by when it comes to figuring out how to change Gmail theme on PC. 
分页: 20/42 第一页 上页 15 16 17 18 19 20 21 22 23 24 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]