Question

I can not use monit in aws amazon instance

Hi There

I tried to use monit in my aws server.

I have followed below step, but I can not view http://xxx.xxx.xxx.xxx:2812/

ERR_CONNECTION_REFUSED

Did I miss something?

sudo yum install monit


$ sudo cp /etc/monit.conf /etc/monit.conf.default   
$ sudo vim /etc/monit.conf
  # 監視間隔
  set daemon 60

  # primary, secondly
  set mailserver example.com, second.exsample.com

  set mail-format {
    From: monit@exsample.com
    # あとはデフォルトでもいい気がする
  }   

  set alert hoge@exsample.com

  include /etc/monit.d/*
  
$ sudo vim /etc/minit.d/sshd.monit

  check process sshd with pidfile /var/run/sshd.pid
  every 2 cycle
  group system
  start programe = "/etc/init.d/sshd start"
  stop programe = "/etc/init.d/sshd stop"
  if 5 restarts within 5 cycles then unmonitor
  
$ sudo vim /etc/monit.d/nginx.monit

  check process nginx with pidfile /var/run/nginx.pid
    start program = "/etc/init.d/nginx start"
    stop program = "/etc/init.d/nginx stop"
Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @kamthang:

a bit late but … make sure on the security group on your ec2 instance make sure tcp port 2812 is open for all or only for the remote ip address from where u r trying http://xxx.xxx.xxx.xxx:2812/ and have monit listen to 2812 for all ip and if xxx.xxx.xxx.xxx is on a network where there is firewall make sure tcp port 2812 for outgoing traffice is allow/pass

View the original comment