[文章作者:张宴 本文版本: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
ritusharma
2022-8-4 23:11
From housewife to young and intrepid college students - you'll get every variety with our chaperone services in Mumbai. My Mumbai Escorts is always available with our Mumbai Escorts Service to spend the night with you and give you the greatest sexual pleasure all night long.
tamilbible
2022-8-6 17:56
Get the Tamil Bible Online old & new Testament from the holy bible(tamil) in our website tamilbibleonline.com at any time.
crm
2022-8-8 14:32
Get Microsoft 365 setup by visiting microsoft365.com/setup. Sign in to Microsoft account, enter the product key and get apps quickly. Microsoft 365 is the best way to get all the apps of Office within one subscription. In caseIndependent House Villa in Greater Noidahttps://propman.in/projects/single/2233/independent-house-villa-kothi-greater-noida
arpitajain01
2022-8-9 19:37
Get the most satisfying Mumbai Escorts with Arpita Jain and her Mumbai Escorts and make your night the happiest one. We are also giving discounts on every booking and you can get additional offers also every time you visit our Mumbai Escort Service with more discounts. https://arpitajain.org/
deepikaverma
2022-8-11 16:05
There are many reasons why someone would want to join an escort agency in Goa. Some of the main advantages include:- Increased Freedom and Independence: Escorts offer a level of freedom and independence that is not easily available elsewhere. They can go where they please, when they please, and with whom they please. This increased freedom can be extremely liberating, especially for those who are looking for a change in their lives.- Increased Income Opportunities: Joining an escort agency can give you access to high-paying jobs. Because escorts work with a number of different clients, they are often able to earn a lot more money than if they worked in a regular job. This can be a major factor in helping people improve their financial situation.Goa Escorts || Goa call girl
shz
2022-8-13 21:25
Thank you so much for ding the impressive job here, everyone will surely like your post. Lead generation
shz
2022-8-13 21:31
A great website with interesting and unique material what else would you need. Lead generation
shz
2022-8-13 21:32
I truly like you're composing style, incredible data, thankyou for posting. Lead generation
shz
2022-8-13 21:35
All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks Lead generation
shz
2022-8-13 21:39
A debt of gratitude is in order for giving late reports with respect to the worry, I anticipate read more. Lead generation
shz
2022-8-13 21:43
That is very helpful for increasing my knowledge in this field. Lead generation
shz
2022-8-13 21:47
Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. Lead generation
shz
2022-8-13 22:01
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. Lead generation
shzz
2022-8-13 22:08
I would recommend my profile is important to me, I invite you to discuss this topic... Lead generation
shz
2022-8-13 22:17
Always so interesting to visit your site.What a great info, thank you for sharing. this will help me so much in my learning Lead generation
Jack
2022-8-16 19:42
Lucky Patcher is a free Android hacking app that lets you manage your smartphone content. Functionalities include the ability to modify games, block ads, and help you bypass paying for premium features. The app is all about facilitating your phone's use and maximizing its potential.Lucky Patcher distinguishes itself from other mod apps with a feature that lets you obtain content that you can typically only receive through in-app purchases. You can also remove license verification for premium apps, granting you access to all available content.Also, read Titan Player APK for Android.Also, read Nickname Fire Nickfinder App free download.Lucky Patcher can modify app features that you might find annoying. For example, you can block or remove ads, earn free in-game currency, and move files to your SD card.The license permissions that Google Play requires with app downloads can be questionable or invasive. This program makes it simple to block any permissions that seem shady. The app is relatively simple to use, with labeled features showing you everything you can accomplish. An official forum serves as a source of information and helpful advice if you find yourself confused or curious about other features.
roslynwota
2022-8-20 22:40
It is one thing to do an undergraduateassignment or essay on a subject and something completely different to write adissertation on a similar area of research. To begin with, there is the formitself. A dissertation is a very lengthy piece of writing, divided intochapters and sections with an extensive reading list. At the same time, thereis the most difficult question of finding all that is worth reading on asubject. Our Dissertationhelp service is known for being the most resourceful when it comes toresearch. This comes from our experts having long years of experience inmentoring students on their research. Dissertation Helpis an extended form of academic writing. It is often a capstone project forresearch-based Master programs or doctoral-level courses. All Ph.D. candidatesneed to successfully write a dissertation as a capstone project and submit itin time to qualify for degree conferral.
axpertadvisors
2022-8-23 14:01
QuickBooks Error Code 267 shows the message of warning as “Rebuild Not Working”, which indicates triggering of the Error due to damaged data because generally, Rebuild tools are to fix the data of the company. Are you also stuck with this Error of the QuickBooks? Let’s look after the symptoms, causes, and steps of fixing the Error.
Escort In Karachi
2022-8-24 19:56
Our Karachi Call Girls are some of the world's best and most exclusive companions, and you can have a fun and sexual time with them. You can take girls where you want to go and have fun with them. There are a lot of call girls in Karachi who will help you see everything Pakistan has to offer and make your dreams come true.
HRCGlobally
2022-8-27 19:30
We provide excellent luxury transportation service that is matchless and we are committed to using the latest industry innovations to provide our esteemed customers with turnkey transportation solutions. When you use our service , you are assured of excellent service from the moment you contact our customer support to the time of your booking and completion of your ride.https://hrcglobally.com/
分页: 40/57 35 36 37 38 39 40 41 42 43 44