Akwụkwọ ndekọ ederede
CentOS 6 Otu esi ejinlekota nlekota?
LinuxWụnye ma wepụ nkuzi monit
Mmemme nlekota monit bụ ngwa nleba anya nke mepere emepe maka sistemụ arụmọrụ Linux Ọ nwere ike inyere gị aka iji ihe nchọgharị wee nyochaa usoro sistemụ mgbe mmemme ma ọ bụ ọrụ dara, monit nwere ike ịmalitegharị ya ozugbo.
Enwere ike iji monit rụọ ọrụ ozugbo na ahịrị iwu, ị nwere ike kenye ọtụtụ ọrụ monit (ọ bụghị naanị nlekota oru), yabụ ọ bụrụ na ụfọdụ ọrụ dara nlele, ị nwere ike gafere monit ma ọ bụ mee ihe (gbalịa ịmalitegharị ụfọdụ ọrụ).
Isiokwu a na-eche na ị maara ma ọ dịkarịa ala isi ihe Linux, mara ka esi eji SSH, na nke kachasị mkpa, na ị kwadoro ebe nrụọrụ weebụ gị na VPS gị.
Ntinye nke mmemme nlekota Monit dị nnọọ mfe, m ga-egosi gị nzọụkwụ site nzọụkwụ ntinye nke monit na CentOS 6.
Kwụpụ 1: Kwado ebe nchekwa EPEL
RHEL/CentOS 7 64-bit:
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm
RHEL/CentOS 6 32-bit:
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm
- CentOS 7 anaghị akwado ebe nchekwa EPEL 32-bit, yabụ jiri, RHEL/CentOS 6 32-bit.
Nzọụkwụ 2: Wụnye monit
yum update yum install -y libcrypto.so.6 libssl.so.6 yum install monit
Nzọụkwụ 3: Hazie monit
Ozugbo etinyere ya, dezie faịlụ nhazi isi wee tọọ aha njirimara na paswọọdụ gị, lee ihe atụ n'okpuru:
nano /etc/monit.conf
Dezie monit nhazi faịlụ:
set httpd port 2812 and # # set the listening port to your desire. use address localhost # only accept connection from localhost allow localhost # allow localhost to connect to the server and allow admin:monit # require user 'admin' with password 'monit' allow @monit # allow users of group 'monit' to connect (rw) allow @users readonly # allow users of group 'users' to connect readonly
Maka nkọwa gbasara otu esi ahazi monit, biko chọgharịa nke a"Otu esi ahazi faịlụ monit.conf? monit nhazi faịlụ nkọwa nkọwa"akụkọ.
Ozugbo ịmegharịrị nhazi ọhụrụ ahụ, ịkwesịrị ịme ka ntọala mbugharị nke ọrụ monit:
/etc/init.d/monit start
monit standard start, kwụsị, malitegharịa iwu:
/etc/init.d/monit start /etc/init.d/monit stop /etc/init.d/monit restart
Kwụpụ 4: Hazie ọrụ nlekota monit
Mgbe nhazi mbụ ahụ mechara, anyị nwere ike ịhazi ụfọdụ ọrụ anyị chọrọ nyochaa.
Nke a bụ ụfọdụ ọmụmaatụ nhazi bara uru maka monit:
# # 监控apache # check process apache with pidfile /usr/local/apache/logs/httpd.pid start program = "/etc/init.d/httpd start" stop program = "/etc/init.d/httpd stop" if failed host www.ufo.org.in port 80 protocol http then restart if 3 restarts within 5 cycles then timeout group server # #监控mysql(1) # check process mysqld with pidfile /var/run/mysqld/mysqld.pid start program = "/etc/init.d/mysqld start" stop program = "/etc/init.d/mysqld stop" if failed host localhost port 3306 for 3 times within 4 cycles then alert #若在四个周期内,三次 3306(我的Mysql)端口都无法连通,则邮件通知 if 5 restarts within 5 cycles then timeout # #检测nginx服务 # check process nginx with pidfile /usr/local/nginx/logs/nginx.pid start program = "/etc/init.d/nginx start" stop program = "/etc/init.d/nginx stop" if failed host localhost port 80 protocol http then restart
Mgbe ịmepụtachara faịlụ nhazi achọrọ, nwalee maka njehie syntax:
monit -t
Malite nyochaa site na ịpị naanị:
monit
Ka ịtọọ monit ka ọ malite na sistemụ, gbakwunye na njedebe nke faịlụ /etc/inittab:
# Run monit in standard run-levels mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc
Ihe ndetu nlekota
Ebe ọ bụ na edobere monit dị ka usoro daemon, na ntọala ndị na-amalite na sistemụ na-agbakwunye na initab, ọ bụrụ na usoro monit akwụsị, usoro init ga-amaliteghachi ya, ma nyochaa ọrụ ndị ọzọ, nke pụtara na monit Monitors Services enweghị ike ịbụ. kwụsịrị iji usoro a na-emebu, n'ihi na ozugbo kwụsịrị, monit ga-amalite ha ọzọ.
Ka ịkwụsị ọrụ Monit na-enyocha, ị kwesịrị iji ihe dịkamont stop ahaIwu dị ka nke a, dịka ọmụmaatụ, ịkwụsị nginx:
monit stop nginx
Ka ịkwụsị ọrụ niile a na-enyocha site na iji mont:
monit stop all
Iji malite ọrụ ị nwere ike ijimonit mmalite ahaiwu dị otú ahụ.
Malite niile:
monit start all
Wepụ ihe nrụnye:
yum remove monit
Ịgbatịkwu oge:
- "Otu esi ahazi faịlụ monit.conf? monit nhazi faịlụ nkọwa nkọwa"
- "Kedu ihe m ga-eme ma ọ bụrụ na mmemme monit na-enyocha ọdịda nke mysqld? Ihe ngwọta maka ọdịda nke nchekwa data Linux"
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) kesara "CentOS 6 ka esi eji nlekota Monit? Nwụnye Linux na mwepụ nke Monit Tutorial" ga-enyere gị aka.
Nnọọ ka ị kesaa njikọ nke akụkọ a:https://www.chenweiliang.com/cwl-159.html
Nabata na ọwa Telegram nke blọgụ Chen Weiliang ka ị nweta mmelite kachasị ọhụrụ!
📚 Ntuziaka a nwere nnukwu uru, 🌟Nke a bụ ohere dị ụkọ, echefula ya! ⏰⌛💨
Kekọrịta na-amasị ma ọ bụrụ na-amasị gị!
Ịkekọrịta na mmasị gị bụ mkpali anyị na-aga n'ihu!