[文章作者:张宴 本文版本: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技术 | 评论(1243) | 引用(0) | 阅读(222958)
adarshproperty Email Homepage
2025-10-19 18:33
Hii,This is Great Post.. for me, Thanks for sharing with us!! https://www.adarshproperty.com/
adarshproperty Email Homepage
2025-10-19 18:34
Hii,This is Great Post.. for me, Thanks for sharing with us!! https://www.adarshproperty.com/
Adarsh Lumina Email Homepage
2025-10-23 18:21
Adarsh Lumina is a premium low-rise residential project off Sarjapur Road, Bengaluru, offering spacious 2.5 and 3 BHK apartments with abundant natural light and ventilation. Spread across 8.7 acres with 35+ lifestyle amenities, it combines modern living with serene green spaces, all while being close to top IT hubs, schools, and upcoming metro connectivity.
Prestige Falcon City Luxe Email Homepage
2025-10-25 00:26
Prestige Falcon City Luxe on Kanakapura Road presents luxurious 2, 2.5, 3, and 4 BHK apartments crafted with top-quality materials and refined specifications.
valentina Email Homepage
2025-10-26 19:18
I utilize this card a few every week. The discount of 5% works in conjunction with Shipt which means that all my food items are shipped with discount. I don't carry any balances since the APR can be extremely high.? The card I got in 2004 and had a $500 limit. Now I'm carrying a an amount of $6500 that I've do not even come close to since I typically use Chase cards for all other things. A great option if you're frequent shopper at Target. ?target red card login
banjo Email Homepage
2025-10-31 19:24
在线购买 https://getvaliddocuments.com/zh-CN 注册文件,想从可靠的来源在线购买注册文件?在 GetValidDocuments.com,我们提供合法且经过数据库验证的文件,可用于身份识别、旅行、工作等。每份文件均采用行业级安全功能精心制作,并录入相应的国家数据库。无论是护照、驾照还是证书,我们都确保其真实性、隐私性和快速的全球递送。
target red card login Email Homepage
2025-11-6 19:13
I made an application for the card on the 8th of August, along with a 7-10-day message. I contacted Target to inquire about the status of my application and was told I had to provide additional documents for verification. I received a phone message from Target on the 8th of August, telling me that the verification of address wasn't enough, and to submit the bank statement. The next day, and then called on 8/12, to confirm that I had received the statement. The representative informed me that I was accepted that morning to have a limit of $1,000 and my credit card would be issued the following day. The process took a while, but however, it was well worth the wait!https://www.targettredcardlogin.com/
Chennai Call Girls Email Homepage
2025-11-8 13:27
Are you searching for Chennai call girls to make your night memorable and exciting? Our escort service in Chennai offers high-class, professional, and independent call girls who are truly committed to your comfort and satisfaction. Whether you are looking for college call girls in Chennai, VIP escorts in Chennai city, housewife escorts near Infocity Chennai, we have a diverse selection of talented, charming, and beautiful companions for every taste and occasion.
Chennai Call Girls Email
2025-11-8 13:29
Are you searching for Chennai call girls to make your night memorable and exciting? Our escort service in Chennai offers high-class, professional, and independent call girls who are truly committed to your comfort and satisfaction. Whether you are looking for college call girls in Chennai, VIP escorts in Chennai city, housewife escorts near Infocity Chennai, we have a diverse selection of talented, charming, and beautiful companions for every taste and occasion.
Lahore Call Girls Email Homepage
2025-11-10 20:12
The burgeoning phenomenon of call girl services in Lahore represents a complex interplay between societal norms, economic needs, and individual agency. While often shrouded in stigma, these services reflect broader issues surrounding gender, class, and the urban experience in Pakistan's cultural capital.https://callgirlslahore.serviceshttps://callgirlslahore.services
roshni Email Homepage
2025-11-11 22:24
To maximize your time, communication is key. Clearly outline your expectations during booking—whether it's intellectual banter, passionate encounters, or a mix of both. Reputable platforms like independent https://missroshni.in/" target="_blank">Greater Noida Escorts directories or verified agency websites facilitate easy selections with detailed profiles, photos, and reviews.Always prioritize licensed services to avoid pitfalls. Look for agencies with transparent policies, 24/7 support, and positive testimonials. In https://missroshni.in/" target="_blank">Noida Escorts , leverage local knowledge; companions often suggest hidden gems like scenic parks in Sector 50 or nightlife at Atta Market for spontaneous dates.Remember, these encounters are about mutual enjoyment. Treat your companion with respect, and you'll receive the same in return, fostering connections that linger beyond the night
Umair Email Homepage
2025-11-13 17:54
Our Fancy KnivesWhen people talk about fancy knives, they usually mean knives that go beyond mere utility. Fancy knives combine function with artistry. They can be showpieces, collectors’ items, or tools that feel luxurious because of their materials, detailing, or craftsmanship. Some of the aspects that tend to make a knife “fancy”: ·High-quality materials—exotic woods, bone, horn, premium steels, maybe even Damascus steel or similarly patterned steels. ·Artisan workmanship—hand-forged parts, decorative etchings, inlays, complicated handle shapes, custom fittings, sometimes even jewels or unique motifs. ·Aesthetic design—fancy shapes, polish, finishes (matte vs mirror), patterns, and balance between form and function. ·Heritage or story—a knife made by a famous maker, in a traditional style, or using lost techniques tends to feel fancier.Website :- The Engraved EdgeLink :- ( https://theengravededge.com/ )
prerna Email
2025-11-15 21:27
The facts that won me over were the professionalism and the warmth of the Escorts Service in Greater Noida I had the pleasure to meet. With her charm and elegance, she was indeed an energizing and delighting break from the usual.
adarsh Email Homepage
2025-11-17 18:26
This really saved me a lot of time. Appreciate the effort you put into making it so clear. https://adarshdevelopers.co/
adarshwelkinpark Email Homepage
2025-11-23 17:22
This post is unique and lovely, and it really helps us. Your post is awesome. I appreciate you giving this fantastic information. But also check our website https://www.adarshwelkinpark.gen.in/
Prestige Grove Hills Email
2025-11-24 15:14
Prestige Grove Hills is a new-age, upcoming Luxury Apartment Township by Prestige Group, strategically located in Whitefield, East Bangalore. The total area of the project is 7 acres.  https://www.prestigegrovehill.info/
Prestige Grove Hills Email Homepage
2025-11-24 15:15
Prestige Grove Hills is a new-age, upcoming Luxury Apartment Township by Prestige Group, strategically located in Whitefield, East Bangalore. The total area of the project is 7 acres. It includes 4 towers hosting 700 units of premium 1, 2, and 3 BHK apartments. The floor sizes of the apartments range between 510 and 1530 sq ft.https://www.prestigegrovehill.info/
Prestige Grove Hills Email Homepage
2025-11-24 15:18
Prestige Grove Hills is a new-age, upcoming Luxury Apartment Township by Prestige Group, strategically located in Whitefield, East Bangalore. The total area of the project is 7 acres. It includes 4 towers hosting 700 units of premium 1, 2, and 3 BHK apartments. The floor sizes of the apartments range between 510 and 1530 sq ft.
Arvind Skycrest Email
2025-11-27 14:53
Arvind Skycrest is a new-age, future-ready apartment project by Arvind SmartSpaces, located on JP Nagar, in South Bangalore. This new launch township is set on 4.30 acres.Arvind Skycrest is the latest Arvind JP Nagar new launch in South Bangalore. The project offers over 340 premium apartments. These luxury flats come in 2, 2.5, 3 & 4 BHK unit types. The sizes range from 1131 sq. ft to 1944 sq. ft.  https://www.arvindskycrest.org.in/
Gurugram call girls Email Homepage
2025-11-27 22:07
|| Escort Service in Gurugram || Gurugram Escort Service || Gurugram Escort Price || Call Girls Service in Gurugram || Gurugram Call Girls Real Photos || Gurugram Call Girls Mobile Number || Big Tits Call Girls In Sector 75 || Bikini Call Girls In Sector 80 || Blonde Call Girls Sector 71 || Cheap Escorts Service Paharganj || Curvy Figure Girls In Sector 72 || Dating Call Girls Hauz Khas || High Profile Neemrana Call Girls || Hina Sexy Girl In Sector 78 || Independent Escorts Dwarka || Juicy Escorts Service Sector 79 || Karen Foreigner Sector 29 Escorts || Kashmiri Escorts In Gurugram Sector 73 || Mature Escorts In-sector 76 Gurugram || Milf Call Girls In Aerocity || Night Call Girls In Sector 77 || Sector 74 Call Girls In Luxury Hotel || Seductive Escorts In Faridabad || Sushant Lok Russian Call Girls || Teenage Call Girls In Mahipalpur || Fantasy Call Girls In Goa || Beautifull Nightlife Call Girls In Mombai || Cheap Rate Call Girls In Lucknow || Shaved Call Girls In Sector 51 || Spanish Call Girls In Sector 52 || Beauty Call Girls In Sector 53 || Best Call Girls Price Sector 54 || School Call Girls In Sector 55 || Verified Call Girls In Sector 56 || Satisfying Call Girls In Sector 57 || Maid Call Girls In Sector 58 || Silky Call Girls In Sector 59 || Flexible Call Girls In Sector 61 || Latest Call Girls In Sector 62 || Professional Call Girls In Sector 63 || Glamour Call Girls In Sector 64 || love
分页: 62/63 第一页 上页 57 58 59 60 61 62 63 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]