• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinoLinux ApplicationsUse monit software on pcDuino Ubuntu
Previous Next

Use monit software on pcDuino Ubuntu

Posted by: Yang , July 7, 2014

1 . How To Install and Configure Monit on pcDuino Ubuntu

http://learn.linksprite.com/pcduino/linux-applications/how-to-install-and-configure-monit-on-pcduino-ubuntu/

2 .Configure Monit To Monitor Apache Service

Let’s start with adding services in Monit to monitor them and take necessary action on condition meet. The very first service we are adding Apache. Edit your monit configuration file and add following settings at end of file

check process apache with pidfile /run/apache2.pid
    start program = "/etc/init.d/apache2 start" with timeout 60 seconds
    stop program  = "/etc/init.d/apache2 stop"

Now restart monit service using service monit restart and check the status of service using command line.

# monit summary

The Monit daemon 5.6 uptime: 15h 25m

Process 'apache'          running
System 'pcDuino'          running

3.Configure Monit To Monitor MySQL/MariaDB

Let’s add MySQL server in Monit configuration file to monitor it. PID file location and init script may change as per your MySQL version installed.

check process mysqld with pidfile /var/run/mysqld/mysqld.pid
    start program = "/etc/init.d/mysql start"
    stop program = "/etc/init.d/mysql stop"

To Read more about monit configuration exmaples visit http://mmonit.com/wiki/Monit/ConfigurationExamples

Verify Configuration and Test

After adding required services in monit monitoring configuration file, Use the below command to verify syntax of file

# monit -t

Now restart monit service

# service monit restart

Now view the summary of monitoring processes and services by Monit.

Now view the summary of monitoring processes and services by Monit.

# monit summary

The Monit daemon 5.6  uptime: 15h 28m

Process 'apache'                    running
Process 'mysqld'                    running
System 'pcDuino'                    running

To view detailed description of each service use the following command

# monit status
The Monit daemon 5.6  uptime: 15h 35m

Process 'apache'
  status                            running
  monitoring status                 monitored
  pid                               13406
  parent pid                        1
  uptime                            14h 24m
  children                          10
  memory kilobytes                  12132
  memory kilobytes total            8080
  memory percent                    5.3%
  memory percent total              4.3%
  cpu percent                       0.0%
  cpu percent total                 0.0%
  data collected                    Tue, 08 Jul 2014 01:04:36

Process 'mysqld'
  status                            running
  monitoring status                 monitored
  pid                               1935
  parent pid                        1811
  uptime                            14h 24m
  children                          0
  memory kilobytes                  76984
  memory kilobytes total            76984
  memory percent                    8.7%
  memory percent total              8.7%
  cpu percent                       0.0%
  cpu percent total                 0.0%
  data collected                    Tue, 08 Jul 2014 01:04:36

System 'svr1.tecadmin.net'
  status                            running
  monitoring status                 monitored
  load average                      [0.06] [0.07] [0.06]
  cpu                               0.2%us 0.1%sy 0.2%wa
  memory usage                      215468 kB [56.7%]
  data collected                    Tue, 08 Jul 2014 01:04:36

Tags: Linux Applications

Share!
Tweet

Yang

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors