ansible monit

[root@localhost yum.repos.d]# ansible localhost -m shell -a "rpm -ivh monit-5.25.1-1.el7.x86_64.rpm"
 [WARNING]: Consider using the yum, dnf or zypper module rather than running 'rpm'.
If you need to use command because yum, dnf or zypper is insufficient you can add
'warn: false' to this command task or set 'command_warnings=False' in ansible.cfg to
get rid of this message.

localhost | CHANGED | rc=0 >>
Preparing...                          ########################################
Updating / installing...
monit-5.25.1-1.el7                    ########################################

[root@localhost yum.repos.d]# vi /etc/monit
monit.d/   monitorix/ monitrc 
[root@localhost yum.repos.d]# vi /etc/monitrc
[root@localhost yum.repos.d]# service monit status
Redirecting to /bin/systemctl status monit.service
● monit.service - Pro-active monitoring utility for unix systems
   Loaded: loaded (/usr/lib/systemd/system/monit.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@localhost yum.repos.d]# ansible localhost -m shell -a "service monit status"
 [WARNING]: Consider using the service module rather than running 'service'.  If you
need to use command because service is insufficient you can add 'warn: false' to this
command task or set 'command_warnings=False' in ansible.cfg to get rid of this
message.
[root@localhost yum.repos.d]# ansible localhost -m shell -a "service monit start"
 [WARNING]: Consider using the service module rather than running 'service'.  If you
need to use command because service is insufficient you can add 'warn: false' to this
command task or set 'command_warnings=False' in ansible.cfg to get rid of this
message.

localhost | CHANGED | rc=0 >>
Redirecting to /bin/systemctl start monit.service

[root@localhost yum.repos.d]# vi /etc/monitrc

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'

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

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

https://docs.google.com/document/d/e/2PACX-1vQ8wrNqHXt4Cqughv6b5BUYCnapiMMVL0Myh5bgbbgukTrpfmIlH1hwYabm1AnaPlbpMXfLGJu9UGCi/pub

https://docs.google.com/document/d/e/2PACX-1vT6_TFFBRtDBCekQezsXu5OGiDd6p97llmFHoghm9PzTsE-SiyrTwNUTpk_VyzeTza4UrpLYJECShYM/pub

Comments

Popular posts from this blog

ansible redhat cluster qorum qdevice

PE 3.9.0 on centos 6

gfs2 cluster