一.python日志模块二.python数据库连接三.时间处理模块四.python传递参数给shell五.发送邮件(py2.7)六.python计划任务七.supervisor/etc/supervisor.conf
[program:check]
command=python/data/remote_back/checkbackup.py
directory=/data/remote_back
user=root
root@GS_TM..
分类:
编程语言 时间:
2015-03-03 06:28:52
阅读次数:
319
安装很简单
pip install psutil
官网地址为
https://pythonhosted.org/psutil/ (文档上有详细的api)
github地址为
https://github.com/giampaolo/psutil/
psutil比较好的地方,一个是跨平台,不需要切换平台的时候在重新开放了,另外一个好...
分类:
编程语言 时间:
2014-12-12 11:46:45
阅读次数:
398
zabbix监控的机器越来越多,新增机器很频繁,废弃的,每天都在手动同样的事情,写了个脚本自动维护,已经加入到MySQL初始化安装、机器下线、高可用等流程中,自动处理:脚本如下:#!/usr/bin/python
#coding:utf-8
importjson
importurllib2
fromurllib2importURLError
import..
分类:
其他好文 时间:
2014-10-31 19:19:09
阅读次数:
255
windows下监控文件系统的变化,用python很方便。实例代码如下,很简单,也不多说了。
import os
import win32file
import win32con
ACTIONS = {
1 : "Created",
2 : "Deleted",
3 : "Updated",
4 : "Renamed from something",
5 : "...
分类:
编程语言 时间:
2014-10-11 11:56:35
阅读次数:
447
原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明。否则将追究法律责任。http://world77.blog.51cto.com/414605/782935 最近比较烦,研发给的pc服务版本在虚拟机上已经开始给客户使用了,服务老是莫名的死翘翘,客户不停的电话给我,搞的....
分类:
编程语言 时间:
2014-08-06 22:21:22
阅读次数:
286
python监控linux性能以及进程消耗的性能...
分类:
编程语言 时间:
2014-06-10 18:44:54
阅读次数:
371
#!/usr/bin/envpythonimportsys,timefromsocketimportsocketdefread_interface(in_file):withfile(in_file)asf:returnf.readlines()[2:]defset_interface(inter_msg):dic={}foriinxrange(len(inter_msg)):dic[inter_msg[i].split(":")[0].strip()]={"in":inter_msg[i].split(":..
分类:
编程语言 时间:
2014-05-13 04:01:55
阅读次数:
432