Installazione di un agent Zabbix

From RVM Wiki
Revision as of 13:54, 22 January 2021 by Gabriele.vivinetto (talk | contribs)
Jump to navigation Jump to search

Installazione pacchetto

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, instalallarlo
  • 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_agentd.conf
sed -i -e "s/^ServerActive=127.0.0.1/ServerActive=${SRV}/" /etc/zabbix/zabbix_agentd.conf
sed -i -e "s/^Hostname=Zabbix server/Hostname=${HST}/" /etc/zabbix/zabbix_agentd.conf
  • Verificare
sudoedit /etc/zabbix/zabbix_agentd.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-agent.service
sudo systemctl restart zabbix-agent.service
sudo systemctl status zabbix-agent.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.