[文章作者:张宴 本文版本: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
aliadil961
2020-2-6 18:24
interior designing courses in Lahoreinterior design courseautocad course in lahore
aliadil961
2020-2-6 18:26
web development courses in Lahoreweb designing course in Lahoreweb development courseswordpress course
aliadil961
2020-2-6 18:27
seo training in lahoreseo course in lahoregraphic designing courses in Lahoregraphic design courses
Business dissertation help
2020-2-8 15:28
I have seen many Assignments Help Online but your posts and your blog are very useful for me and you are one of the best blog writers in US. Hope you will share many more articles. This is a great source of information for everyone in business dissertation help.
www.norton.com/setup
2020-2-9 17:00
I really happy found this website eventually. Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such blog.<a href="https://nortononlinehelp.com/">www.norton.com/setup</a><a href="http://roadrunneremailcustomerservice.com/">roadrunner email login</a><a href="https://emailhelplinenumber.us/">aol mail password recovery</a><a href="https://setup-mcafee.com/">mcafee.com/activate</a>
www.norton.com/setup
2020-2-11 00:05
I really happy found this website eventually. Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such blog.<a href="https://nortononlinehelp.com/">www.norton.com/setup</a><a href="http://roadrunneremailcustomerservice.com/">roadrunner email login</a><a href="https://emailhelplinenumber.us/">aol mail password recovery</a><a href="https://setup-mcafee.com/">mcafee.com/activate</a>
bailyd17
2020-2-17 17:05
Amazing post. I'm a regular visitor to your site and appreciate you taking the time to keep the superb website. I'll be a regular visitor for quite a while.management homework help
www.mcafee.com/activate
2020-2-19 17:12
McAfee activation www mcafee com activate is the essential process if you have McAfee antivirus on your device. To activate the McAfee anti-virus, you need to purchase the McAfee product key. This key can be obtained from mcafee com activate card or online.
www.mcafee.com/activate
2020-2-19 17:12
McAfee activation www mcafee com activate is the essential process if you have McAfee antivirus on your device. To activate the McAfee anti-virus, you need to purchase the McAfee product key. This key can be obtained from mcafee com activate card or online.
www.mcafee.com/activate
2020-2-19 17:12
McAfee activation www mcafee com activate is the essential process if you have McAfee antivirus on your device. To activate the McAfee anti-virus, you need to purchase the McAfee product key. This key can be obtained from mcafee com activate card or online.
www.mcafee.com/activate
2020-2-19 17:13
McAfee activation www mcafee com activate is the essential process if you have McAfee antivirus on your device. To activate the McAfee anti-virus, you need to purchase the McAfee product key. This key can be obtained from mcafee com activate card or online.
Useless Websites
2020-2-22 11:41
Useless Websites https://uselesslyweb.com/ Useless Websites
solution brother.com/windows
2020-2-28 16:52
visit to get latest & updated driver for Brother Printer
whstraining
2020-2-28 20:31
whsandtrainingcompliance.com.au
Financial Accounting Homework Helper
2020-3-3 18:11
In which different sorts of creating are accessible: piece shaping, Dissertation Writing Help, Research Paper Assistance, Analysis, Literature Review, articles, and so forth. Financial Accounting Homework Helper
Naveed
2020-3-5 00:54
I read that Post and got it fine and informative. Please share more like that...extratorrent
Naveed
2020-3-5 17:29
I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information.the chap nha dat
Naveed
2020-3-5 21:37
Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thankstu van bao hiem nhan tho prudentialhttps://tuvanbaohiemnhanthoprudential.weebly.com/
cach ban bat dong san hieu qua
2020-3-6 20:15
very interesting post.this is my first time visit here.i found so mmany interesting stuff in your blog especially its discussion..thanks for the post!
Naveed
2020-3-7 20:18
I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information.https://www.voyantendirect.com
分页: 12/57 7 8 9 10 11 12 13 14 15 16