emerge-webrsync
cat <<EOF > /etc/portage/package.use/zabbix
net-analyzer/zabbix -* agent
EOF
https_proxy="https://you_proxy:8118" emerge -v net-analyzer/zabbix
cat <<EOF > /etc/zabbix/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=zabbix.you_domain
ServerActive=zabbix.you_domain
HostnameItem=system.hostname
HostMetadata=gentoo
HostMetadataItem=system.uname
EOF
/etc/init.d/zabbix-agentd start
rc-update add zabbix-agentd default
редактируем праврила фаирвола
nft list ruleset > /tmp/firewall_work
cp -a /tmp/firewall_work /tmp/firewall_new_upload
chain_input=$(cat /tmp/firewall_new_upload | grep "chain input" | wc -l)
if [ "$chain_input" != "0" ]
then
echo 'Сhanging the rule'
else
echo 'You do not have a "chain entry" section in the configuration';
exit 0
fi
в файл /tmp/firewall_new_upload, первой строкой добавяем строку [flush ruleset]
sed -i -e '1 s/^/flush ruleset\n/;' /tmp/firewall_new_upload
в последней строкой в чепочку {chain input} добавляем строку [ip saddr { you.ip.zabbix.server } tcp dport 10050 accept
( head -n -2 /tmp/firewall_new_upload
echo " ip saddr { you.ip.zabbix.server } tcp dport 10050 accept "
tail -n 2 /tmp/firewall_new_upload ) > /tmp/firewall_new_tmp
mv /tmp/firewall_new_tmp /tmp/firewall_new_upload
nft -f /tmp/firewall_new_upload
nft list ruleset
echo 'Everything ended well )))'