python资源统计导出excle

https://www.cnblogs.com/zhoujie/p/python18.html #!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : Uwei # @File : status_info.py import MySQLdb import xlwt def cpu_info(ip='17.22.144.182', user='root', passwd='tongze@2011', port='3306'): # 从监控系统数据库中统计数据 try: conn = MySQLdb.connect(host=ip, user=user, passwd=passwd, db="itoss", connect_timeout=10, port=int(port), charset='utf8') cur = conn.cursor() sql_cpu = "SELECT m.CreatedDateTime,m.StatusCreateTime,m.EquipmentId,m.RecId,m.MonitorStatus,m.Title,m.MonitorValue,m.MonitorType,m.LastModDateTime,m.IsDisabled,a.ETitle,a.ServerAddress,a.GroupName,a.gId FROM Monitor m LEFT JOIN (SELECT e.RecId AS ERecId,e.title AS ETitle,e.ServerAddress,g.GroupName,g.RecId gId FROM Equipment [阅读全文]

py激活码和视频教程

网站:

http://vip.rootoot.com

帐:tao

密:tao123456

ZKVVPH4MIO-eyJsaWNlbnNlSWQiOiJaS1ZWUEg0TUlPIiwibGljZW5zZWVOYW1lIjoi5o6I5p2D5Luj55CG5ZWGIGh0dHA6Ly9pZGVhLmhrLmNuIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IiIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJmYWxsYmFja0RhdGUiOiIyMDE5LTA3LTAxIiwicGFpZFVwVG8iOiIyMDIwLTA2LTMwIn0seyJjb2RlIjoiQUMiLCJmYWxsYmFja0RhdGUiOiIyMDE5LTA3LTAxIiwicGFpZFVwVG8iOiIyMDIwLTA2LTMwIn0seyJjb2RlIjoiRFBOIiwiZmFsbGJhY2tEYXRlIjoiMjAxOS0wNy0wMSIsInBhaWRVcFRvIjoiMjAyMC0wNi0zMCJ9LHsiY29kZSI6IlBTIiwiZmFsbGJhY2tEYXRlIjoiMjAxOS0wNy0wMSIsInBhaWRV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8gyG8oiNDyNEoAbsR3lOpI7grUYSvkB/xVy/VoklPCK2h0f0GJxFjnye8NT1PAywoyl7RmiAVRE/EKwIDAQABo4GZMIGWMAkGA1UdEwQCMAAwHQYDVR0OBBYEFGEpG9oZGcfLMGNBkY7SgHiMGgTcMEgGA1UdIwRBMD+AFKOetkhnQhI2Qb1t4Lm0oFKLl/GzoRykGjAYMRYwFAYDVQQDDA1KZXRQcm9maWxlIENBggkA0myxg7KDeeEwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCwYDVR0PBAQDAgWgMA0GCSqGSIb3DQEBCwUAA4ICAQAF8uc+YJOHHwOFcPzmbjcxNDuGoOUIP+2h1R75Lecswb7ru2LWWSUMtXVKQzChLNPn/72W0k+oI056tgiwuG7M49LXp4zQVlQnFmWU1wwGvVhq5R63Rpjx1zjGUhcXgayu7+9zMUW596Lbomsg8qVve6euqsrFicYkIIuUu4zYPndJwfe0YkS5nY72SHnNdbPhEnN8wcB2Kz+OIG0lih3yz5EqFhld03bGp222ZQCIghCTVL6QBNadGsiN/lWLl4JdR3lJkZzlpFdiHijoVRdWeSWqM4y0t23c92HXKrgppoSV18XMxrWVdoSM3nuMHwxGhFyde05OdDtLpCv+jlWf5REAHHA201pAU6bJSZINyHDUTB+Beo28rRXSwSh3OUIvYwKNVeoBY+KwOJ7WnuTCUq1meE6GkKc4D/cXmgpOyW/1SmBz3XjVIi/zprZ0zf3qH5mkphtg6ksjKgKjmx1cXfZAAX6wcDBNaCL+Ortep1Dh8xDUbqbBVNBL4jbiL3i3xsfNiyJgaZ5sX7i8tmStEpLbPwvHcByuf59qJhV/bZOl8KqJBETCDJcY6O2aqhTUy+9x93ThKs1GKrRPePrWPluud7ttlgtRveit/pcBrnQcXOl1rHq7ByB8CFAxNotRUYL9IF5n3wJOgkPojMy6jetQA5Ogc8Sm7RG6vg1yow==

tcp自动发现脚本,监控tomcat端口

154上执行成功 import os import json def tomcat9090(a): a = str(a).rstrip('\n') tem0 = { "targets": [a + ":9090"], "labels": { "instance": a + ":9090", "tomcat": "9090", "env": "prod" } } return tem0 def tomcat9091(a): a = str(a).rstrip('\n') tem1 = { "targets": [a + ":9091"], "labels": { "instance": a + ":9091", "tomcat": "9091", "env": "prod" } } return tem1 def tomcat9092(a): a = str(a).rstrip('\n') tem2 [阅读全文]

检查微服务接口的python脚本

https://www.cnblogs.com/yourstars/p/8196054.html https://www.cnblogs.com/yoyoketang/p/8035428.html 准备工作,安装库 apt install <a href="http://yw8.tech/tag/python/" title="查看与 python 相关的文章" target="_blank">python</a>-pip 2版本的 apt install python3-pip pip3 install requests #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 18-8-8 上午9:00 # @Author : [阅读全文]

检测REDIS健康的脚本

#!/usr/bin/env <a href="http://yw8.tech/tag/python/" title="查看与 python 相关的文章" target="_blank">python</a> # -*-coding:utf-8-*- import redis def __init__(): host = '17.2.32.181' port = 6379 try: r = redis.Redis(host,port) value = r.randomkey() print value with open('/opt/181redis.txt', 'w') as f: f.write(value) return value except Exception as e: print e with open('/opt/181redis.txt', 'w') as f: f.write(str(e)) [阅读全文]

获取exsi信息统计

通过连接vcenter 管理服务器,获取其下所有的:存储,网络,ESXI实体机,虚拟机相关信息的脚本: pip3 install pyVmomi python3 esxi.py -s 10.41.2.2 -uadministrator@vsphere.local -p 1qSX >esxi.txt #!/opt/python3/bin/python3 #Author: zhaoyong """ 只用于模拟 [阅读全文]

记gitlib搭建与pycharm连接

# 安装gitlib vim /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key yum install curl openssh-server openssh-clients postfix cronie service postfix start chkconfig postfix on yum install gitlab-ce gitlab-ctl reconfigure cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 一些命令 gitlab-ctl start gitlab-ctl reconfigure 默认用户名 admin@local.host 密码 5iveL!fe 把github的代码弄到git [阅读全文]