[文章作者:张宴 本文版本: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技术 | 评论(1096) | 引用(0) | 阅读(150604)
mark Email Homepage
2019-8-23 19:24
If you are facing issues while performing Gmail Sign Up 1-833-293-8333 then once read and check the details which you have entered in the Gmail Sign Up Page. It’s a suggestion for all that before performing Gmail Sign once do check the internet connection speed. Sometimes just because of the internet connection, you are not able to do perform Gmail sign up and it shows an error. https://www.customercare-email.net/sign-up-gmail/
sofi Email Homepage
2019-8-24 16:37
Is recently launched Gmail features appearing confusing to you? If yes then seek authentic support from our Gmail customer service. We instruct Gmail users with detailed solution and proper guidance. If you’re caught with technical mishaps then consider contacting technical team. We’ll help you to sort the issues out. https://www.gmail-customerservice.org/
sofi Email Homepage
2019-8-24 16:37
Is recently launched Gmail features appearing confusing to you? If yes then seek authentic support from our Gmail customer service. We instruct Gmail users with detailed solution and proper guidance. If you’re caught with technical mishaps then consider contacting technical team. We’ll help you to sort the issues out. https://www.gmail-customerservice.org/
sofi Email Homepage
2019-8-24 16:38
Do you want to troubleshoot Yahoo account related technical difficulties? If your answer is yes then yahoo customer service is the fastest and finest option for you. If you want to get in touch with us then call on our helpline number. We’ll provide our every user immediate support service and quick solution. https://www.yahoo-customer-service.org/
sofi Email Homepage
2019-8-24 16:38
Are you tensed because of unwanted friend requests? Don’t know what to do? In such a situation, all you need is to access our reliable Facebook customer service that is known for its round the clock assistance. Our technical team will provide you proper steps to get rid of this kind of technical woe. https://www.facebook-customerservice.org/
andre Email Homepage
2019-8-24 22:51
If you want to change your Hotmail Password than follow the step given below site:- https://www.monktech.us/blog/how-to-change-hotmail-password/
alexanderaiden Email Homepage
2019-8-26 17:18
Meet Veteran, Join Facebook Customer ServiceIt is safe to say that you are confronting epistemic need while working your Facebook account? This need isn't letting to experience best highlights of Facebook, at that point you need not fear simply give a ring to us at contact number. Here are veteran will attempt to give you top results through our Facebook Customer Service 833-557-2777. https://www.facebookcustomer-service.com/facebook-customer-service-number/
ansmith Email Homepage
2019-8-26 18:22
Dial the helpline number to avail prompt yahoo helpDo you require quick yahoo help from a team of professionals?Are you looking for instant technical support?In such a case, you have to dial the contact number so that you can get in touch with our help desk team. You can get this service all day all night. So, contact us any day any time. 1-844-401-3111 https://www.yahoo-help.org/
ansmith Email Homepage
2019-8-26 18:23
Get a quick solution of password issue with instant facebook helpIs there any technical worry? If you’re saying yes then you will get immediate facebook help from our team of technical specialists. Our team knows how to fix the FB related issues in the easiest manner. You are only needed to reach the team of experts through the helpline number. 1-844-408-6888 https://www.facebook-help.org/   zan   zan
ansmith Email Homepage
2019-8-26 18:24
zan  Ask the experts for quick yahoo helpWith Yahoo account, users get stuck with a number of technical woes. To get rid of all these problems, you’ll require effective yahoo help from our team of technical professionals. All you have to make is one phone call on the 24 hours available helpline number. Our team handles technical problems in no time. 1-844-401-3111 https://www.yahoo-help.org/
Nick Email Homepage
2019-8-26 19:42
Yahoo customer service offers 24 hours approachability +1-844-409-6999Are you looking for reliable yahoo customer service? +1-844-409-6999 If yes then you’re at the right place where you’ll get immediate solution of every technical mishap. This service allows you to contact and talk to the techies with just one phone call. So, reach the team of experts just through our customer support service. https://www.contactphone-number.com/yahoo-phone-number/
mywifiext Email Homepage
2019-8-29 13:46
mywifiext I really appreciate this post. I’ve been looking all over for this!
fabtechie Email Homepage
2019-8-31 18:17
Stay tuned for latest technology updatefabtechie
crishgayle Email Homepage
2019-9-4 19:15
zan    Connect with helps desk team through our Skype Customer Service Video call drop and low-quality video calls are the most frustrating things when you make a Skype call. For fixing these glitches, the best option available to you is Skype Customer Service. This service benefits the users in multiple aspects such as quick fix and suitable solution for every technical inconvenience.1-833-554-7444https://www.supportforhelp.net/skype-customer-service
crishgayle Email Homepage
2019-9-4 19:15
Connect with helps desk team through our Skype Customer Service Video call drop and low-quality video calls are the most frustrating things when you make a Skype call. For fixing these glitches, the best option available to you is Skype Customer Service. This service benefits the users in multiple aspects such as quick fix and suitable solution for every technical inconvenience.1-833-554-7444https://www.supportforhelp.net/skype-customer-service
mxcrm01 Email Homepage
2019-9-12 20:12
CRM Software  is a system which helps to streamline your companies leads, opportunities,  appointments, sales and support, by keeping customer as center of process. https://www.mxcrm.in/
www.Webroot.com/safe Email Homepage
2019-9-16 18:57
Webroot.com/safe - Enter Webroot Keycode to Download Webroot SecureAnywhere and Get Started with Webroot Installation in Some Simple Steps.http://www.webrootsafee.us/
TomTom Home Email Homepage
2019-9-17 13:48
TomTom is a multinational developer & creator of navigation technology and consumer electronics. TomTom has a vast range of devices for navigation and electronics and this also needs regular updations. Here we are talking about updating your TomTom navigation device.http://tomtomupdates.uk
Rand McNally Dock Email Homepage
2019-9-17 16:23
Rand McNally Dock - Now Download the Software and do Rand McNally Update in order to Enjoy the Latest GPS Maps. Visit randmcnally.com/dock and Update Now.http://randmcnally-dock.com/
download trendmicro Email Homepage
2019-9-24 16:14
When you visit downloadcenter.trendmicro.com and download trendmicro, it protects your device from unwanted threats and spywares. Below mentioned are the services provided by downloadcenter.trendmicro.comhttps://downloadtrendmicro.com/https://downloadtrendmicro.com/best-buy-trend-micro-renewal/https://downloadtrendmicro.com/download-purchased-trend-micro/https://downloadtrendmicro.com/trend-micro-best-buy/<a href="https://downloadtrendmicro.com/">downloadcenter.trendmicro.com</a><a href="https://downloadtrendmicro.com/best-buy-trend-micro-renewal/">best buy trend micro renewal</a><a href="https://downloadtrendmicro.com/download-purchased-trend-micro/">download purchased trend micro</a><a href="https://downloadtrendmicro.com/trend-micro-best-buy/">trend micro best buy</a>
分页: 9/55 第一页 上页 4 5 6 7 8 9 10 11 12 13 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]