SlideShare una empresa de Scribd logo
1 de 4
Descargar para leer sin conexión
How to Install and Setup Monit (Linux Process and Services
Monitoring) Program
Monit is a small Open Source utility for managing and monitoring Unix systems. Monit conducts
automatic maintenance and repair and can execute meaningful causal actions in error situations.
monit is a utility for managing and monitoring processes, files, directories and file systems on a
Unix system. Monit conducts automatic maintenance and repair and can execute meaningful causal
actions in error situations. E.g. Monit can start a process if it does not run, restart a process if it does
not respond and stop a process if it uses too much resources. You may use Monit to monitor files,
directories and file systems for changes, such as timestamps changes, checksum changes or size
changes.
Monit is controlled via an easy to configure control file based on a free-format, token-oriented
syntax. Monit logs to syslog or to its own log file and notifies you about error conditions via
customizable alert messages. Monit can perform various TCP/IP network checks, protocol checks and
can utilize SSL for such checks. Monit provides a http(s) interface and you may use a browser to access
the Monit program.
Install and Setup Monit on Centos6
# yum install monit
# vi /etc/monit.conf
## mailserver Setup ##
Note:- I have Google mail Server.
set mailserver smtp.gmail.com port 587
username "pawan.kumar@indianpetro.com" password "********"
using tlsv1
with timeout 30 seconds
## You can set alert recipients whom will receive alerts if/when a ##
set mail-format { from: monitor@indianpetro.com }
set alert pawan.kumar@indianpetro.com
mail-format {
from: monitor@indianpetro.com
subject: $SERVICE $EVENT at $DATE
message: Monit $ACTION $SERVICE at $DATE on $HOST,
Yours sincerely,
Pawan Kumar
Linux System Administrator
IndianPetro Group
(A Division of 360 Analytics & Advisory Pvt. Ltd.)
## Monit has an embedded web server which can be used to view status of###
set httpd port 2812 and
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
Monitoring Services Example
#################################### Mysql ########################
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group mysql
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout
#################################### SSH ############################
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/sshd start"
stop program "/etc/init.d/sshd stop"
if failed host 127.0.0.1 port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
############################ Tomcat1 ####################
check process tomcat with pidfile "/var/run/tomcat/tomcat.pid"
start program = "/usr/local/tomcat6/bin/startup.sh"
as uid root gid root
stop program = "/usr/local/tomcat6/bin/shutdown.sh"
as uid root gid root
if failed port 7070 then alert
if failed port 7070 for 5 cycles then restart
##################### Tomcat2 ###########################
check process tomcat1 with pidfile "/var/run/tomcat1/tomcat1.pid"
start program = "/usr/local/tomcat7/bin/startup.sh"
as uid pawan gid pawan
stop program = "/usr/local/tomcat7/bin/shutdown.sh"
as uid pawan gid pawan
if failed port 9090 then alert
if failed port 9090 for 5 cycles then restart
#### Then edit your catalina.sh and set ####
# vim /usr/local/tomcat/bin/catalina.sh
CATALINA_PID to be /var/run/tomcat/tomcat.pid
#mkdir /var/run/tomcat/
#chown root:root /var/run/tomcat/
Thanks
P@w@n Kumar
https://www.facebook.com/LinuxLiveScenarioClass

Más contenido relacionado

Destacado

El nuevo Houdini Chapter 5
El nuevo Houdini Chapter 5 El nuevo Houdini Chapter 5
El nuevo Houdini Chapter 5 ander1gp
 
El Nuevo houdini Chapter 6
El Nuevo houdini Chapter 6 El Nuevo houdini Chapter 6
El Nuevo houdini Chapter 6 ander1gp
 
Daily agri news letter 31 july 2013
Daily agri news letter 31 july 2013Daily agri news letter 31 july 2013
Daily agri news letter 31 july 2013Rakhi Tips Provider
 
New งานนำเสนอ microsoft office power point
New งานนำเสนอ microsoft office power pointNew งานนำเสนอ microsoft office power point
New งานนำเสนอ microsoft office power pointnoeiinoii
 
Daily agri news letter 11 dec 2013
Daily agri news letter 11 dec 2013Daily agri news letter 11 dec 2013
Daily agri news letter 11 dec 2013Rakhi Tips Provider
 
How New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming ExperiencesHow New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming ExperiencesStarr Long
 
Filozofia mea manageriala
Filozofia mea managerialaFilozofia mea manageriala
Filozofia mea managerialaHelp5S LooK
 
Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...
Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...
Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...IRIB
 
Daily agri news letter 16 july 2013
Daily agri news letter 16 july 2013Daily agri news letter 16 july 2013
Daily agri news letter 16 july 2013Rakhi Tips Provider
 

Destacado (12)

El nuevo Houdini Chapter 5
El nuevo Houdini Chapter 5 El nuevo Houdini Chapter 5
El nuevo Houdini Chapter 5
 
El Nuevo houdini Chapter 6
El Nuevo houdini Chapter 6 El Nuevo houdini Chapter 6
El Nuevo houdini Chapter 6
 
Filtros 150825050002-lva1-app6891
Filtros 150825050002-lva1-app6891Filtros 150825050002-lva1-app6891
Filtros 150825050002-lva1-app6891
 
Daily agri news letter 31 july 2013
Daily agri news letter 31 july 2013Daily agri news letter 31 july 2013
Daily agri news letter 31 july 2013
 
New งานนำเสนอ microsoft office power point
New งานนำเสนอ microsoft office power pointNew งานนำเสนอ microsoft office power point
New งานนำเสนอ microsoft office power point
 
Daily agri news letter 11 dec 2013
Daily agri news letter 11 dec 2013Daily agri news letter 11 dec 2013
Daily agri news letter 11 dec 2013
 
How New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming ExperiencesHow New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming Experiences
 
Filozofia mea manageriala
Filozofia mea managerialaFilozofia mea manageriala
Filozofia mea manageriala
 
Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...
Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...
Propostas de atendimento aos cartórios de Registro de Imóveis - Desenvolvedor...
 
MCX Market Updates 18-November
MCX Market Updates 18-NovemberMCX Market Updates 18-November
MCX Market Updates 18-November
 
Daily agri news letter 16 july 2013
Daily agri news letter 16 july 2013Daily agri news letter 16 july 2013
Daily agri news letter 16 july 2013
 
Primary care commissioning development programme v9
Primary care commissioning development programme   v9Primary care commissioning development programme   v9
Primary care commissioning development programme v9
 

Similar a monitoring linux system (20)

Monit
MonitMonit
Monit
 
Toby3
Toby3Toby3
Toby3
 
xxxx
xxxxxxxx
xxxx
 
yyyyxxxdd
yyyyxxxddyyyyxxxdd
yyyyxxxdd
 
new title
new titlenew title
new title
 
yyyyxxx
yyyyxxxyyyyxxx
yyyyxxx
 
Tinoub1
Tinoub1Tinoub1
Tinoub1
 
yyyyxxxdd
yyyyxxxddyyyyxxxdd
yyyyxxxdd
 
Toby2
Toby2Toby2
Toby2
 
yyyyxxx
yyyyxxxyyyyxxx
yyyyxxx
 
Monit a1
Monit a1Monit a1
Monit a1
 
Tinoub1
Tinoub1Tinoub1
Tinoub1
 
Toby5
Toby5Toby5
Toby5
 
Monit a2
Monit a2Monit a2
Monit a2
 
yyyyxxx
yyyyxxxyyyyxxx
yyyyxxx
 
Toby7
Toby7Toby7
Toby7
 
Tinoub1
Tinoub1Tinoub1
Tinoub1
 
Toby10
Toby10Toby10
Toby10
 
Toby7
Toby7Toby7
Toby7
 
Toby
Toby Toby
Toby
 

Más de Pawan Kumar

Ftp server linux
Ftp server linuxFtp server linux
Ftp server linuxPawan Kumar
 
Virtual Hosts Configuration with Weblogic Server
Virtual Hosts Configuration with Weblogic ServerVirtual Hosts Configuration with Weblogic Server
Virtual Hosts Configuration with Weblogic ServerPawan Kumar
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on LinuxPawan Kumar
 
My sql 5.6 master slave and master-master replication.step by step configurat...
My sql 5.6 master slave and master-master replication.step by step configurat...My sql 5.6 master slave and master-master replication.step by step configurat...
My sql 5.6 master slave and master-master replication.step by step configurat...Pawan Kumar
 
My sql 5.6 installation and upgradation steps in centos
My sql 5.6 installation and upgradation steps in centosMy sql 5.6 installation and upgradation steps in centos
My sql 5.6 installation and upgradation steps in centosPawan Kumar
 
Nagios pawan kumar- stpl 30042012
Nagios pawan kumar- stpl 30042012Nagios pawan kumar- stpl 30042012
Nagios pawan kumar- stpl 30042012Pawan Kumar
 

Más de Pawan Kumar (7)

Apache ofbiz
Apache ofbizApache ofbiz
Apache ofbiz
 
Ftp server linux
Ftp server linuxFtp server linux
Ftp server linux
 
Virtual Hosts Configuration with Weblogic Server
Virtual Hosts Configuration with Weblogic ServerVirtual Hosts Configuration with Weblogic Server
Virtual Hosts Configuration with Weblogic Server
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on Linux
 
My sql 5.6 master slave and master-master replication.step by step configurat...
My sql 5.6 master slave and master-master replication.step by step configurat...My sql 5.6 master slave and master-master replication.step by step configurat...
My sql 5.6 master slave and master-master replication.step by step configurat...
 
My sql 5.6 installation and upgradation steps in centos
My sql 5.6 installation and upgradation steps in centosMy sql 5.6 installation and upgradation steps in centos
My sql 5.6 installation and upgradation steps in centos
 
Nagios pawan kumar- stpl 30042012
Nagios pawan kumar- stpl 30042012Nagios pawan kumar- stpl 30042012
Nagios pawan kumar- stpl 30042012
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 

Último (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

monitoring linux system

  • 1. How to Install and Setup Monit (Linux Process and Services Monitoring) Program Monit is a small Open Source utility for managing and monitoring Unix systems. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. monit is a utility for managing and monitoring processes, files, directories and file systems on a Unix system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. E.g. Monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses too much resources. You may use Monit to monitor files, directories and file systems for changes, such as timestamps changes, checksum changes or size changes. Monit is controlled via an easy to configure control file based on a free-format, token-oriented syntax. Monit logs to syslog or to its own log file and notifies you about error conditions via customizable alert messages. Monit can perform various TCP/IP network checks, protocol checks and can utilize SSL for such checks. Monit provides a http(s) interface and you may use a browser to access the Monit program. Install and Setup Monit on Centos6 # yum install monit # vi /etc/monit.conf ## mailserver Setup ## Note:- I have Google mail Server. set mailserver smtp.gmail.com port 587 username "pawan.kumar@indianpetro.com" password "********" using tlsv1 with timeout 30 seconds ## You can set alert recipients whom will receive alerts if/when a ## set mail-format { from: monitor@indianpetro.com } set alert pawan.kumar@indianpetro.com mail-format { from: monitor@indianpetro.com subject: $SERVICE $EVENT at $DATE
  • 2. message: Monit $ACTION $SERVICE at $DATE on $HOST, Yours sincerely, Pawan Kumar Linux System Administrator IndianPetro Group (A Division of 360 Analytics & Advisory Pvt. Ltd.) ## Monit has an embedded web server which can be used to view status of### set httpd port 2812 and 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 Monitoring Services Example #################################### Mysql ######################## check process mysqld with pidfile /var/run/mysqld/mysqld.pid group mysql start program = "/etc/init.d/mysqld start" stop program = "/etc/init.d/mysqld stop" if failed host 127.0.0.1 port 3306 then restart if 5 restarts within 5 cycles then timeout
  • 3. #################################### SSH ############################ check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed host 127.0.0.1 port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout ############################ Tomcat1 #################### check process tomcat with pidfile "/var/run/tomcat/tomcat.pid" start program = "/usr/local/tomcat6/bin/startup.sh" as uid root gid root stop program = "/usr/local/tomcat6/bin/shutdown.sh" as uid root gid root if failed port 7070 then alert if failed port 7070 for 5 cycles then restart ##################### Tomcat2 ########################### check process tomcat1 with pidfile "/var/run/tomcat1/tomcat1.pid" start program = "/usr/local/tomcat7/bin/startup.sh" as uid pawan gid pawan stop program = "/usr/local/tomcat7/bin/shutdown.sh" as uid pawan gid pawan if failed port 9090 then alert if failed port 9090 for 5 cycles then restart
  • 4. #### Then edit your catalina.sh and set #### # vim /usr/local/tomcat/bin/catalina.sh CATALINA_PID to be /var/run/tomcat/tomcat.pid #mkdir /var/run/tomcat/ #chown root:root /var/run/tomcat/ Thanks P@w@n Kumar https://www.facebook.com/LinuxLiveScenarioClass