[文章作者:张宴 本文版本: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技术 | 评论(824) | 引用(0) | 阅读(110324)
carry parker Email Homepage
2020-7-13 15:48
Login to Microsoft 365 account and enter the product key at office setup page on the relevant field. Use your Microsoft account for everything you work on office products. Being a prominent software program in the work field, Microsoft offers many apps for Windows, Mac, tablets, and phones.www.office.com/setup |  office.com/setup
carry parker Email Homepage
2020-7-13 15:48
Download and install norton with product key  on Windows and Mac. Create an account, sign in and download Norton antivirus. In this era of digital work, antivirus is necessary to keep your device safe. Norton can secure your device, data, online work, identity, network, and others.installing norton with product key | install norton with product key | www.bullguard.com is-install-mdl-install | garmin.com/express
office.com/setup Email
2020-7-13 17:09
The activation key of MS Office is 25 alphanumeric characters code. It activates Office product software. You can get the key from the online portal as well as the offline store. To get the license online, purchase a brand-new copy of Office setup with the activation key.https://wpssoffice.com/
norton.com/enroll Email
2020-7-13 17:10
Norton product key is 25 alphanumeric characters codes that you can enroll at 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  store and purchase the retail card.https://enroll-enroll.com
Mark Email Homepage
2020-7-13 22:02
Mcafee offers complete protection support and malware detection algorithms, making it better as a classic antivirus program. It also provides a free trial to try the application then go with premium to utilize a proper McAfee antivirus program. mcafee.com/activate with our device security is essential to secure our online presence and connected devices.Canon printers are amazingly better than ever printer, which possesses complete hardcore printing technology that is advance in this period. You can also go for canon.com/ijsetup or ij.start.canon for the download and installation process.
patrick Email Homepage
2020-7-16 14:59
How to get reliable AT&T tech support quicklyAT&T is the telecommunications giant of the country. It is an integral part of the lives of millions of Americans through wired and wireless telephony. Consumers have a high regard for the company and its services. Are you experiencing some minor technical issues with AT&T service these days? Is your mobile losing signals suddenly? Do you need support for the device you are using? Just dial 1-877-916-7666, our popular and trusted AT&T tech support centre, to get a quick and authentic resolution. This is a toll free AT&T help line that remains open at all times on all 7 days of the week.
office Email Homepage
2020-7-20 13:37
To activate the Microsoft Office, you are required to enter the product key. You will get the product key on the basis of your Office version. In case you have purchased a retail office.com/setup, then the activation key will be available inside the package. On the other side, the key will be sent to your registered email address if you brought an online version through www.office.com/setup . Here is the full breakdown of how the client can activate the Office on the desired system.
norton Email Homepage
2020-7-20 13:37
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.
mcafee activate Email
2020-7-20 14:13
McAfee is one of the most known security suites for computers and other digital devices. By installing McAfee in your computer, you can prevent your device from such internet threats and malicious software. www.mcafee.com/activate ,mcafee.com/activate ,mcafee. com/activate key code,www.mcafee.com activate code
mcafee com activate Email
2020-7-20 14:13
McAfee antivirus ensures that all harmful entities stay away from the device. If it detects any unusual or malicious activity, it immediately notifies the user and blocks it. www.mcafee.com activate ,mcafee. com/activate ,mcafee com activate ,mcafee activate 25 digit code
office setup Email
2020-7-20 14:14
The Office is compatible and available for Android and iOS. Also, one can get a single app separately or the complete Office with all the apps.office.com/setup ,www.office.com/setup
norton.com/enroll Email Homepage
2020-7-21 19:10
Windows and Mac Installation If you have downloaded the Install Norton With Product Key from the above instructions, then it’s time to install Norton With Product Key on windows as well as on Mac. www.norton.com/enroll | norton.com/enroll
www.mcafee.com/activate Email Homepage
2020-7-21 19:15
The present digital world is filled with threats. If you are an optimist and have total faith in your device’s first-party antivirus, then it’s great but fighting against advanced malware and viruses requires modern technology. www.mcafee.com/activate |  mcafee.com/activate |www.mcafee.com activate
norton.com/enroll Email Homepage
2020-7-22 14:32
Windows and Mac Installation If you have downloaded the Install Norton With Product Key from the above instructions, then it’s time to install Norton With Product Key on windows as well as on Mac. www.norton.com/enroll | norton.com/enroll
Airlines Gethuman Email Homepage
2020-7-24 22:16
Thanks for your article. It was interesting and informative.Here I also want to suggest your reader who usually travels one place to another they must visit Airlines Gethuman that offer best deals to book your seat on Delta Airlines Reservations. So do hurry and avail the best deals and get rid of to check different websites for offers. Qatar Airways Booking
norton.com/enroll Email Homepage
2020-7-27 14:19
Windows and Mac Installation If you have downloaded the Install Norton With Product Key from the above instructions, then it’s time to install Norton With Product Key on windows as well as on Mac. www.norton.com/enroll | norton.com/enroll
mathewroger Email Homepage
2020-7-30 14:37
How to call Quickbooks support for instant resolution of issuesQuickbooks is undoubtedly the most popular online accounting software these days. It is being used by thousands of business owners for bookkeeping and for preparation of payrolls. Is your Quickbooks creating some minor technical issue these days? Do you want to transfer bank transactions but your software will not update them? Do you want to make changes in payroll according to your business needs? Whatever the issue, you can get full support by contacting our Quickbooks helpline.Just call Quickbooks support at 1-877-916-7666 and breathe easy. Our qualified professional will listen to your problems and provide authentic solutions quickly. Our Quickbooks tech support centre has helped hundreds of customers in recent months. You can get help for your problems anytime you so desire.
mattjohnn Email Homepage
2020-8-5 03:14
Go to the web browser of the device, in which you want Paypal Card Activation it is in the smartphone, MAC, or laptop. In the URL bar address type www.paypal.com/activatecard. Keep in mind the connectivity of the internet should be strong, which will be very helpful in smoothly running the app.
mattjohnn Email Homepage
2020-8-5 03:15
When we look for Used Body Parts For Car we mainly focus on its quality as quilty is the important thing we all know. But what if, you get the best quality product with a good warranty and for a reasonable price. So now you don’t need to search Advance Auto Parts Near Me you only have to contact us on our number and get the best quality auto parts for your car. For more details, visit now at topautopartservice.com
mattjohnn Email Homepage
2020-8-5 03:16
Encountered an issue with a cash app? Can’t get the right response from the payment app? Or you figure out something suspicious with your account. To Dispute cash app payment, Cash App Payment Failed or manage other related issues, just stay with our support representatives for phone call help.
分页: 17/42 第一页 上页 12 13 14 15 16 17 18 19 20 21 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]