saltstack安装zabbix_client

所需积分/C币:10 2016-08-13 12:40:44 493KB PDF
4
收藏 收藏
举报

本文主要介绍saltstack安装zabbix_client
口 果学 Zabbix自动化入门到实战 ronco. com 作者:罗辉 口蛋 2、创建存放目录 # mkdir/srv/salt/ mkdir / srv/salt/pillar 3、定义入口文件:查看结构 pillar top. sIs zabbix #t tree pillar file. sls top sIs abl files IHzabbix-3.0.3. tar. gz zabbix agentd zabbix agentd. conf file, sl nit sls Installsls server. s 4、入口文件top.sls # cat top.sls(定义所有的主机只是sls的时候去 zabbix目录查找相关操作) base 5、 zabbix目录下的结构和引导文件init.sls cd zabbix/ files file sls init sls install sls server sls # cat init.sls(定义执行是加载这几个文件) nclud zabbix install abbi file zabbix, server 6、安装包文件 zabbix. instal1: 账一 cat install sls #zabbix tar gz zabbix source 龙果学院http://www.roncoo.com 果学 Zabbix自动化入门到实战 口城回 ronco. com 作者:罗辉 file. managed name:/tmp/zabbix-3.0.3. tar. gz unless:test-e/tmp/ zabbix-3.0.3.tar.gz#(检测目录卜是否有这个文件) Source:salt:// zabbix/ files/ zabbix-3.0.3.tar.gz#(没有的话从 files日录下推送一个) #extract extract abb cmd. run d:/tmp #(切换到cmd目录) name s tar zxvf zabbix-3.0.3.tar.gz#(解压 zabbix包) inless: test -d/tmp abb ix-3 0.3 require #(表小先执行上面的 zabbix source操作才到下面) file: zabbix source #user (创建一个uid为1501的用户) zabbix user user. present name: zabbix createhome: False gid from name: True shell: /sbin/nologin #zabbix pkgs (用yum方式安装依赖包) zabhix pkg pkg. installed gCc openssl-devcl pcre-deve l zlib-devel cuE #zabbix compile zabbix compile cmd. rur 0.3 /configure --with-net-snmp --with-libcurl --enable-agent --prefix=/usr/local/ zabbix make install require (完成解压和依赖包之后才执行这步操作) cmd: extract zabbix pkg: zabbix pkg 龙果学院http://www.roncoo.com 果学 Zabbix自动化入门到实战 口城回 ronco. com 作者:罗辉 unless: test -d /usr/local/ zabbix 7、配置文件推送操作: #cat file sls #(为了配置方便我这里吧一个 zabbix agentd.conf事先定义好直接推送) Include zabbix, instal config file. managed name:/usr/ local/ zabbix/etc/ zabbix agentd.conf#(查看是否有这个文件) user: root mode: 644 source:salt:// zabbix/ files/ zabbix agentd.conf#(没有从 files目录下推送一个) template: jinja #(基于 JInJa模板,这样可以在主服务器定义一些变 量) 8、服务配置文件也是从主服务端推送: #t cat server, sIs include zabbix, install server file. managed name:/ctc/init. d/zabbix agentd user zabbix mode: 755 source: salt: //zabbix/files/ zabbix agentd servICe running #(检测并启动) name: zabbix agentd enable: True reload True watch file: /etc/init. d, zabbix agentd 9、查看 pillar下面的内容,主要存放的是 JInJa模板调用的变量 1t/pillar/ file. sIs top sls cat top. sls 账一 file 龙果学院http://www.roncoo.com 果学 Zabbix自动化入门到实战 口城回 ronco. com 作者:罗辉 #t cat file sls server:192.168.63.205##(定义 zabbix- server的IP地址) 10、查看 files目录下面被推送的几个文件 # cd /srv/salt/zabbix/files/ ts abbix-3.0. 3. tar. gz zabbix agentd zabbix agentd. conf 11、 zabbix agentd启动文件 cat zabbix agentd #!/bin/bash # etc/rc.d init. d/zabbix agentd Starts the zabbix agentd daemon chkconfig:-9 description Zabbix Monitoring agent processname: zabbix agentd pidfile: /tmp/zabbix agentd pid t Modified for abbix 2.0.0 #t may 2012, Zabbix sia Source function library. /etc/init. d/f'unctions RETVAL=O prog="Zabbix Agent ZABBIX BIN=/ usr/local/ zabbix/sbin/zabbix agentd ${ ZABBIX BIN:」 echo -n"$ ZABBIX BIN not installed Tell th r this has sk exit 5 start Starti 6 龙果学院http://www.roncoo.com 口 果学 Zabbix自动化入门到实战 ronco. com 作者:罗辉 口蛋 daemon ZABBIX BIN RETVAL=$? L SRETVAL -eq 0] & touch /var/lock/ subsys/ zabbix agentd echo echo -n s Stopping prog killproc SZABBIX BIN RETVAL=S? L SRETVAL -eqo] && rm-f/var/lock/subsys/ zabbix agentd eche case tar t to reload restart) start RETVAL=S? condrestart) if -f /var/ lock/ subsys/ zabbix agentd ] then start status ZABBIX BIN RETVAL=S? echo s"Usage: $0 fcondrestart start stoplrestart reload status exit 1 esac exit SRETVAL 龙果学院http://www.roncoo.com 口 果学 Zabbix自动化入门到实战 ronco. com 作者:罗辉 口蛋 12、 zabbix agentd.conf'配置文件(为∫方便配置 zabbis serverIp地圠这里从 server端推送): [root@xiaoluo files]# cat zabbix agentd. conf This is a configuration file for Zabbix agent daemon (Unix) #togetmoreinformationaboutZabbix,visithttp://www.zabbix.com ###枓#抖艹## GENERAL PARAMETERS##艹#枓#扦#世扌址###枓 ## Option: PidFile Name of pid file Default Pidfile=/tmp/zabbix agentd pid ## Option: LogType Specifies where log messages are written to system fil file specified with LogFile parameter console - standard output t Default ## Option LogFile Log file name for Log Type file parameter #t Defaul LogFile= LogFile=/ tmp/zabbix agentd. log ## Option: LogFilesize Maximum size of log file in MB. 0- disable automatic log rotation #t Mandatory: no 0-1024 #t Default LogFilesize=l 龙果学院http://www.roncoo.com 口 果学 Zabbix自动化入门到实战 ronco. com 作者:罗辉 口蛋 ###t Option: Debug Specifies debug level 0- basic information about start ing and stopping of Zabbix processes I critical information 2 3-warnings # 4-tor debugging (produces lots of information 5- extended debugging (produces even more information) Mandat ory: no #f Range: 0-5 #t Default DebugLeve l-3 ###f Option: SourceIP Source ip address for out going connections. Mandatory: no #t Default #t Source lp ## Option EnableRemo te Commands Whether remote commands from Zabbix server are allowed #### 0- not allowed Mandatory: no DE #t Enablcremot cCommands-o ## Option LogRemoteCommands Enable logging of executed shell commands as warning: ##井# 0- disabled 1- enabled Mandatory: no #t Default LogRemote Commands=0 ##### passive checks related 账一 ## Option Server List of comma delimited IP addresses or hostnames) of Zabbix servers 龙果学院http://www.roncoo.com 口 果学 Zabbix自动化入门到实战 ronco. com 作者:罗辉 口蛋 Incoming connections will be accepted only from the hosts listed here. If IPy6 support is enabled then'127.0.0.1’,’:127.0.0.1,’:ff:127.0.0.1’are treated equally #f Mandatory: no #t Default Server=fi pillar[' server']3 Option: ListenPort Agent will listen on this port for connections from the server. Mandatory: no # Range:1024-32767 #t Default t listen port=10050 ## Option: ListenIP List of comma dc limited Ip addresses that the agent should listen on First ip address is sent to Zabbix server if connecting to it to retrieve list of active checks Mandatory: no #t Defaul # Listen|P=0.0.0).0 ### Option: startAgent Number of pre-forked instances of zabbix agentd that process passive checks If sct to o, disables passive checks and the agent will not listen on any tcp port. # #t mandator Range: 0-100 #t Default t Startagents=3 #### Active checks related ## Option: ServerActive List of comma delimited IP: port (or hostname: port) pairs of Zabbix servers for active checks 账一 If port is not specified, default port is used # IPv6 addresses must be enclosed in square brackets if port for that host is spccificd. If port is not specified, square brackets for IPv6 addresses are optiona 10 龙果学院http://www.roncoo.com

...展开详情
试读 18P saltstack安装zabbix_client
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
saltstack安装zabbix_client 10积分/C币 立即下载
1/18
saltstack安装zabbix_client第1页
saltstack安装zabbix_client第2页
saltstack安装zabbix_client第3页
saltstack安装zabbix_client第4页

试读结束, 可继续读2页

10积分/C币 立即下载 >