- 浏览: 2543461 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Monitor Tool 2019(2)Monit on Multiple Instances and Email Alerts
We can visit the page URL on all the instances
http://rancher-home:2812/
Get some XML feed back as follow:
http://rancher-home:2812/_status?format=xml
Run the command as sudo/root
cat haproxy
check process haproxy with pidfile /opt/haproxy/haproxy.pid
start program = "/bin/sh -c '/opt/haproxy/sbin/haproxy -f /opt/haproxy/conf/haproxy.conf'" with timeout 20 seconds
stop program = "/usr/bin/kill haproxy"
if changed pid then restart
Email Configuration
set mailserver smtp.gmail.com port 587
username "luohuazju@gmail.com" password “xxxxxxxxxx"
using tlsv1
with timeout 30 seconds
set alert luohuazju@gmail.com
set mail-format {
from: luohuazju@gmail.com
subject: monitor alert - [$SERVICE] $EVENT
message:
[$SERVICE] $EVENT
Date: $DATE
Action: $ACTION
Host: $HOST
Description: $DESCRIPTION
Best regards.
from Monitor
}
Reload the service
> sudo monit reload
Exception
[CDT Oct 17 20:05:46] error : Mail: Mailserver response error -- 534-5.7.9 Application-specific password required. Learn more at
[CDT Oct 17 20:05:46] error : SMTP: Mailserver response error -- 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor v10sm1094726otk.17 - gsmtp
[CDT Oct 17 20:05:46] error : Aborting event
Solution:
Go to google account [Security] —> [Signing to Google] —> [Password] —> [App password] generate one for MAC Server
Check the logging
> tail -f /var/log/monit.log
We can manually kill the haproxy to see the alert emails.
Check this UI Tool
https://github.com/adriaaah/monit-dashboard
> sudo yum install epel-release
> sudo yum install python-pip
> sudo pip install --upgrade pip
> sudo pip install web.py
> sudo yum install python-requests python-xmltodict python-simplejson
> git clone https://github.com/adriaaah/monit-dashboard
> cd monit-dashboard/
> cp conf/servers.json.example conf/servers.json
> ./bin/monit-dashboard.py
It seems not working because of the Python Version
Since we want to migrate all the things to Python3, install and prepare python3
Install PYENV from the latest github
> git clone https://github.com/pyenv/pyenv.git ~/.pyenv
Add to the PATH
> vi ~/.bash_profile
PATH=$PATH:$HOME/.pyenv/bin
eval "$(pyenv init -)"
> . ~/.bash_profile
Check installation
> pyenv -v
pyenv 1.2.14-5-g68a77df
Install the Python3 and Python2
> pyenv install 3.6.0
> pyenv install 2.7.10
Check all the versions, latest is 3.7.4, install some other versions
https://www.python.org/downloads/
> sudo yum install libffi-devel
>sudo yum install sqlite-devel
> sudo yum install bzip2-devel
> pyenv install 3.8.0
> pyenv versions
* system (set by /home/carl/.pyenv/version)
3.8.0
> pyenv global 3.8.0
> python -V
Python 3.8.0
> pip install web.py
> pip install requests
> pip install xmltodict
> pip install simplejson
> python ./bin/monit-dashboard.py
http://0.0.0.0:8080/
Not working at all, I may need to do something similar here myself.
http://webpy.org/install
https://github.com/adriaaah/monit-dashboard
References:
https://imil.net/blog/2016/03/16/Fetch-monit-status-in-JSON/
http://webpy.org/
https://github.com/adriaaah/monit-dashboard
https://serverfault.com/questions/432053/monit-http-based-api/764226
https://serverfault.com/questions/709931/monit-cant-restart-nginx
email
https://my.oschina.net/HeAlvin/blog/918177
https://gist.github.com/jcdarwin/fa9235dd48276f348cc7
https://serverfault.com/questions/635139/how-to-fix-send-mail-authorization-failed-534-5-7-14
We can visit the page URL on all the instances
http://rancher-home:2812/
Get some XML feed back as follow:
http://rancher-home:2812/_status?format=xml
Run the command as sudo/root
cat haproxy
check process haproxy with pidfile /opt/haproxy/haproxy.pid
start program = "/bin/sh -c '/opt/haproxy/sbin/haproxy -f /opt/haproxy/conf/haproxy.conf'" with timeout 20 seconds
stop program = "/usr/bin/kill haproxy"
if changed pid then restart
Email Configuration
set mailserver smtp.gmail.com port 587
username "luohuazju@gmail.com" password “xxxxxxxxxx"
using tlsv1
with timeout 30 seconds
set alert luohuazju@gmail.com
set mail-format {
from: luohuazju@gmail.com
subject: monitor alert - [$SERVICE] $EVENT
message:
[$SERVICE] $EVENT
Date: $DATE
Action: $ACTION
Host: $HOST
Description: $DESCRIPTION
Best regards.
from Monitor
}
Reload the service
> sudo monit reload
Exception
[CDT Oct 17 20:05:46] error : Mail: Mailserver response error -- 534-5.7.9 Application-specific password required. Learn more at
[CDT Oct 17 20:05:46] error : SMTP: Mailserver response error -- 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor v10sm1094726otk.17 - gsmtp
[CDT Oct 17 20:05:46] error : Aborting event
Solution:
Go to google account [Security] —> [Signing to Google] —> [Password] —> [App password] generate one for MAC Server
Check the logging
> tail -f /var/log/monit.log
We can manually kill the haproxy to see the alert emails.
Check this UI Tool
https://github.com/adriaaah/monit-dashboard
> sudo yum install epel-release
> sudo yum install python-pip
> sudo pip install --upgrade pip
> sudo pip install web.py
> sudo yum install python-requests python-xmltodict python-simplejson
> git clone https://github.com/adriaaah/monit-dashboard
> cd monit-dashboard/
> cp conf/servers.json.example conf/servers.json
> ./bin/monit-dashboard.py
It seems not working because of the Python Version
Since we want to migrate all the things to Python3, install and prepare python3
Install PYENV from the latest github
> git clone https://github.com/pyenv/pyenv.git ~/.pyenv
Add to the PATH
> vi ~/.bash_profile
PATH=$PATH:$HOME/.pyenv/bin
eval "$(pyenv init -)"
> . ~/.bash_profile
Check installation
> pyenv -v
pyenv 1.2.14-5-g68a77df
Install the Python3 and Python2
> pyenv install 3.6.0
> pyenv install 2.7.10
Check all the versions, latest is 3.7.4, install some other versions
https://www.python.org/downloads/
> sudo yum install libffi-devel
>sudo yum install sqlite-devel
> sudo yum install bzip2-devel
> pyenv install 3.8.0
> pyenv versions
* system (set by /home/carl/.pyenv/version)
3.8.0
> pyenv global 3.8.0
> python -V
Python 3.8.0
> pip install web.py
> pip install requests
> pip install xmltodict
> pip install simplejson
> python ./bin/monit-dashboard.py
http://0.0.0.0:8080/
Not working at all, I may need to do something similar here myself.
http://webpy.org/install
https://github.com/adriaaah/monit-dashboard
References:
https://imil.net/blog/2016/03/16/Fetch-monit-status-in-JSON/
http://webpy.org/
https://github.com/adriaaah/monit-dashboard
https://serverfault.com/questions/432053/monit-http-based-api/764226
https://serverfault.com/questions/709931/monit-cant-restart-nginx
https://my.oschina.net/HeAlvin/blog/918177
https://gist.github.com/jcdarwin/fa9235dd48276f348cc7
https://serverfault.com/questions/635139/how-to-fix-send-mail-authorization-failed-534-5-7-14
发表评论
-
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 468NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 362Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 364Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 330Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 424Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 430Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 367Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 445VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 377Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 469NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 415Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 332Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 243GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 446GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 321GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 307Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 313Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 288Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 303Serverless with NodeJS and Tenc ...
相关推荐
Monit 是一款强大的系统监控工具,它允许用户对运行在Linux或Unix系统上的服务、进程、文件、目录、网络资源等进行实时监控。通过Monit,你可以轻松地检测和管理服务器上的各种状态,如内存使用、CPU负载、磁盘空间...
The purpose of this document is to give minimum safety, ergonomic, and performance requirements and test methods for Camera Monitor Systems (CMS) to replace mandatory inside and outside rearview ...
Monit 是一个开源的系统和进程监控工具,它可以在Linux系统中用来监控系统服务、文件、目录、网络接口等,并在出现问题时进行自动修复或通知管理员。CentOS 7是基于RHEL(Red Hat Enterprise Linux)的一个流行的...
Monit 是一个开源工具,用于管理系统进程、文件系统、网络接口和系统状态。在Linux和Unix-like系统中,Monit 可以监控指定的服务是否正常运行,并在出现问题时自动修复或重启服务,确保系统的稳定性和可靠性。这个...
Monit 是一款强大的系统管理工具,专为Unix系统设计,用于监控和管理进程、文件、目录和设备。它具备自动修复功能,可以在检测到错误时执行预设的响应操作,如启动、重启或关闭进程。此外,Monit 还能监控文件、目录...
A wireless sensor network (WSN) consists of spatially distributed autonomous sensors to cooperatively monitor physical or environmental conditions, such as temperature, sound, vibration, pressure, ...
2. **电源管理与兼容性**:USB规范还涉及电源管理,设备通过线缆从主机获取电力。扩展线缆可能会引入额外的电阻,导致电压下降,影响设备的供电。此外,扩展线缆可能导致电源分配混乱,影响到USB总线上的其他设备,...
Ansible-monit.zip,配置monit的ansible角色。还将设置ssh、ntp和cron.anxs-monit的基线监视,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。
ISO TR 27923-2022 Carbon dioxide capture, transportation and geological storage - Injection operations, infrastructure and monit.pdf
2. 配置:解压后,进入新创建的目录 `cd monit-5.0.1`。运行 `./configure` 脚本来检查系统环境并配置构建设置。这个过程会根据你的系统配置生成合适的Makefile。 3. 编译与安装:执行 `make` 来编译源代码,然后...
Monit 是一款在 Unix-like 系统中广泛使用的开源监控工具,主要用于监控系统服务、文件、目录、程序以及网络资源的状态。"monit-4.9.tar" 是这个软件的一个特定版本,通常以 tar 归档文件的形式提供,用于在各种 ...
Monit是一款功能非常丰富的进程、文件、目录和设备的监测软件。它可以自动修复那些已经停止运作的程序,特使适合处理那些由于多种原因导致的软件错误。
Monit 服务器监控系统搭建指南 一、Monit 介绍 Monit 是一种跨平台的开源工具,用于监控 Unix/Linux 系统。它安装起来非常容易,也非常轻量级(大小只有 500KB),并不需要任何第三方程序、插件或代码库。Monit ...
2. **Monit 的安装与配置** Monit 的安装通常可以通过包管理器(如`apt-get` 或 `yum`)完成。安装完成后,配置文件通常位于 `/etc/monit/monitrc`,在此文件中,用户可以定义需要监控的项目及其行为。 3. **Monit...
docker-monit可用于从提取该图像包括监控版本5.13概述此映像将monit安装到以下位置: / opt / monit Monit配置为由runit(phusion / baseimage-docker的init系统)执行和管理。 它将以名为monit的非特权用户身份...
Ansible角色,用于安装Monit并设置服务监视。 用法(示例) 典型的最小用法: - role : monit 在不安装和使用自定义服务的情况下配置monit: - role : monit monit_setup : configure monit_custom_services ...
Monit 是一个开源的系统监控工具,用于管理进程、文件、目录、设备、网络接口等。它可以在系统异常时自动修复问题,确保服务的稳定运行。`monit_bin-源码.rar` 提供了 Monit 的源代码,这对于开发者和系统管理员来说...
monit_bin 食谱 从源安装monit。 包括设置工具monitensite、monitdisite。 为创建的配置添加 LWRP。 要求 制作(构建必不可少) 平台 乌本图 智能操作系统 用法 recipe[monit]默认安装。 从其他食谱调用 include...
**Python-monit库详解** `python-monit` 是一个针对Monit系统的Python接口库,它允许程序员通过Python代码与Monit进行交互,从而方便地管理、监控和控制系统的各项服务和资源。Monit是一款强大的开源工具,用于监视...