代码改变世界

python监控MongoDB服务进程,故障钉钉告警

2024-04-22 17:01 by ndzj, 2 阅读, 0 推荐, 收藏, 编辑
摘要:服务器1 xx.168.8x.77 #!/usr/bin/python#! _*_ coding:utf-8 _*_import osimport sysimport time mongo_ip = '192.168.xx.77'ports = ['x001','x002']def port(ip, 阅读全文

pyhon脚本监控远程服务器存活情况,异常发送钉钉告警

2024-04-22 14:17 by ndzj, 4 阅读, 0 推荐, 收藏, 编辑
摘要:#!/usr/bin/python#! _*_ coding:utf-8 _*_import osimport timefrom collections import Counterfrom datetime import datetimehost = 'localhost'ips = ['192. 阅读全文

基于NTP的时间同步

2023-08-30 11:07 by ndzj, 19 阅读, 0 推荐, 收藏, 编辑
摘要:CentOS基于NTP的时间同步(How) 1、安装ntp: yum install ntp 2、修改/etc/ntp.conf # Use public servers from the pool.ntp.org project. # Please consider joining the poo 阅读全文

Python3多线程并发写入数据到MongoDB

2023-08-22 14:34 by ndzj, 1 阅读, 0 推荐, 收藏, 编辑
摘要:!/usr/bin/python ! * coding:utf-8 * from pymongo import MongoClient import threading import time 连接单机 single mongo c = MongoClient(host="192.168.89.15 阅读全文

时间同步服务器

2023-01-31 09:43 by ndzj, 123 阅读, 0 推荐, 收藏, 编辑
摘要:chrony的介绍 chrony是网络时间协议(NTP)的另a56爆大奖在线娱乐实现,与网络时间协议后台程序(ntpd)不同,它可以更快地且更准确地同步系统时钟,请注意,ntpd仍然包含其中以供需要运行NTP服务的客户使用。 chrony的优势包括以下几点: (1)更快的同步只需要数分钟而非数小时时间,从而最大程度 阅读全文

MySQL 内存检查脚本

2022-12-28 17:38 by ndzj, 31 阅读, 0 推荐, 收藏, 编辑
摘要:#!/bin/sh mysql -uroot -pxxx -h172.16.13.179 -P 3305 -e "show variables; show status" | awk ' { VAR[$1]=$2 } END { MAX_CONN = VAR["max_connections"] M 阅读全文

各压缩工具对比

2022-12-28 17:19 by ndzj, 330 阅读, 0 推荐, 收藏, 编辑
摘要:lz4 zstd tar.gz tar.bz2 pigz 压缩前大小 26G 26G 26G 26G 26G 压缩后大小 6.2G 3.5G 3.6G 2.6G 3.6G 压缩比率 4.19 7.42 7.22 10 7.22 压缩耗时 1m24s 38s 12m54s 107m41s 1m47.s 阅读全文

mongodb shell设置

2022-12-26 10:58 by ndzj, 35 阅读, 0 推荐, 收藏, 编辑
摘要:host=db.serverStatus().host; cmdCount=1; prompt=function(){ return db+"@"+host+" "+(cmdCount++) +">"; } function showDate(){ var today = new Date(); v 阅读全文

Navicat Premium 工具安装和激活

2022-12-06 15:05 by ndzj, 246 阅读, 0 推荐, 收藏, 编辑
摘要:安装包下载: https://pan.baidu.com/s/1-0k7gGalLKhfiqngQMj-fg?pwd=3hpk 安装好navicat工具后不要打开软件,接下来是激活软件 打开激活软件,点Patch,找到安装navicat工具 接下来是点击Generate生成Keygen 最后一步是打 阅读全文

mongodb单实例lvm快照备份和恢复

2022-12-02 13:42 by ndzj, 110 阅读, 0 推荐, 收藏, 编辑
摘要:ps -ef|grep mongo #查看mongodb实例数据目录所在位置 root 1525 1389 3 20:44 pts/0 00:00:17 /usr/local/mongodb/bin/mongod –config /data/mongodb/conf/mongo_config.yml 阅读全文