Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zabbix
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
infra
zabbix
Commits
3d11af21
Commit
3d11af21
authored
Jul 24, 2024
by
Joab Bremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script RC
parent
b835b5db
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
19 deletions
+27
-19
README.md
zabbix_v2/Rock Linux 8/agent2/README.md
+14
-3
zabbix_install.sh
zabbix_v2/Rock Linux 8/agent2/zabbix_install.sh
+13
-16
No files found.
zabbix_v2/Rock Linux 8/agent2/README.md
View file @
3d11af21
dnf install
*
.rpm
dnf install
\
*
.rpm
/etc/zabbix/zabbix_agent2.conf
Server=IP_SERVIDOR_DO_PROXY_DO_CAMPO
...
...
@@ -8,7 +8,18 @@ Hostname=NOME_DO_PROXY_DO_CAMPO
commentar
#ServerActive=127.0.0.1
-A INPUT -p tcp -m state -m tcp --dport 10050:10053 --state NEW -j ACCEPT
-A INPUT -s 10.11.0.0/22 -p tcp -m state --state NEW -m tcp --dport 10050:10053 -j ACCEPT
systemctl enable --now zabbix-agent2
### Instalação com script
```
curl -fsSL https://git.usb.org.br/infra/zabbix/raw/master/zabbix_v2/Centos%206/agent2/zabbix_install.sh | bash -s -- <IP_PROXY> <SERVER_NAME>
```
### Adicionar regra de iptables
```
-A INPUT -s 10.11.0.0/22 -p tcp -m state --state NEW -m tcp --dport 10050:10053 -j ACCEPT
```
zabbix_v2/Rock Linux 8/agent2/zabbix_install.sh
View file @
3d11af21
#!/bin/bash
if
[
"$#"
-ne
2
]
;
then
echo
"Uso:
$0
<
Novo_IP> <Novo_Hostname
>"
echo
"Uso:
$0
<
PROXY_IP> <HOSTNAME
>"
exit
1
fi
NOVO
_IP
=
$1
NOVO_
HOSTNAME
=
$2
PROXY
_IP
=
$1
HOSTNAME
=
$2
CONFIG_FILE
=
"/etc/zabbix/zabbix_agent2.conf"
mkdir
/zabbix_files
cd
/zabbix_files
echo
"Baixando Arquivos..."
wget https://git.usb.org.br/infra/zabbix/raw/master/zabbix_v2/
Centos%206/zabbix-agent2-7.0.0-release1.el6
.x86_64.rpm
-P
/zabbix_files
wget https://git.usb.org.br/infra/zabbix/raw/master/zabbix_v2/
Rock%20Linux%208/agent2/7.0.1/zabbix-agent2-7.0.1-release1.el8
.x86_64.rpm
-P
/zabbix_files
wget https://git.usb.org.br/infra/zabbix/raw/master/zabbix_v2/Rock%20Linux%208/agent2/7.0.1/zabbix-get-7.0.1-release1.el8.x86_64.rpm
-P
/zabbix_files
wget https://git.usb.org.br/infra/zabbix/raw/master/zabbix_v2/Rock%20Linux%208/agent2/7.0.1/zabbix-sender-7.0.1-release1.el8.x86_64.rpm
-P
/zabbix_files
echo
"instalando zabbix-agent2..."
yum
-y
install
/zabbix_files/
*
.rpm
dnf
-y
install
/zabbix_files/
*
.rpm
echo
"Configurando..."
sed
-i
"s/^Server=.*/Server=
$
NOVO
_IP
/"
"
$CONFIG_FILE
"
sed
-i
"s/^Hostname=.*/Hostname=
$
NOVO_
HOSTNAME
/"
"
$CONFIG_FILE
"
sed
-i
"s/^Server=.*/Server=
$
PROXY
_IP
/"
"
$CONFIG_FILE
"
sed
-i
"s/^Hostname=.*/Hostname=
$HOSTNAME
/"
"
$CONFIG_FILE
"
sed
-i
"s/^ServerActive=.*/#&/"
"
$CONFIG_FILE
"
echo
"Configurações atualizadas com sucesso no arquivo
$CONFIG_FILE
:"
echo
"Server=
$NOVO_IP
"
echo
"Hostname=
$NOVO_HOSTNAME
"
mkdir
-p
/run/zabbix/
chown
zabbix. /run/zabbix
echo
"Server=
$PROXY_IP
"
echo
"Hostname=
$HOSTNAME
"
s
ervice zabbix-agent2 start
chkconfig zabbix-agent2 on
s
ystemctl start zabbix-agent2
systemctl
enable
zabbix-agent2
echo
"Instalação Concluida"
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