Installazione di un agent Zabbix: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m →Windows |
||
| (15 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
=Installazione pacchetto= | =Installazione pacchetto= | ||
==Ubuntu== | ==Ubuntu== | ||
===Agent2=== | |||
export ZBV=6.4; wget https://repo.zabbix.com/zabbix/${ZBV}/ubuntu/pool/main/z/zabbix-release/zabbix-release_${ZBV}-4%2Bubuntu20.04_all.deb | |||
dpkg -i zabbix-release_${ZBV}-4+ubuntu20.04_all.deb | |||
apt update | |||
* Vedi Debian | |||
===Agent=== | |||
wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-4%2Bubuntu20.04_all.deb | wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-4%2Bubuntu20.04_all.deb | ||
dpkg -i zabbix-release_6.2-4+ubuntu20.04_all.deb | dpkg -i zabbix-release_6.2-4+ubuntu20.04_all.deb | ||
apt update | apt update | ||
==Debian >= | ==Agent2== | ||
=== | ===Debian >=9 Stretch === | ||
* Per versioni precedenti non esiste agent | |||
* Il nuovo agente supporta molti più plugin builtin. | |||
* Il nuovo agente sostituisce il vecchio | |||
* Usare i template agent2 (agent, mysql, etc ...) | |||
* Installare i pacchetti RVM zabbix-agent2-* | |||
* Installare il pacchetto | |||
<pre>export ZBV=7.0; \ | |||
export ZBSV=2; \ | |||
if (lsb_release -c -s>/dev/null 2>&1); \ | |||
then echo "Good: lsb_release is installed."; \ | |||
cd /tmp && \ | |||
wget https://repo.zabbix.com/zabbix/${ZBV}/$(lsb_release -s -i| tr '[:upper:]' '[:lower:]')/pool/main/z/zabbix-release/zabbix-release_${ZBV}-${ZBSV}+$(lsb_release -s -i| tr '[:upper:]' '[:lower:]')$(lsb_release -r -s)_all.deb && \ | |||
dpkg -i zabbix-release_${ZBV}-${ZBSV}+$(lsb_release -s -i| tr '[:upper:]' '[:lower:]')$(lsb_release -r -s)_all.deb && \ | |||
sudo apt update && \ | |||
sudo apt-get install zabbix-agent2 zabbix-agent2-plugin-*; | |||
else echo -e "BAD: lsb_release is not installed. Please install it:\n sudo apt-get install lsb-release"; \ | |||
sudo apt install lsb-release; | |||
echo "NOW RELAUNCH." | |||
fi</pre> | |||
apt install zabbix-agent2 zabbix-agent2-plugin-* | |||
* Fermare e disabilitare il vecchio agent | |||
systemctl stop zabbix-agent; systemctl disable zabbix-agent | |||
* Configurare: | |||
vimdiff /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agent2.conf | |||
* Copiare gli userparameters: | |||
cd /etc/zabbix/ | |||
cp zabbix_agentd.d/* zabbix_agent2.d/ | |||
* Disabilitare gli userparameters builtin: | |||
cd zabbix_agent2.d | |||
mv userparameter_mysql.conf userparameter_mysql.conf.disabled | |||
* Riavviare l'agent: | |||
systemctl restart zabbix-agent2 | |||
systemctl status zabbix-agent2 | |||
* Disabilitare il vecchio agent: | |||
systemctl disable zabbix-agent | |||
==Agent 4.0== | |||
===Debian >= 11 Bullseye === | |||
cd /tmp | cd /tmp | ||
| Line 21: | Line 76: | ||
* [[#Configurazione|Configurare]] | * [[#Configurazione|Configurare]] | ||
= | ===Debian > Wheezy=== | ||
==Debian > Wheezy== | |||
<pre> | <pre> | ||
| Line 87: | Line 131: | ||
export HST=myserver.example.priv | export HST=myserver.example.priv | ||
sed -i -e "s/^Server=127.0.0.1/Server=${SRV}/" /etc/zabbix/ | sed -i -e "s/^Server=127.0.0.1/Server=${SRV}/" /etc/zabbix/zabbix_agent{d,2}.conf | ||
sed -i -e "s/^ServerActive=127.0.0.1/ServerActive=${SRV}/" /etc/zabbix/ | sed -i -e "s/^ServerActive=127.0.0.1/ServerActive=${SRV}/" /etc/zabbix/zabbix_agent{d,2}.conf | ||
sed -i -e "s/^Hostname=Zabbix server/Hostname=${HST}/" /etc/zabbix/ | sed -i -e "s/^Hostname=Zabbix server/Hostname=${HST}/" /etc/zabbix/zabbix_agent{d,2}.conf | ||
sed -i -e "s/^# Timeout=3/Timeout=30/" /etc/zabbix/zabbix_agent{d,2}.conf | |||
* Verificare | * Verificare | ||
sudoedit /etc/zabbix/ | sudoedit /etc/zabbix/zabbix_agent{d,2}.conf | ||
Server=192.168.6.254 # Internal IP of Zabbix Server/Proxy | Server=192.168.6.254 # Internal IP of Zabbix Server/Proxy | ||
| Line 101: | Line 146: | ||
* Abilitare il servizio: | * Abilitare il servizio: | ||
sudo systemctl enable zabbix- | sudo systemctl enable zabbix-agent2.service | ||
sudo systemctl restart zabbix- | sudo systemctl restart zabbix-agent2.service | ||
sudo systemctl status zabbix- | sudo systemctl status zabbix-agent2.service | ||
* Per Wheezy | * Per Wheezy | ||
| Line 112: | Line 157: | ||
* Attendere circa 5 minuti, che il server invii i dettagli di configurazione al proxy. | * Attendere circa 5 minuti, che il server invii i dettagli di configurazione al proxy. | ||
== Windows == | |||
L'agente ed i plugins si possono scaricare qui: | |||
https://cdn.zabbix.com/zabbix/binaries/stable/7.0/ | |||
Latest revision as of 14:25, 26 September 2025
Installazione pacchetto
Ubuntu
Agent2
export ZBV=6.4; wget https://repo.zabbix.com/zabbix/${ZBV}/ubuntu/pool/main/z/zabbix-release/zabbix-release_${ZBV}-4%2Bubuntu20.04_all.deb
dpkg -i zabbix-release_${ZBV}-4+ubuntu20.04_all.deb
apt update
- Vedi Debian
Agent
wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-4%2Bubuntu20.04_all.deb dpkg -i zabbix-release_6.2-4+ubuntu20.04_all.deb apt update
Agent2
Debian >=9 Stretch
- Per versioni precedenti non esiste agent
- Il nuovo agente supporta molti più plugin builtin.
- Il nuovo agente sostituisce il vecchio
- Usare i template agent2 (agent, mysql, etc ...)
- Installare i pacchetti RVM zabbix-agent2-*
- Installare il pacchetto
export ZBV=7.0; \
export ZBSV=2; \
if (lsb_release -c -s>/dev/null 2>&1); \
then echo "Good: lsb_release is installed."; \
cd /tmp && \
wget https://repo.zabbix.com/zabbix/${ZBV}/$(lsb_release -s -i| tr '[:upper:]' '[:lower:]')/pool/main/z/zabbix-release/zabbix-release_${ZBV}-${ZBSV}+$(lsb_release -s -i| tr '[:upper:]' '[:lower:]')$(lsb_release -r -s)_all.deb && \
dpkg -i zabbix-release_${ZBV}-${ZBSV}+$(lsb_release -s -i| tr '[:upper:]' '[:lower:]')$(lsb_release -r -s)_all.deb && \
sudo apt update && \
sudo apt-get install zabbix-agent2 zabbix-agent2-plugin-*;
else echo -e "BAD: lsb_release is not installed. Please install it:\n sudo apt-get install lsb-release"; \
sudo apt install lsb-release;
echo "NOW RELAUNCH."
fi
apt install zabbix-agent2 zabbix-agent2-plugin-*
- Fermare e disabilitare il vecchio agent
systemctl stop zabbix-agent; systemctl disable zabbix-agent
- Configurare:
vimdiff /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agent2.conf
- Copiare gli userparameters:
cd /etc/zabbix/ cp zabbix_agentd.d/* zabbix_agent2.d/
- Disabilitare gli userparameters builtin:
cd zabbix_agent2.d mv userparameter_mysql.conf userparameter_mysql.conf.disabled
- Riavviare l'agent:
systemctl restart zabbix-agent2 systemctl status zabbix-agent2
- Disabilitare il vecchio agent:
systemctl disable zabbix-agent
Agent 4.0
Debian >= 11 Bullseye
cd /tmp
wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-4%2Bdebian11_all.deb
dpkg -i zabbix-release_4.0-4+debian11_all.deb && \ sudo apt-get update && \ sudo apt-get dist-upgrade && \ sudo apt-get install zabbix-agent
Debian > Wheezy
if (lsb_release -c -s>/dev/null 2>&1); \ then echo "Good: lsb_release is installed."; \ cd /tmp && \ wget https://repo.zabbix.com/zabbix/4.0/$(lsb_release -s -i| tr '[:upper:]' '[:lower:]')/pool/main/z/zabbix-release/zabbix-release_4.0-3+$(lsb_release -c| cut -f 2)_all.deb && \ dpkg -i zabbix-release_4.0-3+$(lsb_release -c| cut -f 2)_all.deb && \ sudo apt-get update && \ sudo apt-get install zabbix-agent; else echo -e "BAD: lsb_release is not installed. Please install it:\n sudo apt-get install lsb-release"; \ sudo apt-get install lsb-release; echo "NOW RELAUNCH." fi
Debian Wheezy
- Per Wheezy l'ultima release disponibile è la 3.4:
cd /tmp && \ wget https://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+wheezy_all.deb
- Se non va con wget, usare curl
cd /tmp && curl -O -J https://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+wheezy_all.deb
- Se si usa un proxy:
--proxy http://user:password@1.2.3.4:3128
- Se curl non è installato, installarlo
- Se non si installa
wget http://archive.debian.org/debian/pool/main/c/curl/curl_7.26.0-1+wheezy13_i386.deb wget http://archive.debian.org/debian/pool/main/c/curl/libcurl3_7.26.0-1+wheezy13_i386.deb dpkg -i libcurl3_7.26.0-1+wheezy13_i386.deb apt-get install curl
- Installare zabbix
dpkg -i zabbix-release_3.4-1+wheezy_all.deb && \ sudo apt-get update && \ sudo apt-get install zabbix-agent
Configurazione
- Configurare i parametri:
export SRV=192.168.10.254 export HST=myserver.example.priv
sed -i -e "s/^Server=127.0.0.1/Server=${SRV}/" /etc/zabbix/zabbix_agent{d,2}.conf
sed -i -e "s/^ServerActive=127.0.0.1/ServerActive=${SRV}/" /etc/zabbix/zabbix_agent{d,2}.conf
sed -i -e "s/^Hostname=Zabbix server/Hostname=${HST}/" /etc/zabbix/zabbix_agent{d,2}.conf
sed -i -e "s/^# Timeout=3/Timeout=30/" /etc/zabbix/zabbix_agent{d,2}.conf
- Verificare
sudoedit /etc/zabbix/zabbix_agent{d,2}.conf
Server=192.168.6.254 # Internal IP of Zabbix Server/Proxy ServerActive=192.168.6.254 # Internal IP of Zabbix Server/Proxy Hostname=internal-host.example.priv # Name of internal host as defined on zabbix server
- Abilitare il servizio:
sudo systemctl enable zabbix-agent2.service sudo systemctl restart zabbix-agent2.service sudo systemctl status zabbix-agent2.service
- Per Wheezy
/etc/init.d/zabbix-agent restart /etc/init.d/zabbix-agent status
- Definire l'host sul server Zabbix, assegnandolo al proxy precedentemente creato
- Attendere circa 5 minuti, che il server invii i dettagli di configurazione al proxy.
Windows
L'agente ed i plugins si possono scaricare qui: