摘要: tcpdump通过调用网卡驱动进行网络抓包,在网络诊断,数据包分析的时候,特别有用。例子如下: 阅读全文
posted @ 2019-08-12 18:53 二勇的技术博客 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 模块其实就是计算机中的一个py文件,可以把一个模块导入到当前py程序中,以增强其功能。导入模块使用import命令。 例如i mport math math.sqrt(9) In [7]: mathmath In [7]: math.sqrt(9)Out[7]: 3.0 使用import math。 阅读全文
posted @ 2019-08-11 22:06 二勇的技术博客 阅读(923) 评论(0) 推荐(0) 编辑
摘要: 今天又一个要求,想通过sudo的普通用户执行ansible的命令,而不是通过root用户去执行系统管理的命令。步骤如下 一、先修改ansible.cfg文件,启用sudo,指定sudo的用户为lisi forks = 5#poll_interval = 15sudo_user = lisi#ask_ 阅读全文
posted @ 2019-08-05 10:53 二勇的技术博客 阅读(11401) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-07-24 09:07 二勇的技术博客 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 图片说明: Manager实际为一个监控,不断的对master、slave1、slave2、slave3进行监控 Manger如果发现其中一个slave有异常,则会将其中一个延迟较小的从库提升为主库,而且使得数据一致 阅读全文
posted @ 2019-06-24 07:57 二勇的技术博客 阅读(553) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash read -n 1 -p "是否已将httpd-2.2.17源码包放到root目录下,确认按Y" p # -n 1指定只能读入一个字符 test "$p" = "y" -o "$p" = "Y" if [ $? -eq 0 ] then rpm -qa | grep httpd rpm -e httpd --nod... 阅读全文
posted @ 2017-06-21 15:01 二勇的技术博客 阅读(638) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash #install the zabbix agent #Create by ShiYong id zabbix &> /dev/null || useradd -s /sbin/nologin zabbix mkdir /etc/zabbix /var/log/zabbix chown zabbix.zabbix /var/log/zabbix/ tar zxf zabbix... 阅读全文
posted @ 2017-05-12 17:07 二勇的技术博客 阅读(1929) 评论(0) 推荐(0) 编辑
摘要: 1、系统架构 2、安装软件 yum list | grep target yum -y install scsi-target-utils.x86_64 3、修改配置文件 先准备一个硬盘进行分区 /dev/sdb1(这里省略) vi /etc/tgt/targets.conf 16 default-driver iscsi 38 39 ... 阅读全文
posted @ 2017-05-03 11:33 二勇的技术博客 阅读(6884) 评论(0) 推荐(1) 编辑
摘要: 防火墙iptables对于系统安装特别重要,我们知道,iptables默认有4个表5个链,表我们一般使用filter、nat表,但是raw(原始表)不怎使用 举例: iptables -t raw -A PREROUTING -s 192.168.10.117 -j NOTRACK #在raw表的PREROUTING链中添加一个规则,对来自于地址 192.168.10.117的任何包不进... 阅读全文
posted @ 2017-05-02 17:39 二勇的技术博客 阅读(1943) 评论(0) 推荐(0) 编辑
摘要: cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls c... 阅读全文
posted @ 2017-05-02 16:10 二勇的技术博客 阅读(31934) 评论(0) 推荐(1) 编辑