Установка zabbix-agent debian7

Step 1 – Add Apt Repository
For Ubuntu 16.04 LTS:
$ wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+xenial_all.deb
$ sudo dpkg -i zabbix-release_3.0-1+xenial_all.deb
$ sudo apt update
For Ubuntu 14.04 LTS:
$ wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb
$ sudo dpkg -i zabbix-release_3.0-1+trusty_all.deb
$ sudo apt-get update
For Ubuntu 12.04 LTS:
$ wget http://repo.zabbix.com/zabbix/2.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.2-1+precise_all.deb
$ sudo dpkg -i zabbix-release_2.2-1+precise_all.deb
$ sudo apt-get update
For Debian 8:
$ wget http://repo.zabbix.com/zabbix/3.0/debian/pool/main/z/zabbix-release/zabbix-release_3.0-1+jessie_all.deb
$ sudo dpkg -i zabbix-release_3.0-1+jessie_all.deb
$ sudo apt-get update
For Debian 7:
$ http://repo.zabbix.com/zabbix/3.0/debian/pool/main/z/zabbix-release/zabbix-release_3.0-1+wheezy_all.deb
$ sudo dpkg -i zabbix-release_3.0-1+wheezy_all.deb
$ sudo apt-get update
Step 2 – Install Zabbix Agent
sudo apt-get install zabbix-agent
Step 3 – Edit Zabbix Agent Configuration
nano /etc/zabbix/zabbix_agentd.conf
Server=192.168.1.11
Hostname=Server2
UserParameter=zapache[*],/etc/zabbix/scripts/zapache '$1'
UserParameter=proc.cpu,/etc/zabbix/scripts/cpu.py
/etc/init.d/zabbix-agent restart
nano /etc/apache2/apache2.conf
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order allow,deny
# Deny from all
Allow from all
</Location>
/etc/init.d/apache2 reload
mysql -u root -p
Enter password:
mysql> GRANT USAGE ON *.* TO 'zabbix'@'%' IDENTIFIED BY 'superpassword';
Query OK, 0 rows affected (0.05 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)
mysql> quit
Bye
nano /etc/zabbix/.my.cnf
[client]
user = zabbix
password = superpassword
nano /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
### Set of parameters for monitoring MySQL server (v3.23.42 and later)
### Change -u and add -p if required
UserParameter=mysql.version,mysql -V
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/etc/zabbix mysql -N | awk '{print $$2}'
UserParameter=mysql.ping,HOME=/etc/zabbix mysqladmin ping | grep -c alive
# 'sum' on data_length or index_length alone needed when we are getting this information for whole database instead of a single table
UserParameter=mysql.size[*],echo "select sum($(case "$3" in both|"") echo "data_length+index_length";; data|index) echo "$3_length";; free) echo "dat$
mkdir /etc/zabbix/scripts
cd /etc/zabbix/scripts/
nano cpu.py
***
#!/usr/bin/python2.7
#
import psutil
cpu = psutil.cpu_percent(interval=1)
intensity = int(255 * cpu / 100)
print(cpu)
***
nano zapache
chmod +x zapache cpu.py
cd ../
cp server-status /var/www/
sudo apt-get install python-pip python-dev build-essential
pip install psutil
zabbix_agentd -t proc.cpu