1、搭建本地dns
安装bind软件
[root@mail ~]# rpm -q bind
[root@mail ~]# mount /dev/hdc /mnt/
[root@mail ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo
修改:
baseurl=file:///mnt/Server
enabled=1
[root@localhost ~]# yum -y install bind* caching-nameserver
3、配置named.conf文件
[root@mail ~]# vim /var/named/chroot/etc/named.conf
options {
directory "/var/named&qu...
mysql双主配置
一、先修改配置文件
服务器A(192.168.1.254)配置如下
log-bin = mysql-bin
server-id = 1
expire-logs-days = 100
replicate-do-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
auto-increment-increment = 2
auto-increment-offset = 1
服务器B(192.168.1.252)配置
log-bin = mysql-bin
server-id = 2
expire-logs-days = 100
replicate-do-db = test
binlog-i...
linux多线程执行命令(扫描存活主机)
#!/usr/bin/env python
from threading import Thread
import subprocess
from Queue import Queue
import time
num_threads=10
iprange='192.168.230.'
ips=[]
iplist=range(250)
for i in iplist:
ips.append(iprange+str(i))
#print ips
#time.sleep(5)
#ips=['127.0.0.1','116.56.148.187','192.168.230.1','192.168.230.2','192.168.230.4']
q=Queue()
def pingme(i,qu...
python邮件告警脚本
[root@localhost alertscripts]# pwd
/usr/local/zabbix/share/zabbix/alertscripts
[root@localhost alertscripts]# ls
sendmail.py sendmail.sh.bak
[root@localhost alertscripts]#sendmail.py
[root@localhost alertscripts]# ./sendmail.py ‘收件人’ ‘主题’ ‘内容’
-------------------------------------------------------------------------------------------
#!/usr/bin/env python
#co...
一屏python代码实现文件传送
-------------------------------------------------------------------
服务端: 接收文件 #./file-server.py
#!/usr/bin/python
import SocketServer
# Format: name_len --- one byte
# name --- name_len bytes
# data --- variable length
# Save data to name into current directory
addr = ('192.168.230.128', 1234)
class MyTCPHandler (...