Kedu otu esi etinye sọftụwia nlekota Monit na CentOS Webpanel (CWP7)?

N'ime nkuzi a, anyị ga-egosi gị otu esi eme yaCentOS Nwụnye CentOS Webpanel (CWP7) na 7Monit nlekota.

Kedu ihe bụ nlekota Monit?

Nleba anya Monit bụ ebe mepere emepe na efu软件, ọ bụ nnọọ uruLinuxusoro nlekota oru.

  • Ọ nwere ike nyochaa ma jikwaa usoro ihe nkesa na-akpaghị aka, faịlụ, akwụkwọ ndekọ aha, ikike checksum, sistemụ faịlụ na ọrụ na UNIX/Linux.
  • Dịka ọmụmaatụ: Apache, Nginx,MySQL, FTP, SSH, Postfix, wdg ...
  • Njikwa sistemụ dabere na sistemụ na-enye ikike nleba anya dị mma maka ndị na-ahụ maka sistemụ.

Kedu ihe kpatara ịwụnye nlekota Moit?

Ị nwere ike iji nlekota Moit iji belata oge nkwụsị, eeE-azụmahịawebụsaịtịSEOnaỊre ahịa ịntanetịbụ ihe inyeaka.

N'ihi na mgbe ọrụ ọ bụla dara, Monit na-enyocha ya wee malite ọrụ ahụ na-akpaghị aka.

Dịka ọmụmaatụ: ọ bụrụ na ọrụ Apache ma ọ bụ Nginx gị dara n'enweghị ihe kpatara ya, mgbe ahụ, monit ga-elele, ma ọ bụrụ na achọpụta na ọ dị ala, mgbe ahụ monit ga-amalite ọrụ yiri ya ozugbo.

Otu ihe na-adọrọ mmasị bụ na monit na-arụ ọrụ httpd nke ya.

Ọ bụrụ na ọrụ apache gị adalata, monit ga-eji ọrụ nke ya rụọ ọrụ.

Otu esi etinye ma wụnye ngwanrọ nlekota Moit na CWP 7?

Iji mezue nkuzi a, ị ga-achọ ihe ndị a chọrọ:

  1.  CentOS Linux ụdị 7 (isi)
  2.  MMA7
  3.  CSF Firewall

Nzọụkwụ 1: SSHMelite ebe nchekwa YUM gị, wee wụnye Monit monitoring▼

yum update -y
yum install monit

nke 2:Mepee ọdụ ụgbọ mmiri 2812 na CSF firewall ▼

vi /etc/csf/csf.conf
# Allow incoming TCP ports
 TCP_IN = "20,21,22,2812,25,53,80,110,143,443,465,587,993,995,2030,2031,2082,2083,2086,2087,2095,2096" 

Nzọụkwụ 3: Malitegharịa ekwentị CSF Firewall▼

csf -r 

nke 4:na SFTP软件Mgbe ịbanye na ihe nkesa Linux, dezie faịlụ nhazi Monit/etc/monitrc

