В общем далее все публикации смотреть на моем личном блоге:
http://blog.demka.org/
Мой параллельно развивающийся проект:
http://foto.demka.org/
http://blog.demka.org/
Мой параллельно развивающийся проект:
http://foto.demka.org/
Буду публиковать все то что я воплотил в жизнь ...
groupadd mysqluseradd -g mysql mysql
apt-get install make build-essential g++ ncurses-devapt-get install nscdapt-get install c++
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.52.tar.gz/from/http://mirrors.dedipower.com/www.mysql.com/mv ./index.html ./mysql-5.1.52.tar.gztar xzvf mysql-5.1.52.tar.gzcd mysql-5.1.52
./configure --help > configure-mancat configure-man|less
./configure \--sysconfdir=/NFS/mysql/conf \--enable-assembler \--with-mysqld-ldflags=-all-static \--prefix=/NFS/mysql \--localstatedir=/NFS/mysql/db \--with-unix-socket-path=/NFS/mysql/socket/mysqld.sock
mkdir -p /var/run/mysqldln -s /NFS/mysql/socket/mysqld.sock /var/run/mysqld/mysqld.sock
makemake install
scripts/mysql_install_db
--localstatedir=/NFS/mysql/db
chown -R mysql /NFS/mysql/dbchgrp -R mysql /NFS/mysql
mkdir -p /NFS/mysql/confcp support-files/my-medium.cnf /NFS/mysql/conf/my.cnfln -s /NFS/mysql/conf/my.cnf /etc/my.cnf
/NFS/mysql/bin/mysqld_safe --user=mysql &
ps ax|grep mysql
/NFS/mysql/bin/mysqladmin -u root password 'new-password'
/NFS/mysql/bin/mysqladmin
> /root/.ssh/known_hosts> /home/borodatych/.ssh/known_hosts
rm -rf /root/.ssh/known_hostsrm -rf /home/borodatych/.ssh/known_hosts
aptitude updateaptitude upgrade
cat /etc/hostsecho '192.168.8.11 sifon' >> /etc/hostsecho '192.168.8.12 boroda' >> /etc/hostsecho '192.168.8.20 nodez' >> /etc/hostsecho '10.10.10.11 drbd1' >> /etc/hostsecho '10.10.10.12 drbd2' >> /etc/hosts
> /etc/network/interfacesecho 'auto lo' >> /etc/network/interfacesecho 'iface lo inet loopback' >> /etc/network/interfacesecho '' >> /etc/network/interfacesecho 'auto eth0' >> /etc/network/interfacesecho 'iface eth0 inet manual' >> /etc/network/interfacesecho '' >> /etc/network/interfacesecho 'auto br0' >> /etc/network/interfacesecho 'iface br0 inet static' >> /etc/network/interfacesecho ' address X.Y.Z.x1' >> /etc/network/interfacesecho ' network X.Y.z.x2' >> /etc/network/interfacesecho ' netmask 255.255.255.x3' >> /etc/network/interfacesecho ' broadcast X.Y.Z.x4' >> /etc/network/interfacesecho ' gateway X.Y.Z.x5' >> /etc/network/interfacesecho ' bridge_ports eth0' >> /etc/network/interfacesecho ' bridge_stp off' >> /etc/network/interfacesecho ' bridge_fd 0' >> /etc/network/interfacesecho ' bridge_maxwait 0' >> /etc/network/interfacesecho '' >> /etc/network/interfacesecho 'auto eth1' >> /etc/network/interfacesecho 'iface eth1 inet static' >> /etc/network/interfacesecho ' address 10.10.10.12' >> /etc/network/interfacesecho ' netmask 255.255.255.0' >> /etc/network/interfaces/etc/init.d/networking restart
ping sifon -c 1ping boroda -c 1ping nodez -c 1ping drbd1 -c 1ping drbd2 -c 1
cat /etc/resolv.confecho 'nameserver 8.8.8.8' >> /etc/resolv.conf
apt-get install virtinstaptitude install qemu-kvmaptitude install libvirt-bin
aptitude install virt-manager
virsh -c qemu:///system list --all
apt-get install drbd8-utils
cp /etc/drbd.d/global_common.conf /etc/drbd.d/global_common.conf.2> /etc/drbd.d/global_common.confnano /etc/drbd.d/global_common.conf
global { usage-count yes; }common { protocol C;syncer { rate 3072M; }handlers {out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh root";fence-peer "/usr/lib/drbd/crm-fence-peer.sh";after-resync-target "/usr/lib/drbd/crm-unfence-peer.sh";}startup { wfc-timeout 15; degr-wfc-timeout 60; }disk { fencing resource-only; on-io-error detach; no-disk-flushes; no-md-flushes; }net { cram-hmac-alg sha1; shared-secret "amAteIcHik"; ping-timeout 20; max-buffers 8000; max-epoch-size 8000; sndbuf-size 0; }}
include "/etc/drbd.d/global_common.conf";include "/etc/drbd.d/\*.res";
resource drbd0 {on sifon {device /dev/drbd0;disk /dev/md2;address 10.10.10.11:25600;meta-disk internal;}on boroda {device /dev/drbd0;disk /dev/md2;address 10.10.10.12:25600;meta-disk internal;}
resource drbd5 {on sifon {device /dev/drbd5;disk /dev/sdc5;address 10.10.10.11:25605;meta-disk internal;}on boroda {device /dev/drbd5;disk /dev/sdc5;address 10.10.10.12:25605;meta-disk internal;}
mkdir /mnt/rkvmmkdir -p /mnt/skvm/sysmkdir -p /mnt/skvm/iso
/etc/init.d/drbd startdd if=/dev/zero of=/dev/sdc5 bs=1M count=128drbdadm create-md drbd0drbdadm create-md drbd5drbdadm up drbd0drbdadm up drbd5mkfs.ext4 /dev/drbd0mkfs.ext4 /dev/drbd5drbdadm -- --overwrite-data-of-peer primary drbd0drbdadm -- --overwrite-data-of-peer primary drbd5drbdadm connect drbd5watch cat /proc/drbdwatch /etc/init.d/drbd status/etc/init.d/drbd stopupdate-rc.d -f drbd remove
apt-get install pacemaker
cat /etc/default/corosync> /etc/default/corosyncecho 'START=yes' >> /etc/default/corosync
corosync-keygenscp -i ~/.ssh/amatei /etc/corosync/authkey root@192.168.8.12:/etc/corosync/authkeyscp -i ~/.ssh/amatei /etc/corosync/authkey root@192.168.8.20:/etc/corosync/authkeychmod 400 /etc/corosync/authkey
token: 5000token_retransmits_before_loss_const: 20join: 1000consensus: 7500bindnetaddr: 192.168.8.0 (На свою подсеть)
scp -i ~/.ssh/amatei /etc/corosync/corosync.conf root@192.168.8.12:/etc/corosync/corosync.confscp -i ~/.ssh/amatei /etc/corosync/corosync.conf root@192.168.8.20:/etc/corosync/corosync.conf
/etc/init.d/corosync stop/etc/init.d/corosync start
update-rc.d -f corosync removeupdate-rc.d corosync start 90 S . stop 07 0 1 6 .
cd /var/lib/heartbeat/crmrm -rf ./cib
export EDITOR=/bin/nanoecho "export EDITOR=/bin/nano" >> .bashrccrm configure edit
crm configureprimitive DRBD ocf:linbit:drbd params drbd_resource="drbd5" drbdconf="/etc/drbd.conf" op start timeout=240s op stop timeout=120sms msDRBD DRBD meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"location loc_msDRBD_sifon msDRBD 200: sifonlocation loc_msDRBD_boroda msDRBD 100: borodalocation loc_msDRBD msDRBD -inf: nodezproperty stonith-enabled=falseconfigure property no-quorum-policy="ignore"bye
crm configureprimitive DRBD0 ocf:linbit:drbd params drbd_resource="drbd0" drbdconf="/etc/drbd.conf" op start timeout=240s op stop timeout=120sms msDRBD0 DRBD0 meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"location loc_msDRBD0_sifon msDRBD0 100: sifonlocation loc_msDRBD0_boroda msDRBD0 200: borodalocation loc_msDRBD0 msDRBD0 -inf: nodezbye
crm configureprimitive rKVM ocf:heartbeat:VirtualDomain params config="/etc/libvirt/qemu/rKVM.xml" hypervisor="qemu:///system" meta allow-migrate="false" op start timeout="120s" op stop timeout="120s" op monitor depth="0" timeout="30" interval="10"colocation rKVM_on_drbd inf: rKVM msDRBD:Masterorder rKVM_after_drbd inf: msDRBD:promote rKVM:startbye
crm configureprimitive mount_sKVM ocf:heartbeat:Filesystem params device="/dev/drbd0" directory="/mnt/skvm" fstype="ext4" op monitor interval=40s timeout=40s op start timeout=240s op stop timeout=120scolocation mount_sKVM_on_master inf: mount_sKVM msDRBD0:Masterorder mount_sKVM_after_master inf: msDRBD0:promote mount_sKVM:startbye
/etc/init.d/corosync stop/etc/init.d/corosync startps -afe | grep corokillall -9 corosync
apt-get install gcc makeapt-get install libpcre3-devapt-get install libssl-devwget http://sysoev.ru/nginx/nginx-0.8.53.tar.gztar -xzvf nginx-0.8.53.tar.gzcd nginx-0.8.53
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gztar -xzvf pcre-8.10.tar.gz
wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.5.tar.gztar -xzvf zlib-1.2.5.tar.gz
apt-get install openssl
cd ..mkdir -p /PATH/nginx
./configure --help > configure-mancat configure-man
./configure --prefix=/PATH/nginx --sbin-path=/PATH/nginx/nginx --conf-path=/PATH/nginx/nginx.conf --pid-path=/PATH/nginx/nginx.pid --error-log-path=/PATH/nginx/error.log --http-log-path=/PATH/nginx/access.log --with-http_ssl_module --with-pcre=/SRC/pcre-8.10 --with-zlib=/SRC/zlib-1.2.5make cleanmakemake install
PATH/nginx/sbin/nginxkillall -9 nginxps axu | grep nginx
aptitude install virtinstaptitude install qemu-kvm libvirt-bin
apt-get install virt-manager
virsh -c qemu:///system list --allvirsh net-list --all
virt-install --help
virsh --connect qemu:///system
virsh -c qemu:///system list --all
virsh --connect qemu:///system pool-list --all
virsh --connect qemu:///system vol-list sKVM
cd /homewget http://mirror.yandex.ru/ubuntu-releases/10.10/ubuntu-10.10-server-amd64.iso
virt-install --name=rKVM --ram=8192 --vcpus=4 --disk path=/dev/drbd5 --accelerate --noautoconsole --connect=qemu:///system --vnc --hvm --os-type=linux --os-variant=generic26 -w bridge:br0 --import
virt-install --name=rKVM --ram=8192 --vcpus=4 --disk path=/dev/drbd5 --accelerate --noautoconsole --connect=qemu:///system --vnc --hvm --os-type=linux --os-variant=generic26 --cdrom=/home/ubuntu-10.10-server-amd64.iso -w bridge:br0
virt-install --name=tmplKVM --ram=1024 --vcpus=1 --disk path=/mnt/skvm/sys/tmpl.img,size=4 --accelerate --noautoconsole --connect=qemu:///system --vnc --hvm --os-type=linux --os-variant=generic26 --cdrom=/mnt/skvm/iso/ubuntu-10.10-server-amd64.iso -w bridge:br0
virt-install --name=brdKVM --ram=2047 --vcpus=1 --disk path=/mnt/skvm/sys/brd.img,size=8 --accelerate --noautoconsole --connect=qemu:///system --vnc --hvm --os-type=linux --os-variant=generic26 --cdrom=/mnt/skvm/iso/install-amd64-minimal-20101118.iso -w bridge:br0 --prompt
virt-clone -o tmplKVM -n zabbix --file=/mnt/skvm/sys/zabbix.imgvirsh --connect qemu:///system vol-list sKVM
> /etc/hostnameecho 'zabbix' >> /etc/hostnamepasswd root**********userdel tmplkvmuseradd zabbixpasswd zabbix**********nano /etc/network/interfacestaticaddress 192.168.8.101/etc/init.d/networking restartssh root@192.168.8.101cat /etc/resolv.confecho 'nameserver 8.8.8.8' >> /etc/resolv.confМанипуляция с ключами SSH в ручную, пока не автоматизировал)))И моно уже так:ssh -i ~/.ssh/amatei root@192.168.8.101
apt-get install zabbix-server-mysql zabbix-agent zabbix-frontend-php
$DB["SERVER"] = "127.0.0.1";$ZBX_SERVER = '192.168.8.101';
date.timezone = "Asia/Yekaterinburg"max_execution_time = 600max_input_time = 600memory_limit = 256Mpost_max_size = 32Mupload_max_filesize = 16M
nano /etc/zabbix/apache.conf
ListenPort=10051DBHost=127.0.0.1
cd /etc/zabbix/alert.dwget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gztar -xvzf sendEmail-v1.56.tar.gzcd sendEmail-v1.56mv ./sendEmail /etc/zabbix/alert.d/cd ..rm -rf /etc/zabbix/alert.d/sendEmail-v1.56rm -rf /etc/zabbix/alert.d/sendEmail-v1.56.tar.gzcleartouch /etc/zabbix/alert.d/zabbix_sendemail
chmod 755 /etc/zabbix/alert.d/zabbix_sendemail
nano /etc/zabbix/alert.d/zabbix_sendemail
#!/bin/shexport smtpemailfrom=КОМУ@ДОМЕН.ruexport zabbixemailto="$1"export zabbixsubject="$2"export zabbixbody="$3"export smtpserver=smtp.gmail.comexport smtplogin=ОТ_КОГО@ДОМЕН.ruexport smtppass=ПАРОЛЬ
export metod="tls=yes"#export metod="ssl=yes"export port=587#export port=465/etc/zabbix/alert.d/sendEmail -f $smtpemailfrom -t $zabbixemailto -u $zabbixsubject -m $zabbixbody -s $smtpserver:$port -xu $smtplogin -xp $smtppass -o $metod
apt-get install zabbix-agent
Server=192.168.8.101
Server=192.168.8.101ServerPort=10051Hostname=192.168.8.101
aptitude updateaptitude upgradeapt-get install psmisc ntp ntpdate ssh
nano /etc/sysctl.confnet.ipv4.ip_forward=1sysctl -p
mkdir /NFS
nano /etc/apt/sources.list
# PVE packages provided by proxmox.comdeb http://download.proxmox.com/debian lenny pve
wget -O- "http://download.proxmox.com/debian/key.asc" | apt-key add -
aptitude update
aptitude search pve
aptitude install pve-kernel-2.6.32-4-pveaptitude install pve-headers-2.6.32-4-pve
aptitude search proxmoxaptitude install proxmox-ve-2.6.32
nano /boot/grub/grub.cfg (old version: nano /boot/grub/menu.lst)
# network interface settingsauto loiface lo inet loopback
#auto eth0#iface eth0 inet staticiface eth0 inet manual
auto vmbr0iface vmbr0 inet staticaddress 192.168.0.11netmask 255.255.255.0gateway 192.168.0.72bridge_ports eth0bridge_stp offbridge_fd 0
auto venet0iface venet0 inet staticaddress 192.168.2.11netmask 255.255.255.0
auto eth1iface eth1 inet staticaddress 192.168.1.11netmask 255.255.255.0
/etc/init.d/networking restart
pveca -l - Показать состояния кластераpveca -c - Создать новый кластер, а ноду на которой выполнили команду сделать мастеромpveca -s -h IPmaster - Синхронизироваться с мастеромpveca -d ID - Удалить ноду из кластераpveca -a -h IPmaster - Добавить ноду в кластерpveca -m - Сделать мастером
nano /etc/pve/cluster.cfgnano /root/.ssh/known_hosts
apt-get install drbd8-utils
> /etc/drbd.conf
nano /etc/drbd.conf
global { usage-count yes; }common { syncer { rate 200M; } }resource drbd0 {protocol C;startup {wfc-timeout 15;degr-wfc-timeout 60;}net {cram-hmac-alg sha1;shared-secret "ВАШ_ПАРОЛЬ";ping-timeout 20;}on node1 {device /dev/drbd0;disk /dev/sdb5;address 192.168.0.11:7789;meta-disk internal;}on node2 {device /dev/drbd0;disk /dev/sdb5;address 192.168.0.12:7789;meta-disk internal;}disk {on-io-error detach;}handlers {fence-peer "/usr/lib/drbd/crm-fence-peer.sh";}
dd if=/dev/zero of=/dev/sdb5 bs=1M count=128
/etc/init.d/drbd start
drbdadm create-md drbd0drbdadm up drbd0
drbdadm -- --overwrite-data-of-peer primary drbd0
watch cat /proc/drbdwatch /etc/init.d/drbd status
mkfs.ext3 /dev/drbd0
/etc/init.d/drbd stop
update-rc.d drbd remove
apt-get install pacemaker
nano /etc/default/corosyncSTART=yes
corosync-keygen
scp /etc/corosync/authkey root@192.168.0.1X:/etc/corosync/authkeychmod 400 /etc/corosync/authkey
token: 5000token_retransmits_before_loss_const: 20join: 1000consensus: 7500bindnetaddr: 192.168.0.0 # На свою подсеть, класс С, вида Х.Х.Х.0
/etc/init.d/corosync start
nano /usr/lib/ocf/resource.d/linbit/drbdOCF_ROOT=/usr/lib/ocfexport OCF_ROOT=/usr/lib/ocf
nano /usr/lib/ocf/resource.d/heartbeat/IPaddr2OCF_ROOT=/usr/lib/ocfexport OCF_ROOT=/usr/lib/ocf
nano /usr/lib/ocf/resource.d/heartbeat/FilesystemOCF_ROOT=/usr/lib/ocfexport OCF_ROOT=/usr/lib/ocf#OCF_RESKEY_device=/dev/drbd0#OCF_RESKEY_directory=/NFS#OCF_RESKEY_fstype=ext3
nano /usr/lib/ocf/resource.d/heartbeat/nfsserverOCF_ROOT=/usr/lib/ocfexport OCF_ROOT=/usr/lib/ocfDEFAULT_INIT_SCRIPT="/etc/init.d/nfs-kernel-server"
nano /usr/lib/ocf/resource.d/heartbeat/.ocf-binariesPATH="$PATH:/usr/lib/ocf"
export EDITOR=/bin/nanoecho "export EDITOR=/bin/nano" >> .bashrc
crm configure edit
crm configure edit
node node1node node2property $id="cib-bootstrap-options" \dc-version="1.0.9-74392a28b7f31d7ddc86689598bd23114f58978b" \cluster-infrastructure="openais" \expected-quorum-votes="2"
target-role="started"
property $id="cib-bootstrap-options" \dc-version="1.0.9-74392a28b7f31d7ddc86689598bd23114f58978b" \cluster-infrastructure="openais" \expected-quorum-votes="2" \
property $id="cib-bootstrap-options" \dc-version="1.0.9-74392a28b7f31d7ddc86689598bd23114f58978b" \cluster-infrastructure="openais" \expected-quorum-votes="2"
crm configureprimitive resDRBD ocf:linbit:drbd params drbd_resource="drbd0" drbdconf="/etc/drbd.conf" op start timeout=240s op stop timeout=100sms msDRBD resDRBD meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"location loc_msDRBD_3 msDRBD -inf: node3location loc_msDRBD_4 msDRBD -inf: node4property stonith-enabled=falseconfigure property no-quorum-policy="ignore"bye
location loc_msDRBD_3 msDRBD -inf: node3location loc_msDRBD_4 msDRBD -inf: node4
crm configureprimitive resFS ocf:heartbeat:Filesystem params device="/dev/drbd0" directory="/NFS" fstype="ext3" op start timeout=60s op stop timeout=60scolocation fs_on_master inf: resFS msDRBD:Masterorder fs_after_drbd inf: msDRBD:promote resFS:startbye
apt-get install nfs-kernel-serverupdate-rc.d nfs-kernel-server removeupdate-rc.d nfs-common remove
nano /etc/exports/NFS/ 192.168.0.0/255.255.255.0(rw,no_root_squash,no_all_squash,sync)
crm configureprimitive NFSserver ocf:heartbeat:nfsserver params nfs_init_script="/etc/init.d/nfs-kernel-server" nfs_notify_cmd="/sbin/rpc.statd" nfs_shared_infodir="/var/lib/nfs/" nfs_ip="192.168.0.10" op start timeout=40scolocation nfs_on_master inf: NFSserver msDRBD:Masterorder nfss_after_vipp inf: vIPp:start NFSserver:startbye
crm configureprimitive NFSclient ocf:heartbeat:Filesystem params device="192.168.0.10:/NFS" directory="/NFS" fstype="nfs" options="nolock" op start timeout=60s op stop timeout=60scolocation mnt_nfsc_slave inf: NFSclient msDRBD:Slaveorder slave_after_master inf: NFSserver:start NFSclient:startbye
crm configureprimitive NFSnodeX ocf:heartbeat:Filesystem params device="192.168.0.10:/NFS" directory="/NFS" fstype="nfs" options="nolock" op start timeout=60s op stop timeout=60slocation loc_nfsnX NFSnodeX inf: nodeXorder nfsnX_after_nfss inf: NFSserver:start NFSnodeX:startbye
/etc/init.d/corosync stop/etc/init.d/corosync start
mv /var/lib/nfs/ /NFS/ln -s /NFS/nfs/ /var/lib/nfsmv /etc/vz/conf /NFS/vz/confln -s /NFS/vz/conf /etc/vz/confmv /etc/vz/dists /NFS/vz/distsln -s /NFS/vz/dists /etc/vz/distsmv /etc/vz/names /NFS/vz/namesln -s /NFS/vz/dists /etc/vz/dists
rm -fr /var/lib/nfs/ln -s /NFS/nfs/ /var/lib/nfsrm -fr /var/lib/vz/ln -s /NFS/vz/ /var/lib/vzrm -fr /etc/vz/confln -s /NFS/vz/conf /etc/vz/confrm -fr /etc/vz/distsln -s /NFS/vz/dists /etc/vz/distsrm -fr /etc/vz/namesln -s /NFS/vz/names /etc/vz/names
pveca -l - Показать состояния кластераpveca -c - Создать новый кластерpveca -s -h IPmaster - Синхронизироваться с мастеромpveca -d ID - Удалить ноду из кластераpveca -a -h IPmaster - Добавить ноду в кластерpveca -m - Сделать мастером
apt-get install zabbix-server-mysql zabbix-agent zabbix-frontend-php
apt-get install zabbix-agent
update-rc.d zabbix-server remove
/etc/init.d/zabbix-server stop
cp -f /usr/lib/ocf/resource.d/heartbeat/pingd /usr/lib/ocf/resource.d/heartbeat/zabbix-servernano /usr/lib/ocf/resource.d/heartbeat/zabbix-serverOCF_ROOT=/usr/lib/ocfexport OCF_ROOT=/usr/lib/ocf
pingd_start() {/etc/init.d/zabbix-server startОставляем родной код}pingd_stop() {/etc/init.d/zabbix-server stopОставляем родной код}
crm configureprimitive Zabbix ocf:heartbeat:zabbix-server params dampen="60s" host_list="127.0.0.1" op monitor interval="20s" timeout="120s"colocation zabbix_on_master inf: Zabbix resFSorder zabbix_after_fs inf: resFS:start Zabbix:startbye
nano /etc/php5/apache2/php.inidate.timezone = "Asia/Yekaterinburg"memory_limit = 256Mpost_max_size = 32Mupload_max_filesize = 16Mmax_execution_time = 600max_input_time = 600
mkdir /NFS/zabbix
mv /var/lib/mysql/zabbix /NFS/zabbix/dbln -s /NFS/zabbix/db /var/lib/mysql/zabbixmv /usr/share/zabbix /NFS/zabbix/webln -s /NFS/zabbix/web /usr/share/zabbix
rm -fr /var/lib/mysql/zabbixln -s /NFS/zabbix/db /var/lib/mysql/zabbixrm -fr /usr/share/zabbixln -s /NFS/zabbix/web /usr/share/zabbix
ln -s /usr/share/javascript /NFS/zabbix/javascriptln -s /usr/share/fonts /NFS/zabbix/fonts
nano /NFS/zabbix/web/conf/zabbix.conf.php$ZBX_SERVER = '192.168.0.10';
touch /NFS/zabbix/alert.d/zabbix_sendemailchmod 755 /NFS/zabbix/alert.d/zabbix_sendemailnano /NFS/zabbix/alert.d/zabbix_sendemail
#!/bin/shexport smtpemailfrom=ИМЯ@ДОМЕН.ruexport zabbixemailto="$1"export zabbixsubject="$2"export zabbixbody="$3"export smtpserver=smtp.gmail.comexport smtplogin=ИМЯ@ДОМЕН.ruexport smtppass=ПАРОЛЬexport metod="tls=yes"export port=587/NFS/zabbix/alert.d/sendEmail.pl -f $smtpemailfrom -t $zabbixemailto -u $zabbixsubject -m $zabbixbody -s $smtpserver:$port -xu $smtplogin -xp $smtppass -o $metod
zabbixemailto="$1" - ПРАВИЛЬНОzabbixemailto=$1 - НЕ ПРАВИЛЬНОНе забываем кавычки, без них тупо не работает!!!
nano /etc/zabbix/zabbix_agent.confServer=192.168.0.10nano /etc/zabbix/zabbix_agentd.confServer=192.168.0.10,192.168.0.11,192.168.0.12Hostname=192.168.0.10,192.168.0.11,192.168.0.12
cp -f /usr/lib/ocf/resource.d/heartbeat/pingd /usr/lib/ocf/resource.d/heartbeat/zabbix-agentnano /usr/lib/ocf/resource.d/heartbeat/zabbix-agentOCF_ROOT=/usr/lib/ocfexport OCF_ROOT=/usr/lib/ocf
pingd_start() {/etc/init.d/zabbix-agent startОставляем родной код}pingd_stop() {/etc/init.d/zabbix-agent stopОставляем родной код}
crm configureprimitive ZabbixA ocf:heartbeat:zabbix-agent params dampen="60s" host_list="127.0.0.1" op monitor interval="20s" timeout="120s"clone ZabbixAgent ZabbixAcolocation zabbix_on_master inf: ZabbixAgent resFSorder zabbixagent_after_fs inf: resFS:start ZabbixAgent:startbye
update-rc.d zabbix-agent remove