[文章作者:张宴 本文版本: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技术 | 评论(1085) | 引用(0) | 阅读(145886)
merinasusanti583 Email Homepage
2020-5-19 04:41
Hallo, teman-teman semua nya kami dari agen indowins ingin menawarkan berbagai jenis permainan dan bonus. whatshapp : +85587536868
SEO Services Email Homepage
2020-5-23 14:22
Looking Forward To Get SEO Services Near MeWe are trained team of experts and professionals in SEO Service market and are basically the market leaders. We are having our offices and branches everywhere. If you want to avail the best possible and affordable SEO Service for boosting your business’s digital and online presence, then you can also locate us very easily. Type SEO Services Near Me on your maps software and you will get to see our name appearing on the top with the contact details. Contact us and we will reach at your place within no time.SEO Services
pnjwebservices Email Homepage
2020-5-25 14:31
We understand that it is not easy to find the best website designing company in this digital world when lots of companies are claiming the best one to themselves. It is hard for customers to believe in a single one. That’s why for reducing the people confusion, we are providing the ideal services provider company that offers wonderful designing services. If you are planning to avail of such services, then let us help you. We are very sure that you would love our web designing services. Hurry up, hire us and uplift your online business with a beautiful yet professional website that is designed by us.Visit - https://www.pnjsharptech.com/web-designing-company
pnjwebservices Email Homepage
2020-5-25 14:32
We understand that it is not easy to find the best website designing company in this digital world when lots of companies are claiming the best one to themselves. It is hard for customers to believe in a single one. That’s why for reducing the people confusion, we are providing the ideal services provider company that offers wonderful designing services. If you are planning to avail of such services, then let us help you. We are very sure that you would love our web designing services. Hurry up, hire us and uplift your online business with a beautiful yet professional website that is designed by us.Visit - https://www.pnjsharptech.com/web-designing-company
robindunn50 Email Homepage
2020-5-25 16:06
Are you feeling tired because of a part-time occupation and can’t get time for your assignments? If you don’t want to lose your marks because of late or incomplete project submission, you need to think about Homework Help. When you are busy with your part-time jobs or some other kinds of work, you have to handle your time using online services.
avg retail
2020-5-26 18:03
AVG antivirus is a prominent virus protection program among the world of software . As many hackers and data stealers are waiting for the user’s mistake, they can misuse of user’s identity and other data. avg.com/retail |www.avg.com/retail
avg retail Email
2020-5-26 18:04
As many hackers and data stealers are waiting for the user’s mistake, they can misuse of user’s identity and other data. www.avg.com/retail |avg.com/retail
canon printer setup Email Homepage
2020-5-27 14:11
canon printer setup  into your pc, your system does not need to install the driver on it. Canon printer that can be downloaded via  page is the best wireless printer that you can connect to your device and print data smoothly.canon.com/ijsetup CD is not the well-suited technique to use canon.comijsetup setup installation for longer.
eset internet security Email Homepage
2020-5-27 14:13
eset internet security can be installed quickly on each device if the user follows the correct procedure. You can follow the instructions below to install the setup on your devices such as Windows PC, Mac, or mobile device. www.eset.com/ca/download Best IT security solutions for your home and business devices. Try ESET antivirus and internet security solutions for Windows, Android, Mac or Linux OS
david Email Homepage
2020-6-1 13:15
Delta Airlines is a significant American aircraft. Its fundamental center point is at the Hartsfield-Jackson Atlanta International Airport at Atlanta, Georgia. It is one of the establishing individuals from the SkyTeam Airline Alliance. Delta Airlines offers four classes of administration - Economy, Comfort Plus, First/Business Class, and Delta One.Read my blog: Delta Airlines Flights & Tickets Reservations
canon.com/ijsetup Email Homepage
2020-6-10 17:43
Canon printer into your pc, your system does not need to install the driver on it. Canon printer that can be downloaded via canon page is the best wireless printer that you can connect to your device and print data smoothly. Canon ij setup CD is not the well-suited technique to use canon.comijsetup setup installation for longer.canon.com/ijsetup , www.canon.com/ijsetup.
www.norton.com/enroll Email Homepage
2020-6-10 19:02
Norton to enroll and access the Norton account. Norton is in the top list of antivirus which safeguards the data, devices, identity, and others. Even its the question of business security or home network security, Norton is available for all kinds of security.https://www.nenroll-nenroll.com
installvipreantivirus Email Homepage
2020-6-13 18:34
Install vipre on your device and protect it from cyber threats.<a href="https://installvipreantivirus.com/">install vipre using product key</a><a href="https://installvipreantivirus.com/vipre-download-with-product-key/">vipre download with product key</a><a href="https://installvipreantivirus.com/vipre-activation/">vipre activation</a>  <a href="https://installvipreantivirus.com/i-need-to-install-vipre/">i need to install vipre</a>  <a href="https://installvipreantivirus.com/install-vipre-with-key-code/">install vipre with key code</a>
jhonmark Email Homepage
2020-6-15 14:32
Norton to enroll and access the Norton account. Norton is in the top list of antivirus which safeguards the data, devices, identity, and others. Even its the question of business security or home network security, Norton is available for all kinds of security.https://www.nenroll-nenroll.com
jhonmark Email Homepage
2020-6-15 14:35
AVG has created a  complete solution for users to save data through avg retail , which is AVG internet security. Malware and internet threats only do not affect your computer or device, but it is affecting your personal data as well. Using webcam spying and ransomware, hackers can easily steal your personal files, photos, videos, and any of your personal data.https://www.us-avg.com/retail
jhonmark Email Homepage
2020-6-15 14:35
AVG has created a  complete solution for users to save data through avg retail , which is AVG internet security. Malware and internet threats only do not affect your computer or device, but it is affecting your personal data as well. Using webcam spying and ransomware, hackers can easily steal your personal files, photos, videos, and any of your personal data.https://www.us-avg.com/retail
geeksquadwebroot Email Homepage
2020-6-15 17:56
Webroot Safe install is the most popular computer security that helps you to protect Windows,Mac and Android devices.Below mentioned are the services provided by webroot geek squadBelow mentioned are the services provided by webroot geek squad<a href="https://geeksquadwebroot.com/webroot-download/">webroot download</a><a href="https://geeksquadwebroot.com/webroot-download-geek-squad/">webroot download geek squad</a><a href="https://geeksquadwebroot.com/webroot-download-geek-squad-download/">webroot download geek squad download</a><a href="https://geeksquadwebroot.com/webroot-download-geeksquad/">webroot download geeksquad</a><a href="https://geeksquadwebroot.com/webroot-geek-squad-download-pc/">webroot geek squad download pc</a>https://geeksquadwebroot.com/webroot-download/https://geeksquadwebroot.com/webroot-download-geek-squad/https://geeksquad...
www.trendmicro.com/downloadme Email Homepage
2020-6-17 17:10
Downloading Trend Micro Australia can be done by visiting at . File decryption is the one big issue on systems which occurs due to virus or threats, and so Trend Micro provides security for data encryption.Going through the URL  on your browser will directly let you download Trend Micro Australia setup. Trend micro security has advanced security features to give a user its best privacy from viruses and malwares. www.trendmicro.com/downloadme | trendmicro.com/downloadme
www.norton.com/enroll Email Homepage
2020-6-20 13:19
Norton product key is 25 alphanumeric characters codes that you can enroll at norton.com/enroll site using Norton account. You can purchase it online like as well as offline. In the case of online purchases, go to online stores such as Walmart and purchase the product key. It will send you the Norton product key in your email. In the offline purchase, go  to website www.norton.com/enroll  store and purchase the retail card.
分页: 14/55 第一页 上页 9 10 11 12 13 14 15 16 17 18 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]