仮想マシンを構築した後、ブラウザからmonit service managerにhttp://192.168.55.109:2812/でアクセスできます。
ユーザ名はadmin、パスワードにmonitを指定します。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.4"
config.vm.hostname = "co74monit"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co74monit"
vbox.cpus = 2
vbox.memory = 1024
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.109", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.109", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
# install monit
yum -y install epel-release
yum -y install monit
# configure settings for web interface
sed -i -e 's/use address localhost/use address 192.168.55.109/' /etc/monitrc
sed -i -e 's#allow localhost#allow 192.168.55.0/24#' /etc/monitrc
systemctl enable monit
systemctl start monit
echo 'access http://192.168.55.109:2812/';;
echo 'user: admin password: monit'
SHELL
end
monit service managerの画面
0 件のコメント:
コメントを投稿