zabbix

wget http://stor.friendhosting.net/zabbix_install.sh -O /root/zabbix_install.sh && bash /root/zabbix_install.sh IP_PROXY && rm -rf /root/zabbix_install.sh

yum localinstall http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-release-2.4-1.el7.noarch.rpm
http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm

deb http://repo.zabbix.com/zabbix/2.2/debian wheezy main
apt-get install lighttpd php5-cgi snmp-mibs-downloader mysql-server mysql-client
apt-get install zabbix-server-mysql zabbix-agent zabbix-frontend-php zabbix-get zabbix-sender

/etc/lighttpd/conf-available/20-zabbix.conf :

alias.url += (
«/zabbix/» => «/usr/share/zabbix/»
)

$HTTP[«url»] =~ «^/zabbix/conf/» {
url.access-deny = («»)
}

$HTTP[«url»] =~ «^/zabbix/api/» {
url.access-deny = («»)
}

$HTTP[«url»] =~ «^/zabbix/include/» {
url.access-deny = («»)
}

$HTTP[«url»] =~ «^/zabbix/include/classes/» {
url.access-deny = («»)
}

/etc/php5/mods-available/zabbix.ini:
max_execution_time=300
memory_limit=128M
post_max_size=16M
upload_max_filesize=2M
max_input_time=300
date.timezone=Asia/Yekaterinburg

# cd /etc/php5/cgi/
# ln -s ../mods-available/zabbix.ini conf.d/30-zabbix.ini

# lighty-enable-mod fastcgi-php
# lighty-enable-mod zabbix
# /etc/init.d/lighttpd force-reload

http://ip/zabbix/ Admin zabbix

http://ftp.colocall.net/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install zabbix22-agent

vi etc/zabbix_agentd.conf
ServerActive=91.215.153.6
UserParameter=fc.error,sudo /usr/local/bin/monitoring/flashcache_zabbix.sh
UserParameter=ssd.error,sudo /usr/local/bin/monitoring/ssd_realloc.sh
UserParameter=softraid.status,egrep -c «\[.*_.*\]» /proc/mdstat

cat /usr/local/bin/monitoring/flashcache_zabbix.sh
#!/bin/bash
res=»0″
cat /proc/flashcache/*/flashcache_errors | tr » » «\n»|cut -d= -f 2 | (
while read i ; do
res=($res + $i)
done
echo «$res»
)

visudo
Defaults:zabbix !requiretty
zabbix ALL=(ALL) NOPASSWD: /usr/local/bin/monitoring/*

##### ==============================
PROXY
yum install -y sqlite zabbix-proxy-sqlite3
mkdir /var/lib/sqlite
echo DBName=/var/lib/sqlite/zabbix.db >> /etc/zabbix/zabbix_proxy.conf

##### =======================
NODS
http://stor.friendhosting.net/zabbix_install.sh
ansible vdskvm_nodes -m shell -a ‘yum localinstall http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm -y && yum install zabbix-agent -y’