- 浏览: 2542418 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
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(1)Monit Installation and Usage
On CentOS 7
> sudo yum install monit
Check version
> monit -V
This is Monit version 5.25.1
Built with ssl, with ipv6, with compression, with pam and with large files
Copyright (C) 2001-2017 Tildeslash Ltd. All Rights Reserved.
Some useful command
Check configuration file
> sudo monit -t
Control file syntax OK
The configuration file will be
/etc/monitrc
/etc/monit.d/
Start the service
> sudo monit
Starting Monit 5.25.1 daemon with http interface at [localhost]:2812
Reload the configuration
> sudo monit reload
Reinitializing monit daemon
Check status
> sudo monit status
Monit 5.25.1 uptime: 1m
System 'rancher-home'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
load average [0.09] [0.66] [0.49]
cpu 3.2%us 1.7%sy 0.7%wa
memory usage 1.3 GB [45.6%]
swap usage 264 kB [0.0%]
uptime 7m
boot time Sat, 12 Oct 2019 17:14:20
data collected Sat, 12 Oct 2019 17:21:46
My first simple configuration file is as follow:
> sudo vi /etc/monitrc
set daemon 30 # check services at 30 seconds intervals
set httpd port 2812 and
use address rancher-home
allow admin:admin
include /etc/monit.d/*
Visit this page to see some basic monitor informations.
http://rancher-home:2812/
We can configure all the monitor separately in /etc/monit.d/*
Check Disk
> df -lh
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 9.3M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/mapper/centos-root 36G 12G 25G 33% /
/dev/sda1 1014M 232M 783M 23% /boot
tmpfs 285M 0 285M 0% /run/user/1000
Add the configuration file follow the pattern
check <Type> <ServiceName> [PATH <path>] [ADDRESS <host address>]
Type - system, file, process, fifo, filesystem, directory, host, network, program
> cat /etc/monit.d/filesystem
check filesystem datafs with path /dev/mapper/centos-root
if space usage > 50% then alert
group server
Check config
> sudo monit -t
Control file syntax OK
Restart the service
> sudo monit reload
Reinitializing monit daemon
More example:
https://www.cnblogs.com/52fhy/p/6412547.html
Try monitor HAProxy
http://rancher-home:8100/stats
PID file
> ls -l /opt/haproxy/haproxy.pid
-rw-r--r--. 1 root root 12 Oct 13 11:33 /opt/haproxy/haproxy.pid
REG process
> ps -ef | grep haproxy
nobody 23904 1 0 11:33 ? 00:00:00 sbin/haproxy -f conf/haproxy.conf
nobody 23905 1 0 11:33 ? 00:00:00 sbin/haproxy -f conf/haproxy.conf
carl 25127 17104 0 11:38 pts/1 00:00:00 grep --color=auto haproxy
Here is how the haproxy configuration
> cat /etc/monit.d/haproxy
check process haproxy with pidfile /opt/haproxy/haproxy.pid
start program = "/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
Latest document
https://mmonit.com/monit/documentation/monit.html
Source Installation
https://cloud.tencent.com/developer/article/1114319
Check the latest version from here
https://mmonit.com/monit/dist/
> wget https://mmonit.com/monit/dist/monit-5.26.0.tar.gz
> tar zxvf monit-5.26.0.tar.gz
> cd monit-5.26.0
Some possible Exception
configure: error: libz not found
configure: error: PAM enabled but headers or library not found, install the PAM development support or run configure --without-pam
Couldn't find your SSL header files.
Use --with-ssl-incl-dir option to fix this problem or disable
the SSL support with --without-ssl
Prepare build ENV if needed
> sudo yum groupinstall "Development tools"
> sudo yum install zlib-devel
> sudo yum list *pam*
> sudo yum install pam-devel
> sudo yum install openssl-devel
Configure and Build
> ./configure --prefix=/home/carl/tool/monit-5.26.0
> make
> make install
Prepare the configuration file
> sudo cp monitrc /etc/monitrc
> sudo chown root:root /etc/monitrc
> sudo chmod 0700 /etc/monitrc
> sudo ln -s /home/carl/tool/monit-5.26.0 /opt/monit-5.26.0
> sudo ln -s /opt/monit-5.26.0 /opt/monit
Change the configuration as follow:
set httpd port 2812 and
use address rancher-worker2
allow 0.0.0.0/0.0.0.0
allow admin:admin
include /etc/monit.d/*
Start the service
> sudo bin/monit
References:
https://www.jianshu.com/p/248d6456e83f
https://linjunzhu.github.io/blog/2015/08/14/ru-he-shi-yong-monitjian-kong-jin-cheng/
https://mmonit.com/monit/documentation/monit.html
https://cloud.tencent.com/developer/article/1114319
On CentOS 7
> sudo yum install monit
Check version
> monit -V
This is Monit version 5.25.1
Built with ssl, with ipv6, with compression, with pam and with large files
Copyright (C) 2001-2017 Tildeslash Ltd. All Rights Reserved.
Some useful command
Check configuration file
> sudo monit -t
Control file syntax OK
The configuration file will be
/etc/monitrc
/etc/monit.d/
Start the service
> sudo monit
Starting Monit 5.25.1 daemon with http interface at [localhost]:2812
Reload the configuration
> sudo monit reload
Reinitializing monit daemon
Check status
> sudo monit status
Monit 5.25.1 uptime: 1m
System 'rancher-home'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
load average [0.09] [0.66] [0.49]
cpu 3.2%us 1.7%sy 0.7%wa
memory usage 1.3 GB [45.6%]
swap usage 264 kB [0.0%]
uptime 7m
boot time Sat, 12 Oct 2019 17:14:20
data collected Sat, 12 Oct 2019 17:21:46
My first simple configuration file is as follow:
> sudo vi /etc/monitrc
set daemon 30 # check services at 30 seconds intervals
set httpd port 2812 and
use address rancher-home
allow admin:admin
include /etc/monit.d/*
Visit this page to see some basic monitor informations.
http://rancher-home:2812/
We can configure all the monitor separately in /etc/monit.d/*
Check Disk
> df -lh
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 9.3M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/mapper/centos-root 36G 12G 25G 33% /
/dev/sda1 1014M 232M 783M 23% /boot
tmpfs 285M 0 285M 0% /run/user/1000
Add the configuration file follow the pattern
check <Type> <ServiceName> [PATH <path>] [ADDRESS <host address>]
Type - system, file, process, fifo, filesystem, directory, host, network, program
> cat /etc/monit.d/filesystem
check filesystem datafs with path /dev/mapper/centos-root
if space usage > 50% then alert
group server
Check config
> sudo monit -t
Control file syntax OK
Restart the service
> sudo monit reload
Reinitializing monit daemon
More example:
https://www.cnblogs.com/52fhy/p/6412547.html
Try monitor HAProxy
http://rancher-home:8100/stats
PID file
> ls -l /opt/haproxy/haproxy.pid
-rw-r--r--. 1 root root 12 Oct 13 11:33 /opt/haproxy/haproxy.pid
REG process
> ps -ef | grep haproxy
nobody 23904 1 0 11:33 ? 00:00:00 sbin/haproxy -f conf/haproxy.conf
nobody 23905 1 0 11:33 ? 00:00:00 sbin/haproxy -f conf/haproxy.conf
carl 25127 17104 0 11:38 pts/1 00:00:00 grep --color=auto haproxy
Here is how the haproxy configuration
> cat /etc/monit.d/haproxy
check process haproxy with pidfile /opt/haproxy/haproxy.pid
start program = "/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
Latest document
https://mmonit.com/monit/documentation/monit.html
Source Installation
https://cloud.tencent.com/developer/article/1114319
Check the latest version from here
https://mmonit.com/monit/dist/
> wget https://mmonit.com/monit/dist/monit-5.26.0.tar.gz
> tar zxvf monit-5.26.0.tar.gz
> cd monit-5.26.0
Some possible Exception
configure: error: libz not found
configure: error: PAM enabled but headers or library not found, install the PAM development support or run configure --without-pam
Couldn't find your SSL header files.
Use --with-ssl-incl-dir option to fix this problem or disable
the SSL support with --without-ssl
Prepare build ENV if needed
> sudo yum groupinstall "Development tools"
> sudo yum install zlib-devel
> sudo yum list *pam*
> sudo yum install pam-devel
> sudo yum install openssl-devel
Configure and Build
> ./configure --prefix=/home/carl/tool/monit-5.26.0
> make
> make install
Prepare the configuration file
> sudo cp monitrc /etc/monitrc
> sudo chown root:root /etc/monitrc
> sudo chmod 0700 /etc/monitrc
> sudo ln -s /home/carl/tool/monit-5.26.0 /opt/monit-5.26.0
> sudo ln -s /opt/monit-5.26.0 /opt/monit
Change the configuration as follow:
set httpd port 2812 and
use address rancher-worker2
allow 0.0.0.0/0.0.0.0
allow admin:admin
include /etc/monit.d/*
Start the service
> sudo bin/monit
References:
https://www.jianshu.com/p/248d6456e83f
https://linjunzhu.github.io/blog/2015/08/14/ru-he-shi-yong-monitjian-kong-jin-cheng/
https://mmonit.com/monit/documentation/monit.html
https://cloud.tencent.com/developer/article/1114319
发表评论
-
Update Site will come soon
2021-06-02 04:10 1672I am still keep notes my tech n ... -
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 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 366Docker 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 468NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 414Prometheus 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 445GraphQL 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 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 286Serverless 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 可能会安装在`/usr/local/bin/`目录下,其用户手册位于`/usr/local/man/man1`。 Monit 的主要功能包括: 1. 监控本地进程:特别是那些作为守护进程运行的服务,如邮件服务器、打印服务器、数据库...
A wireless sensor network (WSN) consists of spatially distributed autonomous sensors to cooperatively monitor physical or environmental conditions, such as temperature, sound, vibration, pressure, ...
Ansible-monit.zip,配置monit的ansible角色。还将设置ssh、ntp和cron.anxs-monit的基线监视,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。
1. **源代码**:Monit 的源代码文件,通常位于`src/`目录下,这些代码是用C语言编写的,允许用户进行自定义配置和编译。 2. **配置文件**:Monit 的配置文件(如`monitrc`)用于设置监控项、检查间隔、警报通知等。...
Advanced Battery Monitor I used to have a battery usage graph widget on my home page (I won't say which one, but it was quite popular), but after I bought a Nexus 5, it started to have problems -- it ...
Monit 是一款在 Unix-like 系统中广泛使用的开源监控工具,主要用于监控系统服务、文件、目录、程序以及网络资源的状态。"monit-4.9.tar" 是这个软件的一个特定版本,通常以 tar 归档文件的形式提供,用于在各种 ...
ISO TR 27923-2022 Carbon dioxide capture, transportation and geological storage - Injection operations, infrastructure and monit.pdf
1. 下载:首先,你需要从官方网站或镜像站点下载 Monit 的源代码包。在这个例子中,你已经有了名为 "monit-5.0.1.tar.gz" 的压缩包。这是一个使用gzip压缩的tar文件,可以通过 `tar -zxvf monit-5.0.1.tar.gz` 命令...
cpu_usage = cpu_monitor.get_cpu_usage() print(f"当前CPU使用率:{cpu_usage}%") ``` 此外,Python库的版本管理很重要。`0.2.5`表明这是库的第三个主要更新(0.x.y),其中x代表次要版本号,y代表修订版本号。这...
Monit是一款功能非常丰富的进程、文件、目录和设备的监测软件。它可以自动修复那些已经停止运作的程序,特使适合处理那些由于多种原因导致的软件错误。
Monit 服务器监控系统搭建指南 一、Monit 介绍 Monit 是一种跨平台的开源工具,用于监控 Unix/Linux 系统。它安装起来非常容易,也非常轻量级(大小只有 500KB),并不需要任何第三方程序、插件或代码库。Monit ...
1. **Monit 的主要功能** - **进程监控**:Monit 可以监控指定的进程,确保它们正常运行。如果某个进程意外终止,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 ...
1. **进程监控**:Monit 可以监视指定的进程,确保它们在预期的状态下运行。如果进程意外终止,Monit 可以尝试重新启动它。 2. **文件系统监控**:它可以监视文件或目录的完整性,检测是否有未经授权的修改或损坏,...
AsydSolutions/monit 这是来自官方的分支,包括一些小的更改,用于从 XML Web API 获取更详细的输出以用于 ASYD(即主机故障通知)。 ASYD 版本基于带有上述补丁的最新稳定版 Monit(当前为 5.11)。 您可以查看...