监控mysql主从,结合计划任务发邮件告警。#!/bin/bash#checkmysqlslavestatusmysql_path=/wqdata/mysql/bin/mysqluser="root"password="tze@2011"email=110@1.comdate=`(date+%y-%m-%d--%H:%M:%S)`ip=$(/sbin/ifconfig|grep"inetaddr"|grep-v"127.0.0.1"|awk‘{print$2;}‘|awk-F..
分类:
其他好文 时间:
2015-09-25 16:33:53
阅读次数:
186
多态:在编辑时无法确定状态,在运行时才确定。由于Python为动态语言,参数类型没定,所以本身即是多态的1:由继承实现多态 1 class Animal: 2 def move(self): 3 print('Animal is moving') 4 5 class Dog...
分类:
编程语言 时间:
2015-09-25 11:21:01
阅读次数:
155
1:元类 元类:类的创建与管理者 所有类的元类是type class a: pass print(type(a)) 结果:2:定制元类 类的实例化过程:(可看类的基础与要点) 1)调用__new__()创建实例 2)调用__init__()初...
分类:
编程语言 时间:
2015-09-25 10:55:04
阅读次数:
131
1、编写监控主从SHELL脚本check_mysql_replication.sh,放在/etc/zabbix/下面#!/bin/bash/usr/bin/mysql-uzabbix-p密码-e‘showslavestatus\G‘|grep-E"Slave_IO_Running|Slave_SQL_Running"|awk‘{print$2}‘|grep-cYes2、在从库上授权zabbix用户:grantreplicationclienton*.*to‘z..
分类:
数据库 时间:
2015-09-25 04:07:29
阅读次数:
364
解决方法是在response.getWriter()前加上response..setContentType("text/html; charset=UTF-8"); 下面是示例代码,注意代码中的红色字体: protected void doGet(HttpServletRequest req, HttpServletResponse r...
分类:
其他好文 时间:
2015-09-24 22:56:18
阅读次数:
359
--------------------PHP部分---------------------PHP中几个输出函数echo,print(),print_r(),sprintf(),var_dump()的区别1:echo:是语句不是函数,没有返回值,可输出多个变量值,不需要圆括号。不能输出数组和对象,只...
分类:
Web程序 时间:
2015-09-24 22:52:34
阅读次数:
357
#!/bin/shmm_pid=`ps -ef | grep apache-mm-admin/ | grep -v grep | awk '{print $2}'`echo "理财管理后台当前的PID为$mm_pid"cd /usr/local/dd/200.pf/apache-mm-admin/w...
分类:
系统相关 时间:
2015-09-24 20:54:36
阅读次数:
233
pv一般都是统计指定页面的点击量,这里用首页来计算grep"/index.php"/var/log/nginx/access.log|wc-luv是统计指定页面上真是访问的用户,也就是说同一ip不管点击多少次都算一个uvgrep"/index.php"/var/log/nginx/access.log|awk‘{print$1}‘|sort|uniq|wc–l独立ip是统计不管用?.
分类:
其他好文 时间:
2015-09-24 19:47:36
阅读次数:
378
1. use try, except, finallytry: data=open('its.txt','w') print('its..', file=data)except: print('file error:', +str(err))finally: if 'data...
分类:
编程语言 时间:
2015-09-24 16:40:35
阅读次数:
222
1. Print them to screenman = []other = []try: data = open('sketch.txt') for each_line in data: try: (role, line_spoken) = each...
分类:
编程语言 时间:
2015-09-24 16:17:37
阅读次数:
433