[文章作者:张宴 本文版本: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技术 | 评论(1138) | 引用(0) | 阅读(185077)
timeforev Email Homepage
2023-6-6 14:47
Are you tired of spending hours stuck in traffic during your daily commute? Would you like to decrease your carbon impression and add to a greener climate? Look no further than Time4ev, your one-stop solution for all your electric bicycle needs in Jaipur. With a wide range of electric bicycles and a commitment to quality and sustainability, Time4ev is revolutionizing the way we commute.Jaipur, the Pink City of India, is known for its vibrant culture, magnificent architecture, and bustling streets. However, navigating through the city\'s congested roads can often be a challenging and time-consuming task. This is where electric bicycles come into the picture, offering a convenient and eco-friendly alternative to traditional modes of transportation. And when it comes to finding the Best Electric Bicycle Dealer Supplier and manufacturer in Jaipur, Time4ev stands out as a reliable and trusted name.
highstreetgirls Email Homepage
2023-6-9 13:24
The model girls on our dating service are more beautiful in real life than in their photos. They are talented women who instantly make friends with customers and show customers the real world of sensuality. Spend your precious time with passionate women in our dating servicehttps://highstreetgirls.com/services/female-escorts-bangalore.html
surbhipatel Email Homepage
2023-6-10 12:32
Golden Chance in Mumbai We look forward to serving you independently in any of the hotel restaurants at affordable and sensual call girls categories.
dried poppy direct Email Homepage
2023-6-10 19:20
This blog post is an absolute gem! I found myself completely engrossed in your <a href="https://poppypodshop.com/dried-poppy-pods-with-stem/">dried poppy direct</a> storytelling and vivid descriptions. It's clear that you put a lot of thought and effort into crafting this piece. Your unique perspective and honest reflections make it relatable and refreshing. I appreciate how you tackle complex topics with such grace and sensitivity. This blog has become my go-to for inspiration and thought-provoking content. Thank you for sharing your talent and insights with the world. Looking forward to reading more from you in the future!
single step challenge prop firm Email Homepage
2023-6-13 01:41
Finding reliable funding sources can be challenging in today's fast-paced world,where financial stability is paramount. However, Instantfundedaccount.com offers a unique solutionthat aims to simplify the process of obtaining funds quickly and effortlessly.Instantfundedaccount.com, explore how it works, highlight testimonials and success stories,and address the legitimacy of this platform.<a href="https://www.instantfundedaccount.com/single-step-challenge/">single step challenge prop firm</a>
Brown Powder Heroin Email Homepage
2023-6-15 14:24
AcidParadise.org is a reputable online platform that offers a wide range of acid products,ensuring a convenient and reliable source for users seeking these substances.With its user-friendly interface, diverse product selection, commitment to quality and safety.<a href="https://acidparadise.org/product/brown-powder-heroin/">Brown Powder Heroin</a>
Best Cheap Web Hosting Email Homepage
2023-6-23 12:53
Affordability is key when searching for the best cheap web hosting provider.Look for hosting companies that offer cost-effective plans without compromising on essential features and performance.<a href="https://freshnewsinsider.com/best-cheap-web-hosting/">Best Cheap Web Hosting</a>
seconal sodium Email Homepage
2023-7-4 02:58
Everyone struggles with one or the other things in their life and want peace for a moment to relax.Our Nembutal drugs are capable of making you feel relieve from your pain and worries.We are engage in this industry for a long period and supply our drugs and medicines to different parts of the world. seconal sodium seconal sodium
winchester pdx1 defender 410 2 1/2 Email Homepage
2023-7-16 19:32
You've produced a quality blog. I stumbled into your list when doing an organic search. This essay was quite helpful.<a href="https://americanhuntershop.com/p/winchester-pdx1-410-gauge-2-1-2-shells-5/">winchester pdx1 defender 410 2 1/2</a> I appreciate you sharing this useful article. I truly value your work.
Kharar Escorts Email Homepage
2023-7-19 12:39
Are you one of those thousands of women seeking a lady partner online? The number of women looking for true love is increasing day by day. In order to meet such a lovely lady, it is important to choose the right companion carefully. Escort Service Kharar has plenty of call girls available for one’s pickings. Nowadays, all women are treated like queens and are treated with the utmost respect. All women are sexy, beautiful, charming, and naughty at the same time. They are beautiful, hot, and looking for someone who can fulfill all their needs. Kharar call girls Service offers exotic beauty to ladies of all age groups. When one is looking for a date or a lover, he should first narrow down his search by considering his requirements. Some people may just want a one-night stand and nothing else.
masticlubs Email Homepage
2023-7-24 15:36
Every people today want enjoyment but how much of them make this pleasure? We always must give the ideal escort service in Lucknow or Near Lucknow. You just nothing to do just get in touch with us see all of the excellent profiles and find your choice we will make your choice available. Do not believe a lot of, telephone girls aren't huge deal trust in me you may remember our services.Lucknow Escorts | Agra Escorts | Kanpur Escorts | Varanasi Escorts
sivaguru Email Homepage
2023-7-26 14:12
Predict your future with Nadi Astrology.
Best Cheap Web Hosting Email Homepage
2023-7-26 22:27
Affordability is key when searching for the best cheap web hosting provider.Look for hosting companies that offer cost-effective plans without compromising on essential features and performance.Please visit our website  https://freshnewsinsider.com/best-cheap-web-hosting/
rubyrajput Email
2023-8-1 13:45
Take a gander at these hot provocative, and striking profiles, pick the unimaginable escort you truly need and make a booking. It is after a short time our commitment to ensure that your picked 100% Escorts Goa is in your bed immediately. They can joyfully visit your hotel, resort, or house the entire day for room collusion. We can give an outcall motel escort relationship in Goa at whatever point.
Goa Escort Email Homepage
2023-8-1 14:39
We have particular pro and high profile Escort in Goa . Every Girl in our eminent office is from high society, so they are warm and instructed. Additionally, considering the way that they have a spot from the elite class of society.
Goa Escorts Email Homepage
2023-8-1 14:49
Do you not believe that life should be given a chance to get better? You won't be tired or bored with these Goa call girls; They are adept at engaging you to the tune of a great life. You'll truly feel like you're on cloud nine after just one night with them.
Goa Call Girls Email Homepage
2023-8-1 15:06
We are the leading and Best Escorts in Goa presenting best and safest escorts for the sexual fulfillment. We bring you high tech Call Girl Services proffering extremely safe and protected escort services through just a browse or a call.
Goa Call Girls Email Homepage
2023-8-1 15:46
We know you adore actresses, supermodels, TV actresses, air hostesses etc and this is why we have maintained the girls from these high profile professions only.
Escorts in Goa Email Homepage
2023-8-1 15:49
Furthermore, with our independent Goa escort, that will be much more amusing to you because our Call Girls in Goa are tasteful and provocative. So they'll give you complete happiness both romantically and erotically.
Goa Escorts Service Email Homepage
2023-8-1 16:13
If you are feeling lost or down in the dumps, then it is time to seek out the help of professional escorts. These services can provide you with the companionship and intimacy that you need in order to feel better about yourself.
分页: 49/57 第一页 上页 44 45 46 47 48 49 50 51 52 53 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]