环境准备这里使用3台虚拟机来部署 mongodb 分片集群; 各角色使用的 ip, 端口如下表 角色 端口 ip 地址 mongos 28017 172.16.1.100 config 27017 172.16.1.100 config 27018 172.16.1.100 config 27019 172.16.1.100 shard1 27017 172.16.1.101 shard1 27018 172.16.1.101 shard1 27019 172.16.1.101 shard2 27017 172.16.1.102 shard2 27018 172.16.1.102 shard2 27019
由于 zabbix 自身并不支持告警分组及收敛功能,经常会出现告警信息轰炸的情况,为了解决这个情况可以使用 Alertmanager 来管理 zabbix 的告警消息 Alertmanager 特性Alertmanage
CentOSCentOS SSH 镜像 Dockerfile text FROM centos:centos7 LABEL maintainer="liwanggui" RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo \ && yum install -y openssh-server \ && yum install -y inetutils-ping iproute net-tools \ && yum clean all \ && echo '123456' | passwd --stdin root \ && ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \ && ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \ && ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key \ && ssh-keygen -t dsa -f /etc/ssh/ssh_host_ecdsa_key
fpm 简介fpm 的目标是使得构建二进制包 (deb, rpm, osx 等) 变得简单快速 fpm 项目地址: https://github.com/jordansissel/fpm fpm 文档地址: https://fpm.readthedocs.io/en/latest/ fpm 依赖fpm 使用 Ruby 开发, 所以你得先安装 Ruby. 有些系统中默认
简介find 是实时查找工具,通过遍历指定路径完成文件查找 工作特点: 查找速度略慢 精确查找 实时查找 查找条件丰富 只搜索用户具备读取和执行权限的目录
概述共享库这并不是一个全新的概念,其实具有编程能力的同学应该清楚一些。例如在编程语言 Python 中,我们可以将 Python 代码写到一个文件中,当代码数量增加,我
GET 请求使用 Groovy 发送 GET 请求非常简单,一行代码搞定 groovy def res1 = new URL('https://httpbin.org/ip').text // or def res2 = 'https://httpbin.org/ip'.toURL().text POST 请求使用标准库 URL 类,发送 POST 请求 groovy import groovy.json.JsonOutput import groovy.json.JsonSlurper /** * 发送 HTTP POST 请求 * @param url 请求的网
企业微信 API通过 python 调用企业微信的 api 接口来发送消息,可用于监控告警。使用 requests 模块。 python #!/usr/bin/python # -*- coding: utf-8 -*- # # pip install requests # import os import time import redis import requests class WXWork(object): def __init__(self, corpid, secret, agentid): self.token_file =
Paramiko Github 仓库: https://github.com/paramiko/paramiko Paramiko 扩展模块 scp.py Github 仓库: https://github.com/jbardin/scp.py 安装 paramiko bash pip install paramiko SSH 连接 用户名密码 python import paramiko client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy) client.connect(hostname='192.168.31.100', port=22, username='root', password='123456') stdin, stdout, stderr = client.exec_command('ls') for line in stdout: print('... ' + line.strip('\n')) client.close() 使用私钥 python import paramiko client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy) client.connect(hostname='192.168.31.100', port=22,
Github 官方仓库: https://github.com/pyauth/pyotp 生成密钥PyOTP 提供了一个帮助函数来生成一个16个字符的 base32 密钥,与Google Authenticator和其他OTP应用程序