[文章作者:张宴 本文版本: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
注:此处的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()函数发送电子邮件
(4)、在MySQL上创建一个数据库servmon,然后在该数据库中执行以下SQL语句创建表:
备注:这张表是PHP接口程序用来记录发送磁盘分区报警邮件的时间,避免在一段时间内重复发送大量报警邮件的。
(3)、PHP接口程序
http://yourdomain/servmon/interface.php
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
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
; 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;
`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
Jim
2019-11-28 20:34
In brief, this innovation agenda will be most vulnerable to the US technological leadership consequently and triggers the US for a trade war. freelance writer for hire
ZXCXFDS
2019-11-28 20:36
In addition to this, the U.S proscribed American firms to sojourn the supply chain of hardware and software from ZTE telecom equipment manufacturers for 7 years.
Online Homework Writing Services
2019-11-28 21:51
Learn about Custom Homework Writing Services that are congenial to your needs.Writers delve deeper into concepts about Online Homework Writing Help, and the qualities to consider when writing the most Online Homework Writing Help. https://researchpapers247.com/homework-writing-services/
installavg
2019-11-30 16:16
Install avg on your device and protect your device from cyber threats<a href="https://installavg.org/how-to-install-avg-antivirus/">how to install avg antivirus</a>
james
2019-11-30 19:28
Aren’t you aware of the reasons why Yahoo stops sending or receiving with the attachment? Are you looking for the proper treatment to deal with such errors and hurdles? Yahoo Support professionals will surely direct you the best in class assistance via which one can get the real time aid. https://microsoftsupportnumber.com/yahoo-support-phone-number/
sophiathomas
2019-12-2 16:33
Excellent Article. This is really a great stuff. I am very happy to have found this information.<a href="https://www.allassignmenthelp.com/us/homework-help-online.html">Homework Services Online</a><a href="https://www.allassignmenthelp.com/us/homework-help-online.html">Online Homework Doer</a>
james smith
2019-12-3 20:44
How Does Amazon Help In Fetching The Required Troubleshooting Aid? Amazon Help is one of the best channels for the novice users who will be able to get the right kind of help from the experts at anytime. Here, you will not only get the aid from the experts but also get the tips and tricks to keep your account up and running in a hassle free manner. https://www.deletemy-account.com/amazon-customer-service-phone-number/
james
2019-12-4 14:46
Do you want to take guidance from the professionals and engineers regarding your complex Amazon problems? Are you also facing some sorts of problems during the course of accessing to different Amazon services? In order resolve these ones, you should take Amazon Customer Service and get the right technical aid. https://www.amazon-customerservicephonenumber.com/
hollowayjeanna
2019-12-4 18:33
Good post. I learn something new and challenging on sites. Canon Printer Offline is among one of the major brands when it comes to IT devices. These printers are among the best printers and this hardly requires any technical servicing.https://canonprinteroffline.ushttps://garminexpress.globalhttps://tomtomhome.chhttps://quickbooks-login.comhttps://norto...
ameejames
2019-12-6 20:02
Looking for Netgear Support UK, visit on:Netgear Support UK
ameejames
2019-12-6 20:03
Wordpress live chat
ameejames
2019-12-6 20:05
hp customer support
lisabrownusa789
2019-12-17 13:09
If you trying to Lexmark Printer Setup or want to know on How to Setup Lexmark Printer and download latest Lexmark software and drivers, firmware and utility diagnostic tools for your Lexmark Printers, then you needs to connect with the Lexmark Customer Service experts. Contact Lexmark Printer Support if you need assistance and help with your Lexmark Printer. Our experts are available for Lexmark Printer printing problems, Lexmark Printer scanning problems, Lexmark Printer connectivity problems, and many more. https://www.supportforusa.com/lexmark-printer-customer-support/
turbotaxsupport
2020-1-2 20:35
TurboTax Support Number may be a world of solutions for all the queries associated with TurboTax Software. This platform is usually on and always available for the users. We work consistent with our customer’s perspective and requirements. We are happy to offer our employees credit for his or her competence to realize high customer satisfaction for our invaluable clients.Office.com/setup Privacy Policy123hp.com/setupturbotax support number
Chrome OS help
2020-1-15 01:05
Are you experiencing some minor technical problems with your Chrome these days? Is it hanging at times or crashing suddenly without any reason? No matter what the problem you are facing as we are there to provide complete Chrome support to you.https://www.assistanceforall.com/services/browser-support/chrome-support/Chrome support
bullguard login
2020-1-29 14:22
If you have purchased the subscription or want a trial of BullGuard Internet security, then visit link and download the setup. You can download the software for Windows, macOS and Android. You can then safeguard your device and data with full virus protection with firewall, Identity Protection and many more.https://www.bullguard-bullguard.com/bullguard-internet-security/https://www.bullguard-bullguard.com/bullguard-login/
perfectprint
2020-2-4 13:07
Canon Printer offline problem is most regular issue looked by Canon Printer clients, on this blog entry you will get every one of the guidelines to fix Canon Printer offline problem.
valadez258
2020-2-6 14:02
Norton antivirus protects your computer against viruses, trojan, malware and other online threats. You have to select the Norton product and start downloading, installing and activating it by visiting the following link.https://mynorton-com.com/
aliadil961
2020-2-6 18:22
Baabroz is best for computer courses in Lahore. We are providing professional designing, fine arts, and IT courses in Lahore.seo training in lahorewordpress courseweb development courses in Lahoreinterior designing courses in Lahore
aliadil961
2020-2-6 18:24
<a href="https://baabroz.com/web-development-courses-in-lahore/">web development courses in lahore</a>computer courses in lahoregraphic designing courses in lahore[https://baabroz.com/short-courses-in-lahore/ short courses in lahore][Interior Design Course](https://baabroz.com/interior-design-course/)"web development courses in Lahore":https://baabroz.com/web-development-courses-in-lahore/
分页: 11/57 6 7 8 9 10 11 12 13 14 15