Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Ant_Devops
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mayi-operation
Ant_Devops
Commits
6304b427
Commit
6304b427
authored
Oct 19, 2018
by
杜崇铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add zabbix mod
parent
1f160c56
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
18 deletions
+12
-18
README.md
+2
-1
host.yml.examples
+5
-3
roles/zabbix_server/files/zabbix_db.sh
+4
-4
roles/zabbix_server/tasks/main.yml
+0
-10
zabbix.retry
+1
-0
No files found.
README.md
View file @
6304b427
...
@@ -26,5 +26,5 @@ Zabbix
...
@@ -26,5 +26,5 @@ Zabbix
使用:
使用:
1-5同上
1-5同上
6.
修改
roles/zabbix_server/templates/zabbix_server.conf和roles/zabbix_agent/templates/zabbix_agentd.conf中的变量
6.
修改
变量 roles/zabbix_server/templates/zabbix_server.conf(DB开头的三个变量),roles/zabbix_agent/templates/zabbix_agentd.conf(Server变量),roles/zabbix_server/files/zabbix_db.sh(mysql的变量),var/main.yml(mysql args变量)
7.
运行ansible-playbook -i host.yml -u root zabbix.yml
7.
运行ansible-playbook -i host.yml -u root zabbix.yml
\ No newline at end of file
host.yml.examples
View file @
6304b427
[local]
[local]
localhost
[zabbix_server]
[zabbix_server]
118.25.142.187
118.25.142.187
[zabbix_agent]
[zabbix_agent]
106.15.184.18
106.15.184.18
\ No newline at end of file
106.15.184.19
106.15.184.20
\ No newline at end of file
roles/zabbix_server/files/zabbix_db.sh
View file @
6304b427
#!/bin/bash
#!/bin/bash
mysql
-u
root
-p
1q2w3e4r zabbix
-e
"grant all privileges on zabbix.* to zabbix@localhost identified by '1q2w3e4r';"
mysql
-u
root
-p1q2w3e4r
-e
"create database zabbix character set utf8 collate utf8_bin;"
cd
/usr/share/doc/zabbix-server-mysql-3.4.0
mysql
-u
root
-p1q2w3e4r
-D
zabbix
-e
"grant all privileges on zabbix.* to zabbix@localhost identified by '1q2w3e4r';"
zcat create.sql.gz | mysql
-uroot
-p1q2w3e4r
zabbix
zcat /usr/share/doc/zabbix-server-mysql
*
/create.sql.gz | mysql
-uzabbix
-p1q2w3e4r
zabbix
\ No newline at end of file
\ No newline at end of file
roles/zabbix_server/tasks/main.yml
View file @
6304b427
...
@@ -9,16 +9,6 @@
...
@@ -9,16 +9,6 @@
name
:
"
{{
zabbix_server_packages
}}"
name
:
"
{{
zabbix_server_packages
}}"
state
:
latest
state
:
latest
-
name
:
"
mysql
operation"
mysql_db
:
name
:
zabbix
login_host
:
127.0.0.1
login_port
:
"
{{
mysql_port
}}"
login_user
:
root
login_password
:
"
{{
login_password
}}"
encoding
:
utf8
state
:
present
-
name
:
"
copy
mysql
shell
script"
-
name
:
"
copy
mysql
shell
script"
copy
:
copy
:
src
:
zabbix_db.sh
src
:
zabbix_db.sh
...
...
zabbix.retry
0 → 100644
View file @
6304b427
118.25.142.187
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment