[文章作者:张宴 本文版本: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技术 | 评论(1139) | 引用(0) | 阅读(185731)
office.com/setup Email Homepage
2020-9-10 16:26
office.com/setupOffice 365 can be more useful than just an email application if you pick the right subscription plan. For business, enhancing productivity and collaboration in the organization has become necessary to make it easy and more proficient for the employees to work.But, numbers of businesses are still utilizing the basic plans of Office 365, which limit them from utilizing the updated features. So, to ensure you get every feature and use your Office 365 subscription to the most.Office setup
essay help Email Homepage
2020-9-16 15:45
GotoAssignmenthelp Service is a well-established and prominent name in providing high-quality assignment help UK online to students for almost a decade. You can trust our academic ghostwriters completely to get the best quality write-ups including case studies, research proposals, dissertations and theses, and more. It is the best Assignment Help service. Students should always keep themselves ready to meet the university requirements in order to achieve good grades, moreover, they prefer attending lengthy classes instead of writing assignments. Students who are not comfortable with writing assignments can avail university Assignment Help London at Gotoassignmenthelp Services comparatively low prices.
ameeleecute Email Homepage
2020-9-16 20:21
Are you looking for Help with Assignment ? Are you not able to choose the best experts? GotoAssignmenthelp is one of the most famous Assignment providers in the world. We provide MYOB Perdisco assignment help to students in Australia in all subjects. Our online assignment makers provide quality assignment writing services but should be an option for all students. Which is why we are pleased to provide you with urgent https://www.gotoassignmenthelp.com/programming-help/android/" target="_blank"> android assignment help .
Assignment Help Email Homepage
2020-9-19 15:42
Gotoassignmenthelp Service endeavors to satisfy the advanced education guidelines of the college/ university through the best quality assignments when you require Assignment Help. Assignments are composed consistently and all mistakes are adjusted for an immaculate completion in our Assignment help administration on the web. At the point when you pick our Thesis Writing Help assistance, our faculty will consider the quality and your evaluation criteria. On taking Gotoassignmenthelp online assistance, we ensure the first substance and faultless work. Educators of the rumored colleges believe assignments to be the most productive technique to evaluate a students' composing bore alongside their comprehension of the course. Gotoassignmenthelp is the best My Assignment Help online supplier in around the world.
Media Studies Writing Services Email Homepage
2020-9-21 18:02
To seek the best Media Studies Writing Services for those working on custom media and communication writing services, it is important to hire an award winning media & communication essay writing help services.   https://researchpapers247.com/media-studies-writing-services/
Media Studies Writing Services Email Homepage
2020-9-21 18:03
To seek the best Media Studies Writing Services for those working on custom media and communication writing services, it is important to hire an award winning media & communication essay writing help services.  https://researchpapers247.com/media-studies-writing-services/
درب پلی وودی
2020-9-23 22:37
امروزه درب پلی وود به عنوان یک کالای لوکس و جدید به بازار عرضه شده است و می توان گفت <a href="https://sepahandarb.com/25-%D8%AF%D8%B1%D8%A8-%D9%BE%D9%84%DB%8C-%D9%88%D9%88%D8%AFwpc ">درب پلی وودی</a>          نسل جدید درب های ساختمانی به حساب می آیند
downloadtrendmicro Email Homepage
2020-9-24 18:54
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>
jim Email Homepage
2020-9-25 10:07
Most reliable Quickbooks customer service phone numberQuickbooks is an online accounting program that has come as a sigh of relief for thousands of self employed people and small business owners. It is packed with powerful features and makes bookkeeping very easy even for novices. However, there is no need to worry if your Quickbooks is not performing optimally. It is a technology based service that can suffer from small issues at time. We can solve your problem quickly on phone. Just dial 1-877-916-7666 to reach our highly popular and trusted tech centre. Hundreds of customers have utilized our Quickbooks customer service phone number in recent months.
Morning Thoughts Email
2020-9-27 15:24
Hello everyone, I am going to share the latest Hindi status good morning in this article. You will find the best status category which includes Hindi good morning wishes, Hindi good morning photo, Hindi good morning thoughts, Hindi good morning Shayari, and Hindi good morning SMS.<a href="https://latesthindistatus2020.blogspot.com/2020/02/hindi-status-good-morning-2020.html">गुड मॉर्निंग स्टेटस इन हिंदी 2020</a><a href="https://latesthindistatus2020.blogspot.com/2020/02/hindi-status-good-morning-2020.html">good morning status 2020</a>
Morning Thoughts Email
2020-9-27 15:24
Hello everyone, I am going to share the latest Hindi status good morning in this article. You will find the best status category which includes Hindi good morning wishes, Hindi good morning photo, Hindi good morning thoughts, Hindi good morning Shayari, and Hindi good morning SMS.<a href="https://latesthindistatus2020.blogspot.com/2020/02/hindi-status-good-morning-2020.html">गुड मॉर्निंग स्टेटस इन हिंदी 2020</a><a href="https://latesthindistatus2020.blogspot.com/2020/02/hindi-status-good-morning-2020.html">good morning status 2020</a>
KellyEdwards Email Homepage
2020-9-28 17:41
Be it exams, self-study or homework projects, <a href="https://scholaron.com/">ScholarOn</a> remains your trusted companion for all your Environmental Science learning needs with <a href="https://scholaron.com/subjects/environmental-science">Environmental Science Expert Solutions</a>. Our subject matter experts are professionals like a constant learning commitment to ensure top quality exclusive for our students.
GST Registration Email Homepage
2020-9-28 18:19
Online GST Registration application is an essential step under GST regime for every taxpayer or business owner whose annual turnover is above 20 lakh. Only after GST registration online processing, the business owner gets a GSTIN number which is a unique number. Company Registration | Trademark Registration
Delta Airlines Reservations Email Homepage
2020-10-3 19:51
Book your Delta Airlines Flights with Delta Airlines Reservations Team or Get the Benefits of the 50 % discounts on your flight reservations. Avail the discounts Now, Deals are available for all destinations traveled by the Delta Airlines.
Delta Airlines Reservations Email
2020-10-5 19:47
Delta Airlines Reservationswhere you can easily Book Cheap Flight Tickets with us. The experts take care of every one of those who seek some great options before they go on a vacation.
Delta Airlines Cancellation Email Homepage
2020-10-5 19:49
Delta Airlines Cancellation Policy where you can easily cancel your Flight Tickets with us and get 70% cashback offers and refunds for cancellation flight tickets with us.
Delta Airlines Vacations Email Homepage
2020-10-5 19:50
When you are really thinking to save money from the deals and discount then we recommend  the name of Delta Airlines Reservations Official Site |+1-855-948-3805| because Delta Airlines Vacations is an ideal choice for you to explore more beautiful destinations in the world.
Delta Airlines Booking Email Homepage
2020-10-5 19:51
Book your flights on Delta Airlines Reservations at lowest price, we provided amazing deals & discounts on Delta Reservation flights tickets.
MackJonshon Email Homepage
2020-10-9 13:45
Ryanair book flights with SkyTripMart. Find better prices on Ryanair reservations ✈ Book flight on Ryanair and get deals on air tickets.Ryanair Reservations
MackJonshon Email Homepage
2020-10-9 13:46
Make United Airlines reservations from SkyTripMart. Get deals on flight reservations, group or change booking. Book vacations &amp; reedem United MileagePlus miles.
分页: 19/57 第一页 上页 14 15 16 17 18 19 20 21 22 23 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]