[文章作者:张宴 本文版本: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
Escorts in Karachi
2022-10-31 19:35
Everybody might want to invest energy with the ideal Escorts in Karachi. In any case, it's difficult to track down a young lady who can address your issues and go with you any place you'd favor them to. Finding these young ladies is presently simple with the various administrations presented on the web.https://escortsserviceinkarachi.com/
Pune call girls
2022-11-2 20:51
I am Neha a well-educated call girl in Bangalore who offers erotic service all night in 2999Bangalore Escort ServiceMysore Escort Service
Sana
2022-11-3 16:16
Certain people don't utilise the Noida Escorts relationship as a result of the way that they care about individuals staying close by, point of view, and what they might say, yet you truly need to contact us without as far as possible unassuming bobbling, we're ready to keep the whole of your records astoundingly covered.
Pay for online homework help
2022-11-7 15:30
An online service called "Pay for online homework help" students take courses on their behalf. According to many studies, psychology studies the mind and behavior and how they relate to each other. The roots of Do my online exam and Homework help, two branches, are found in the stem of human mental health. Let's think about how they differ from each other. As part of my Ace online classes, I will be taking an online test under the guidance of a quality maker to treat student problems through behavior modification. It is fascinating to understand even though many students do not have the time to attend class properly and with full attention..
bathmatemexico
2022-11-8 13:29
Si está buscando una mejora para aumentar el tamaño del pene, Bathmate Hydromax es el método adecuado para aumentar el tamaño del pene de 5 a 7 cm con 15 minutos de uso por día durante 2-3 meses.
kushal
2022-11-11 18:09
https://lehryvalves.com/https://drramakrishnan.com/
lahore escorts
2022-11-11 19:40
We have party girl escorts for all types of parties in Lahore. Lahore escorts on hire make your party historic. Our escorts in Lahore are available for long term relationship. Connect with them through WhatsApp or social media accounts and make new friends. Meet our high profile female escorts in Lahore and increase your potential. We assure you that if you are not satisfied with our Lahore escort services, we will refund your money. Chat with our charming college going escorts in Lahore and blow your mind.文字文字https://lahoretopgirls.com/
pakistan ladies
2022-11-14 13:49
FOR ESCORTS BEST SERVICESVISIT OUR WEBSITES: https://pakistanladies.com/https://pakistanladies.com/lahore-escorts/https://pakistanladies.com/call-girls-in-lahore/htt...
cheap call girls in karachi
2022-11-14 21:29
There are a few risks associated with hiring a call girl booking in karachi. First, it is important to make sure that the call girl you hire is of legal age. There have been cases of underage girls being forced into prostitution in Karachi. Generally speaking, the more experienced the girl is, the higher the price will be. Are There Any Risks Associated With Hiring a Call Girl in Karachi
newassignmenthelpuk
2022-11-16 20:20
Finding the right Finance Dissertation Topics 2023 can be daunting, but there are plenty of reputable providers out there. Luckily, Our best assignment writers can provide the help you need. Our Assignment Help Services have a wide range of resources and experience to draw from, so you can be sure you'll get the best results. Get started now!
abc
2022-11-17 11:57
Nice blog. Get the best Import Export Data for 100+ Countries by Import Globals. For more information visit our website.Kenya Import Datahttps://www.importglobals.com/kenya-Import-data
escorts in lahore
2022-11-21 13:54
There are many Lahore Escorts that charge a lot. Even if you avail of their services, you always carry a doubt in your mind whether you have enjoyed as much as you have paid. If you want to get into such confusion, it is time to give a try to cheap Lahore Call Girls escort who charges you very little but always offers unlimited enjoyment at night Escort Services stays with top-rated models girls in Lahore.
independent escort lahore
2022-11-21 19:01
Lahore independent escorts on come up with services more than erotic encounters. They create a friendly environment to make their clients feel more confident about the sex sessions. Many people hesitate to reveal their fantasies. But with some romantic hugs, gentle care, and spending time together help you talk about your hidden fantasies in detail. You will be enjoying all those things that you dream of. It is truly an amazing experience for you to enjoy your sexual fantasies with the top-rated Lahore independent escorts. https://www.escortlahore.com/
Escorts in Islamabad
2022-11-22 21:45
I am very friendly and naughty to give you some extra time to enjoy and have me for as long as you want. In the industry, independence means a lot and brings some extra excitement within you once you see that I’m an independent in Islamabad Escorts Stan who is living alone. I’m there with you from the first till the last session.
escorts in lahore
2022-11-23 18:48
hamari awleen tarjeeh yeh yakeeni banana hai ke aap hamaray sath –apne waqt ke douran khush rahen. escorts Lahore mein pyara, aap ko aisa herat angaiz waqt den ke aap hamari jagah wapas ayen aur kuch dilchasp waqt guzaraian jisay aap itni jaldi bhool nahi payen ge .
Mumbai Escorts
2022-11-23 22:15
Bandagi, hello! Cheap Escort girl that can provide service at a low rate. This is a very new trend that I have adapted to. This low-cost escort’s service will allow you to meet me regardless of your budget. You don't have to worry about how much it costs to escort. You can always call me to get a small amount if you run out of money.
a1sexygirls@123
2022-11-23 22:16
You are looking for a woman to spend time with who is like your crush? You will find the perfect woman in me. I am Bindu a local call girl. It is the same in the sense that a beautiful girl in your area. As a local girl, you can have me visit any place you like. Once I'm there, you'll be captivated by my appearance and how I dress. You will be wild later.
night girls in lahore
2022-11-28 13:45
Most are unhappy for personal reasons, so others might be quiet because they aren’t able to chat over their problems. We can’t fix the first mix-up, but we can easily fathom out the solution for the second. There are several ways to make you happy.
night girls in lahore
2022-11-28 13:52
Most are unhappy for personal reasons, so others might be quiet because they aren’t able to chat over their problems. We can’t fix the first mix-up, but we can easily fathom out the solution for the second. There are several ways to make you happy.
night girls in lahore
2022-11-28 13:53
Most are unhappy for personal reasons, so others might be quiet because they aren’t able to chat over their problems. We can’t fix the first mix-up, but we can easily fathom out the solution for the second. There are several ways to make you happy.
分页: 43/57 38 39 40 41 42 43 44 45 46 47