set daemon  30              # check services at 30 seconds intervals
set log syslog
set pidfile /var/run/monit.pid
set idfile  /var/.monit.id
set statefile /var/.monit.state
include /etc/monit.d/*
set mailserver localhost port 25
set eventqueue
basedir /var/monit  # set the base directory where events will be stored
slots 100           # optionally limit the queue size
set alert admin@xxxxx #receive all alerts
set alert admin@xxxxx not on { instance, action } 
set httpd port 2812 and use address 0.0.0.0 
allow 0.0.0.0/0.0.0.0 
allow admin:monit # require user 'admin' with password 'monit'

nke 5:Lelee Monit syntax maka mmejọ ▼

# monit -t
Control file syntax OK  

Ọ bụrụ na-efu, mepụta faịlụ ndị a:

# touch /var/run/monit.pid 
# touch /var/log/moinit.log

Ọ bụrụ na etinyere Redis, ị nwere ike iji aka hazie adreesị ebe Redis' pid file ▼

Monit na-agbakwụnye ọrụ nlekota oru

Ugbu a, anyị ga-enyocha ụfọdụ ọrụ dị kaamavisd, cland, crond, php-fpm na cwpsrv.Mepee faịlụ nhazi monit/etc/monitrc, ma tinye koodu a na njedebe nke ahịrị:

Nyochaa CWP.amavisd 

# vi /etc/monitrc 
check process amavisd with pidfile /var/run/amavisd/amavisd.pid
        start program "/usr/bin/systemctl start amavisd.service"
        stop program "/usr/bin/systemctl stop amavisd.service"
        if failed unixsocket /var/run/amavisd/amavisd.sock then restart
        if cpu > 70% for 4 cycles then alert
        if cpu > 90% for 8 cycles then restart
        if 4 restarts within 8 cycles then timeout

Nyochaa CWP.clamd

# vi /etc/monitrc 

check process clamd with pidfile /var/run/clamd.amavisd/clamd.pid
        start program "/usr/bin/systemctl start clamd.service"
        stop program "/usr/bin/systemctl stop clamd.service"
        if failed unixsocket /var/run/clamd.amavisd/clamd.sock then restart
        if cpu > 70% for 4 cycles then alert
        if cpu > 90% for 8 cycles then restart
        if 4 restarts within 8 cycles then timeout 

Nyochaa CWP.crond

# vi /etc/monitrc 

check process crond with pidfile /var/run/crond.pid
        start program = "/usr/bin/systemctl start crond.service"
        stop  program = "/usr/bin/systemctl stop crond.service" 

Nyochaa CWP.cwp-phpfpm

# vi /etc/monitrc

check process cwp-phpfpm matching "cwp-phpfpm"
        start program "/usr/bin/systemctl start cwp-phpfpm.service"
        stop program "/usr/bin/systemctl stop cwp-phpfpm.service"
        if failed unixsocket /usr/local/cwp/php71/var/sockets/cwpsrv.sock then restart
        if failed unixsocket /usr/local/cwp/php71/var/sockets/cwpsvc.sock then restart
        if failed unixsocket /usr/local/cwp/php71/var/sockets/login.sock then restart
        if cpu > 70% for 4 cycles then alert
        if cpu > 90% for 8 cycles then restart
        if 4 restarts within 8 cycles then timeout 

nyochaa cwp.cwpsrv

# vi /etc/monitrc

check process cwpsrv with pidfile /usr/local/cwpsrv/var/run/nginx.pid
        start program "/usr/bin/systemctl start cwpsrv.service"
        stop program "/usr/bin/systemctl stop cwpsrv.service"
        if 4 restarts within 8 cycles then timeout 

Ozugbo ahaziri, monit kwesịrị ibugharị ma gụọ faịlụ nhazi ahụ, interface webụ ahụ ga-adị:

monit reload

查询MySQL nchekwa dataMaka usoro nke usoro pidfile, biko lelee nkuzi n'okpuru ▼

Ọrụ nlekota oru MonitỤzọ ọzọ (atụ aro)

1) Budata faịlụ ọrụ nlekota Monit▼

  • Na ibe nbudata, pịa bọtịnụ "Budata Ugbu a" na nbudata nkịtị ka ibudata faịlụ ọrụ nlekota Monit n'efu.
  • Koodu nzipu ozi: 5588

2) Wepu ma bulite na /etc/monit.d/ directory.

  • ọ bụrụ n'imeNyochaa faịlụ nhazi Enwere ọrụ nlekota nke nwere otu nhazi na /etc/monitrc, nke kwesịrị ịdịNaNyochaa faịlụ nhazi /etc/monitrc na-ehichapụ, ma ọ bụghị ya, njehie ga-eme.

Mgbe ịmepụtachara faịlụ nhazi achọrọ, nwalee maka njehie syntax▼

monit -t

Ọ bụrụ na ihe na-esonụ pụtara ▼

monit -t
/etc/monit.d/cwp.mariadbd:1: Service name conflict, mysql already defined '"/usr/sbin/mariadbd"'
  • Nke a pụtara na /etc/monit.d/cwp.mariadbd:1: Esemokwu aha ọrụ; mysql akọwapụtalarị '"/usr/sbin/mariadbd"'
  • ebe a bụ nkọwacwp.mariadbdFaịlụ adịlarị, naanị hichapụ yacwp.mysqldfaịlụ.

Ọ bụrụ na enweghị mperi, gbanye ma malitegharịa ọrụ monit ▼

systemctl enable monit
systemctl restart monit

Malite ọrụ Monit na buut▼

systemctl enable monit.service

Ugbu a lelee ndekọ nlekota oru ▼

tail -f /var/log/monit.log

Nyochaa iwu ndị bụ isi

Jiri iwu na-esonụ malite monit ▼

monit

Lelee ọkwa Monit ▼

monit status

Bugharịa ya ka mgbanwe ndị ahụ dị irè▼

monit reload

Malite ịme mmemme niile nke Monit▼ na-enyocha

monit start all

Malitegharịa ọrụ nleba anya ikuku Monit niile▼

monit restart all

Ka ịmalite, kwụsị ma malitegharịa ọrụ ụfọdụ, ị nwere ike ijimonit start nameiwu dị otú ahụ ▼

monit start httpd
monit stop sshd 
monit restart nginx

Monit nlekota nchịkọta ▼

monit summary

Kedu otu esi etinye sọftụwia nlekota Monit na CentOS Webpanel (CWP7)?

Ugbu a, banye na sava monit site na iji aha njirimara na paswọọdụ Monit ị debere na mbụ.

URL nbanye:http://SERVER_FQDN:2812

Dozie nsogbu ahụ na anaghị enyocha ọrụ Monit mgbe niile

Monit gụnyere iwu maka inye na gbanyụọ nlekota oru niile ma ọ bụ kpọmkwem.

Ọ bụrụ na anaghị elele ọrụ Monit mgbe niile, ịnwere ike iji iwu a▼

monit monitor mysql

Ma ọ bụ megharịa nyocha niile▼

monit monitor all
  • Rịba ama na ị ga-emerịrị interface Monit HTTP ka iwu ndị a rụọ ọrụ.

Iwu Monit (Pụrụ iche maka CentOS 7)

Lelee ọkwa mmalite Monit▼

systemctl status monit.service

Malite ọrụ Monit▼

systemctl start monit.service

Mechie ọrụ Monit▼

systemctl stop monit.service

Malitegharịa ọrụ Monit▼

systemctl restart monit

Malite ọrụ Monit na buut▼

systemctl enable monit.service

Gbanyụọ ma gbanyụọ ọrụ Monit▼

systemctl disable monit.service

Ihe ndetu nlekota

Monit na-enyocha usoro ọrụ, nke pụtara na ọrụ Monit na-enyocha enweghị ike ịkwụsị iji usoro nkịtị, n'ihi na ozugbo kwụsịrị, Monit ga-amalitekwa ha ọzọ.

Ka ịkwụsị ọrụ Monit na-enyocha, ị kwesịrị iji ihe dịkamonit stop nameIwu dị otú ahụ, dịka ọmụmaatụ ịkwụsị nginx ▼

monit stop nginx

Ka ịkwụsị ọrụ niile Monit na-enyocha, tinye iwu a▼

monit stop all

Wepu mmemme nlekota Monit ▼

yum remove monit

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) kesara "Otu esi etinye ngwanrọ nlekota Monit na CentOS Webpanel (CWP7)? , iji nyere gị aka.

Nnọọ ka ị kesaa njikọ nke akụkọ a:https://www.chenweiliang.com/cwl-1443.html

Nabata na ọwa Telegram nke blọgụ Chen Weiliang ka ị nweta mmelite kachasị ọhụrụ!

🔔 Bụrụ onye mbụ nweta "ChatGPT Content Marketing AI Tool Guideing" bara uru na akwụkwọ ndekọ aha kacha elu! 🌟
📚 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!

 

评论

Adreesị email gị agaghị ebipụta. Achọrọ ubi na-eji * Label

pịgharịa gaa n'elu