<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arquivos telegram - Remontti</title>
	<atom:link href="https://blog.remontti.com.br/tag/telegram/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.remontti.com.br/tag/telegram</link>
	<description>rudimar@remontti</description>
	<lastBuildDate>Fri, 16 Jun 2023 16:02:49 +0000</lastBuildDate>
	<language>pt-BR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.remontti.com.br/wp-content/uploads/2024/09/icone-rr-80x80.png</url>
	<title>Arquivos telegram - Remontti</title>
	<link>https://blog.remontti.com.br/tag/telegram</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Como se proteger de ataques DDoS com FastNetMon de graça &#8211; Integração FRR vs NE-Huawei &#8211; Bonus Gráficos Grafana</title>
		<link>https://blog.remontti.com.br/6278</link>
					<comments>https://blog.remontti.com.br/6278#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Wed, 16 Feb 2022 20:00:18 +0000</pubDate>
				<category><![CDATA[Huawei]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[ataques]]></category>
		<category><![CDATA[Bullseye]]></category>
		<category><![CDATA[ccr]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian 11]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[fastnemon]]></category>
		<category><![CDATA[grafana]]></category>
		<category><![CDATA[influxdb]]></category>
		<category><![CDATA[mitigação]]></category>
		<category><![CDATA[ne8000]]></category>
		<category><![CDATA[ne8000f1a]]></category>
		<category><![CDATA[Netflow]]></category>
		<category><![CDATA[telegram]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=6278</guid>

					<description><![CDATA[<p>Existe um tutorial mais atualizado acesse: Fortalecendo a Resiliência da Rede: Detecção de Ataques DDoS com FastNetMon, FRRouting, Grafana e Implementação em Debian 12 com Huawei &#038; RouterOS 👆 👆 👆 👆 👆 👆&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/6278">Como se proteger de ataques DDoS com FastNetMon de graça &#8211; Integração FRR vs NE-Huawei &#8211; Bonus Gráficos Grafana</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><font color="red">Existe um tutorial mais atualizado acesse:</font></h2>
<p><a href="https://blog.remontti.com.br/7322">Fortalecendo a Resiliência da Rede: Detecção de Ataques DDoS com FastNetMon, FRRouting, Grafana e Implementação em Debian 12 com Huawei &#038; RouterOS</a><br />
 <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<pre class="remontti-code">#
#
#
#
#
#
#
#
</pre>
<p><img fetchpriority="high" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_huawei-1.png" alt="" width="720" height="340" class="alignnone size-full wp-image-6341" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_huawei-1.png 720w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_huawei-1-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_huawei-1-520x245.png 520w" sizes="(max-width: 720px) 100vw, 720px" /></p>
<p>Neste tutorial vamos aprender como identificar os ataques Dos/DDoS e anunciar os prefixo atacados (ou atacantes) <strong>de seu AS</strong> em envia-los para uma blackhole, e repassar os mesmo para sua operadora. (Acordo)</p>
<p>Vamos utilizar o <a href="https://github.com/pavel-odintsov/fastnetmon/" rel="noopener noreferrer" target="_blank"><strong>FastNetMon</strong></a> (<strong>Community Edition</strong>) que é um analisador de carga DoS/DDoS de alto desempenho, construído sobre vários mecanismos de captura de pacotes (NetFlow, IPFIX, sFlow, AF_PACKET, SnabbSwitch, netmap, PF_RING, PCAP). </p>
<p>Farei a instalação no <a href="https://blog.remontti.com.br/5792" rel="noopener" target="_blank"><strong>Debian 11 (Instalação Limpa)</strong></a>. O hardware utilizado por ser bem generoso, 1CPU e 1GB de memoria. </p>
<p><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware.png" alt="" width="1212" height="383" class="alignnone size-full wp-image-6312" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware.png 1212w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware-300x95.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware-1024x324.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware-768x243.png 768w" sizes="(max-width: 1212px) 100vw, 1212px" /><br />
Nesse gráfico podemos ver um servidor analisando 10GB via Netflow e quase nada sendo usado de recursos. Mais ao final irei configurar o Graphith para termos gráficos qual irá abusar mais do hardware, porém para muitos gráficos não são necessários, e sim algo que o proteja.  </p>
<p><strong>Cenário fictício de exemplo:</strong><br />
Seu AS: 260072 <em>(Madruga Telecom)</em><br />
Operadora AS: 71 <em>(BrUxa71 Telecom)</em><br />
10.100.0.1/30 &#8211; Huawei NE<br />
10.100.0.2/30 &#8211; Servidor</p>
<h3>Configurando a interface de Rede</h3>
<p>Antes de iniciar a instalação do seu do seu servidor em meu exemplo estou usando o IP 10.100.0.2/30, porém eu NUNCA faria um NAT no roteador de borda então porque utilizar o IP privado? Simples por que ele não é acessível logo não pode ser atacado, mas por outro lado se ele não tiver internet você não poderá fazer a instalação e ele não poderá te notificar pelo telegram. Solução que eu gosto muito de aplicar em servidores é a seguinte (falo muito de como configurar interface de redes <a href="https://blog.remontti.com.br/5848" rel="noopener" target="_blank">nesse tutorial</a>, recomendo uma leitura). </p>
<p>Vamos supor que seu prefixo seja 72.72.72.0/22 e você vai alocar o ip 72.72.72.255<strong>/32</strong> para ser o IP de &#8220;loopback&#8221;. <em>Dica que esse IP não seja próximo a do prefixo público que utiliza em seus servidores</em>.</p>
<pre class="remontti-code"># vim /etc/network/interfaces</pre>
<pre class="remontti-code-plain">allow-hotplug eno1
iface eno1 inet static
    address 72.72.72.255/32

iface enp0s3 inet static
    address 10.100.0.2/30
    post-up /usr/sbin/ip route add default via 10.100.0.1 src 72.72.72.255</pre>
<p>Perceba que nós estaremos conversando com nosso roteador de borda pelo prefixo privado 10.100.0.0/30 porém todo o pacote de origem do servidor sai pelo o IP público. Caso este ip seja atacado o mesmo poderá cair em blackhole que o nosso servidor ainda terá comunicação com a borda. </p>
<p>Mas para que seu IP publico tenha rota será necessário criar um rota em seu roteador de borda apontando o IP público para o privado.</p>
<pre class="remontti-code">&lt;NE-SEUMADRUGA&gt; system-view
Enter system view, return user view with return command.
[~NE-SEUMADRUGA] ip route-static 72.72.72.255 255.255.255.255 10.100.0.2 description FASTNETMON
[*NE-SEUMADRUGA] commit</pre>
<p>É claro que neste caso ficará sem internet, mas podemos aplicar um firewall para enviar que ele fique respondendo, apenas para deixar ele &#8220;escondidinho&#8221;. E para isso vamos usar o nftables (Que já vem instalado por padrão no Debian 11 substituindo o iptables)<br />
Habilite o mesmo para iniciar com o sistema:</p>
<pre class="remontti-code"># systemctl enable nftables</pre>
<p>Vamos montar nosso firewall de forma que apenas conexoes que forem abertas pelo servidor seja respondidas.</p>
<pre class="remontti-code"># vim /etc/nftables.conf</pre>
<pre class="remontti-code-plain">#!/usr/sbin/nft -f

flush ruleset

table inet filter {

        chain input {
                type filter hook input priority 0;

                # Permite que apenas conexoes que foram aberta pelo servidor seja respondidas
                ip daddr 72.72.72.255 ct state related,established counter accept
                ip daddr 72.72.72.255 counter drop

        }
        chain forward {
                type filter hook forward priority 0;
        }
        chain output {
                type filter hook output priority 0;
        }
}</pre>
<p>Inicie o nftables</p>
<pre class="remontti-code"># systemctl start nftables</pre>
<p>Você pode simplesmente rodar um scanner de porta no seu IP público bem como um ping, o mesmo não deve responde. </p>
<h3>Instalação FastNetMon (Edição da comunidade)</h3>
<p>Para ver o comparativo da versão gratuita <a href="https://fastnetmon.com/compare-community-and-advanced/" rel="noopener" target="_blank">acesse aqui</a>. Já antemão o que não teremos suporte é ao IPv6 e alguns recursos extras.<br />
Conversando com <a href="https://www.linkedin.com/in/podintsov">Pavel Odintsov</a> entendeu que no Brasil os planos da versão paga ficam muito pesada para a grande maioria devido a alto do dólar, então ele criou um cupom com <strong>50%</strong> de desconto para os brasileiros. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
Segue os lins com o desconto:<br />
<a href="https://fastnetmon.chargebee.com/hosted_pages/plans/fastnetmon-10g?subscription[coupon]=BRAZIL_PROMO" rel="noopener" target="_blank">Licença 10Gb</a><br />
<a href="https://fastnetmon.chargebee.com/hosted_pages/plans/fastnetmon-40g?subscription[coupon]=BRAZIL_PROMO" rel="noopener" target="_blank">Licença 40GB</a><br />
<a href="https://fastnetmon.chargebee.com/hosted_pages/plans/fastnetmon-100g?subscription[coupon]=BRAZIL_PROMO" rel="noopener" target="_blank">Licença 100GB</a></p>
<p>Vamos a instalação <a href="https://fastnetmon.com/install/" rel="noopener" target="_blank">[Doc Oficial]</a></p>
<pre class="remontti-code"># apt install wget tcpdump net-tools zip curl
# cd /tmp/
# wget https://install.fastnetmon.com/installer -Oinstaller
# chmod +x installer
# ./installer -install_community_edition</pre>
<p>É necessário que vc informe seu e-mail durante a instalação. <em>(Para usar a Comunidade FastNetMon você deve fornecer seu e-mail corporativo válido e aceitar receber informações sobre nossa edição comercial e atualizações de segurança)</em></p>
<pre class="remontti-code-plain">18:13:33 Will log all installation process details into file: /tmp/fastnetmon_install_1170.log
18:13:33 Installer build git version is: b21331ee349eaf0bc2abc71a466802cd26ee2347 build time is: 2022-01-17T16:17:51
18:13:33 Install FastNetMon Community edition

We offer significantly improved FastNetMon Advanced edition: 
&lt;blockquote class=&quot;wp-embedded-content&quot; data-secret=&quot;ghCHMDUZME&quot;&gt;&lt;a href=&quot;https://fastnetmon.com/fastnetmon-advanced/&quot;&gt;FastNetMon Advanced&lt;/a&gt;&lt;/blockquote&gt;&lt;iframe class=&quot;wp-embedded-content&quot; sandbox=&quot;allow-scripts&quot; security=&quot;restricted&quot; style=&quot;position: absolute; clip: rect(1px, 1px, 1px, 1px);&quot; title=&quot;&#8220;FastNetMon Advanced&#8221; &#8212; FastNetMon DDoS Detection Tool&quot; src=&quot;https://fastnetmon.com/fastnetmon-advanced/embed/#?secret=9HRlASbAu2#?secret=ghCHMDUZME&quot; data-secret=&quot;ghCHMDUZME&quot; width=&quot;500&quot; height=&quot;282&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;
You could order free one-month trial for Advanced edition here: 
&lt;blockquote class=&quot;wp-embedded-content&quot; data-secret=&quot;zdVTqp3qpj&quot;&gt;&lt;a href=&quot;https://fastnetmon.com/trial/&quot;&gt;Order trial&lt;/a&gt;&lt;/blockquote&gt;&lt;iframe class=&quot;wp-embedded-content&quot; sandbox=&quot;allow-scripts&quot; security=&quot;restricted&quot; style=&quot;position: absolute; clip: rect(1px, 1px, 1px, 1px);&quot; title=&quot;&#8220;Order trial&#8221; &#8212; FastNetMon DDoS Detection Tool&quot; src=&quot;https://fastnetmon.com/trial/embed/#?secret=kKLHfdm2fM#?secret=zdVTqp3qpj&quot; data-secret=&quot;zdVTqp3qpj&quot; width=&quot;500&quot; height=&quot;282&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;

To use FastNetMon Community you must provide your valid corporate email and accept 
to receive information about our commercial edition and security updates.
You can find our privacy policy here https://fastnetmon.com/privacy-policy/

Provide your corporate email here, personal emails are not allowed: seu@email.com.br
18:13:41 Apply sysctl configuration changes
18:13:41 Disable rp_filter for all interfaces
18:13:41 Installing on Debian 11.2 platform
18:13:41 Download binary package
18:15:27 Successfully installed FastNetMon Community edition</pre>
<p>Adicione todos os prefixos do seu AS, são esses os IPs serão feito analise.</p>
<pre class="remontti-code"># vim /etc/networks_list</pre>
<p>Exemplo:</p>
<pre class="remontti-code">72.72.72.0/22</pre>
<p>Ajustando as configurações do /etc/fastnetmon.conf.<br />
Habilitamos o serviço de netflow: `netflow = off` para `netflow = on`</p>
<pre class="remontti-code"># sed -i &#039;s/netflow = off/netflow = on/&#039; /etc/fastnetmon.conf</pre>
<p>Ajustes de tempo</p>
<pre class="remontti-code"># sed -i &#039;s/average_calculation_time = 5/average_calculation_time = 15/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/average_calculation_time_for_subnets = 5/average_calculation_time_for_subnets = 15/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/netflow_sampling_ratio = 1/netflow_sampling_ratio = 1024/&#039; /etc/fastnetmon.conf</pre>
<p>Defina por quanto tempo em segundos um IP ficará em blackhole o padrão é 1900 seg. No comando estou alterando para 10min: </p>
<pre class="remontti-code"># sed -i &#039;s/ban_time = 1900/ban_time = 600/&#039; /etc/fastnetmon.conf</pre>
<p>Ative medidores de velocidade por sub-rede, para listar a velocidade da faixa em bps e pps para ambas as direções. (Parece que removeram na última versão)</p>
<pre class="remontti-code"># sed -i &#039;s/enable_subnet_counters = off/enable_subnet_counters = on/&#039; /etc/fastnetmon.conf</pre>
<p>Altera o top 7 para o top 10 ao usar o comando fastnetmon_client</p>
<pre class="remontti-code"># sed -i &#039;s/max_ips_in_list = 7/max_ips_in_list = 10/&#039; /etc/fastnetmon.conf</pre>
<p>Temos diferentes abordagens para detecção dos ataques: Pacotes por segundos, largura de banda e por fluxo (flows).</p>
<pre class="remontti-code-plain">ban_for_pps = on
ban_for_bandwidth = on
ban_for_flows = off

ban_for_tcp_bandwidth = off
ban_for_udp_bandwidth = off
ban_for_icmp_bandwidth = off

ban_for_tcp_pps = off
ban_for_udp_pps = off
ban_for_icmp_pps = off
</pre>
<p>Vamos ativar todos os filtros:</p>
<pre class="remontti-code"># sed -i &#039;s/ban_for_flows = off/ban_for_flows = on/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/ban_for_tcp_bandwidth = off/ban_for_tcp_bandwidth = on/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/ban_for_udp_bandwidth = off/ban_for_udp_bandwidth = on/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/ban_for_icmp_bandwidth = off/ban_for_icmp_bandwidth = on/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/ban_for_tcp_pps = off/ban_for_tcp_pps = on/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/ban_for_udp_pps = off/ban_for_udp_pps = on/&#039; /etc/fastnetmon.conf
# sed -i &#039;s/ban_for_icmp_pps = off/ban_for_icmp_pps = on/&#039; /etc/fastnetmon.conf</pre>
<p>Como temos todas as detecções ativas, precisamos ajustar cada situação para sua realidade. Você precisa ter em mente qual é o maior tráfego que pode atingir por um IP da sua rede (seu maior plano) com base nisso tenha em mente que a cada 100MB gera em torno de 10.000 pps por segundo, <strong>isso não é regra</strong> mas pode ser uma base inicial. Vamos imaginar então que meu maior plano seja 900MB, farei uma ajuste no <strong>threshold_pps</strong> para 90.000 pps.</p>
<pre class="remontti-code"># sed -i &#039;s/threshold_pps = 20000/threshold_pps = 90000/&#039; /etc/fastnetmon.conf</pre>
<p>Agora em <strong>threshold_mbps</strong> seria o maior tráfego que você irá permitir, eu normalmente não altero e deixo no padrão 1gb. E em <strong>threshold_flows</strong> o fluxos de limite qual também mantenho o mesmo valor 3500.</p>
<pre class="remontti-code-plain">threshold_mbps = 1050
threshold_flows = 3500</pre>
<p>O netflow ouve a porta padrão 2055 se desejar alterar basta alterar o valor de <strong>netflow_port</strong>. Irei alterar para 52055.</p>
<pre class="remontti-code"># sed -i &#039;s/netflow_port = 2055/netflow_port = 52055/&#039; /etc/fastnetmon.conf</pre>
<p>Por o serviço ira ficar ouvindo em todos os endereços IPs do seu servidor (<strong>netflow_host = 0.0.0.0</strong>), logo o mais correto seria deixa-lo apenas para o IP privado.</p>
<pre class="remontti-code"># sed -i &#039;s/netflow_host = 0.0.0.0/netflow_host = 10.100.0.2/&#039; /etc/fastnetmon.conf</pre>
<p>Ainda em /etc/fastnetmon.conf temos <strong>notify_script_path</strong> que sempre que o fastnetmon identificar um ataque irá executar o script <strong>/usr/local/bin/notify_about_attack.sh</strong>, identificando o IP da sua rede que está sofrendo <strong>(incoming)</strong> o ataque ou que está atacando <strong>(outgoing)</strong> alguém. <strong>Ele NÃO irá identificar os IPs de origem</strong>, pois em um ataque quase sempre as origens são alteradas por milhares de IPs aleatórios.  </p>
<p>Habilite e reinicie o fastnetmon para carregar as novas configurações.</p>
<pre class="remontti-code"># systemctl enable fastnetmon
# systemctl restart fastnetmon</pre>
<p>Verifique se a porta 52055/udp esta ouvindo:</p>
<pre class="remontti-code"># netstat -putan  | grep 52055</pre>
<pre class="remontti-code-plain">udp        0      0 10.100.0.2:52055           0.0.0.0:*                           1599/fastnetmon </pre>
<p>Bom mas antes de criarmos nosso script notify_about_attack.sh, precisamos preparar algumas coisas, e antes de mais nada vamos configurar nosso Huawei para enviar os dados.</p>
<p>Acesse seu roteador Huawei:</p>
<pre class="remontti-code">&lt;NE-SEUMADRUGA&gt; system-view
[~NE-SEUMADRUGA] ip netstream export version ipfix peer-as bgp-nexthop ttl
[*NE-SEUMADRUGA] ip netstream export template sequence-number fixed
[*NE-SEUMADRUGA] ip netstream export index-switch 32
[*NE-SEUMADRUGA] ip netstream as-mode 32
[*NE-SEUMADRUGA] ip netstream timeout active 1
[*NE-SEUMADRUGA] ip netstream timeout inactive 15
[*NE-SEUMADRUGA] ip netstream export template timeout-rate 1
[*NE-SEUMADRUGA] ip netstream export template option sampler
[*NE-SEUMADRUGA] ip netstream export template option application-label
[*NE-SEUMADRUGA] ip netstream sampler fix-packets 1024 inbound
[*NE-SEUMADRUGA] ip netstream sampler fix-packets 1024 outbound
[*NE-SEUMADRUGA] ip netstream export source 10.100.0.1
[*NE-SEUMADRUGA] ip netstream export host 10.100.0.2 52055</pre>
<p>slot 0 NE8000F1A / slot 10 ou 9 NE8000 M8 / slot 3 NE40</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] slot &lt;0-10&gt;
[*NE-SEUMADRUGA] ip netstream sampler to slot self
[*NE-SEUMADRUGA]  ipv6 netstream sampler to slot self</pre>
<p>Será necessário adicionar em todas suas interfaces de Uplink: </p>
<pre class="remontti-code-plain"> ip netstream inbound
 ip netstream outbound</pre>
<p>Exemplo:</p>
<pre class="remontti-code">
interface 40GE0/1/49.71
 vlan-type dot1q 71
 description BruxaDo71Telecom
 ip address 71.71.71.2 255.255.255.252
 statistic enable
 ip netstream inbound
 ip netstream outbound
</pre>
<p>Com o tcpdump vamos monitorar a interface para ver o que esta chegando na porta.</p>
<pre class="remontti-code"># tcpdump -i ens192 -n udp port 52055 -T cnfp -c 10</pre>
<p>Se seu NE estiver mandado os pacotes você terá um resultado como:</p>
<pre class="remontti-code-plain">tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens192, link-type EN10MB (Ethernet), capture size 262144 bytes
14:25:19.601113 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.608068 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.668054 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.691123 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.768055 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.781129 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.831133 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.858054 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.941124 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
14:25:19.958060 IP 10.100.0.1.40000 &gt; 10.100.0.2.52055: NetFlow v9
10 packets captured
10 packets received by filter
0 packets dropped by kernel</pre>
<p>Agora com o comando: </p>
<pre class="remontti-code"># fastnetmon_client</pre>
<p>Iremos visualizar os TOP IPs</p>
<pre class="remontti-code-plain">FastNetMon 1.1.3 master git- Pavel Odintsov: stableit.ru
IPs ordered by: packets
Incoming traffic       724347 pps   6998 mbps    161 flows
72.72.72.238            51973 pps    569 mbps      0 flows  *banned*
72.72.72.112            14390 pps    154 mbps      0 flows
72.72.72.93             14000 pps    150 mbps      0 flows
72.72.72.161            11705 pps    129 mbps      0 flows
72.72.72.118             8797 pps     86 mbps      0 flows
72.72.72.43              7602 pps     84 mbps      0 flows
72.72.72.111             6669 pps     64 mbps      0 flows

Outgoing traffic       291008 pps    705 mbps    101 flows
72.72.72.238            18009 pps     14 mbps      0 flows  *banned*
72.72.72.112             7929 pps      5 mbps      0 flows
72.72.72.93              7110 pps     10 mbps      0 flows
72.72.72.14              4910 pps     40 mbps      0 flows
72.72.72.43              4887 pps      2 mbps      0 flows
72.72.72.161             4537 pps      2 mbps      0 flows
72.72.72.111             3933 pps     14 mbps      0 flows

Internal traffic             0 pps      0 mbps

Other traffic              420 pps      0 mbps

Screen updated in:              0 sec 331 microseconds
Traffic calculated in:          0 sec 854 microseconds
Total amount of IPv6 packets related to our own network: 0
Not processed packets: 0 pps 

Subnet load:
72.72.72.0/22      pps in: 256000   out: 52000    mbps in: 9630  out: 1077
100.100.0.6/32     pps in: 0        out: 0        mbps in: 0     out: 0
</pre>
<p>Perceba que o IP <strong>72.72.72.238</strong> foi banido, pois o mesmo excedeu os pps de 50.000, no entanto este é um dos IPs que então em meu CGNAT, e vai ser natural este ter um comportamento diferente. Para que o <strong>fastnetmon ignore o mesmo</strong> você pode cria uma <strong>lista branca</strong>. Não se preocupe se isso acontecer com você o fastnetmon não ira fazer nenhuma ação, pois não configuramos nada ainda.<br />
Para criar a lista branca <strong>networks_whitelist</strong> com os IPs ou prefixo que deseja ignorar.</p>
<pre class="remontti-code"># &gt; /etc/networks_whitelist
# vim /etc/networks_whitelist</pre>
<p>Exemplo</p>
<pre class="remontti-code-plain">72.72.72.224/28
72.72.73.224/28</pre>
<p>Reinicie para carregar as novas configurações.</p>
<pre class="remontti-code"># systemctl restart fastnetmon</pre>
<h3>Bot Telegram</h3>
<p>Para receber notificações pelo Telegram juntamente com o arquivo de log, vai ser necessário criar um bot do telegram para o uso do mesmo. Se você não sabe como criar um Bot para telegram basta você falar com o <a href="https://telegram.me/BotFather" rel="noopener" target="_blank">@BotFather</a> e enviar para ele <strong>/newbot</strong>, ele irá pedir qual nome você gostaria de dar a seu bot, e em seguida ira gera um token que vamos precisar a seguir. </p>
<p>Para o Telegram vamos usar um scriptzinho que criei.</p>
<pre class="remontti-code"># cd /tmp/
# wget https://github.com/remontti/TelegramCMD/archive/master.zip
# unzip /tmp/master.zip
# chmod a+x /tmp/TelegramCMD-master/telegram
# mv /tmp/TelegramCMD-master/telegram* /usr/local/bin/
# ln -s /usr/local/bin/telegram /bin/telegram</pre>
<p>Edite o token.conf e altere para o seu TOKEN.</p>
<pre class="remontti-code"># vim /usr/local/bin/telegram.conf/token.conf</pre>
<pre class="remontti-code">######################################
# Telegram bot                       #
# Create a new bot with @BotFather   #
# get TOKEN                          #
######################################

TOKEN=&quot;123456789:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF&quot;</pre>
<p>Esse script você pode usar para diversas coisas, ele será capaz de zipar um diretorio e lhe enviar o arquivo bem como enviar apenas uma mensagem. Como usar? É importante você saber que o IDs de grupos tem um &#8220;-&#8221; no inicio do ID, já usuários não. Para descobrir o ID do seu usuário fale com o bot <a href="https://telegram.me/myidbot" rel="noopener" target="_blank"><strong>@myidbot</strong></a> e envie para ele <strong>/getid</strong>, para saber de um grupo adicione <strong>@myidbot</strong> ao seu grupo e envie <strong>/getgroupid@myidbot</strong>. Realize um teste com um dos comandos: (Não esqueça de alterar pelo seu ID)</p>
<pre class="remontti-code-plain">Uso: telegram [Opções]
  -m: Para enviar uma mensagem
     ex: telegram -m &quot;ID Chat&quot; &quot;Meu assunto&quot; &quot;Minha mensagem...&quot;
     ex: telegram -m &quot;-123456789&quot; &quot;Notificação&quot; &quot;Mensagem para um grupo ID&quot;
     ex: telegram -m &quot;123456789&quot; &quot;Notificação&quot; &quot;Mensagem para direta/privado&quot;

  -f: Para enviar um arquivo
     ex: telegram -f &quot;ID Chat&quot; &quot;/diretorio/arquivo&quot; &quot;nome do arquivo zip&quot; &quot;Comentário&quot;
     ex: telegram -f &quot;12345689&quot; /var/log/syslog syslog &quot;Logs do sistema para user privado&quot;
     ex: telegram -f &quot;-12345689&quot; /var/log/syslog syslog &quot;Logs do sistema para um grupo&quot;</pre>
<h3>FRR</h3>
<p>Vamos realizar a instalação do <a href="http://frrouting.org/" rel="noopener" target="_blank">FRRouting</a> (FRR) para fechar sessão BGP entre o roteador de borda e servidor.</p>
<pre class="remontti-code">
# apt install curl apt-transport-https gnupg2 tree net-tools
# curl -s https://deb.frrouting.org/frr/keys.asc | apt-key add -
# echo deb https://deb.frrouting.org/frr bullseye frr-8 | tee -a /etc/apt/sources.list.d/frr.list
# apt update
# apt install frr frr-doc</pre>
<p>Parâmetros kernel</p>
<pre class="remontti-code"># echo &#039;net.ipv4.ip_forward = 1&#039; &gt;&gt; /etc/sysctl.conf
# echo &quot;net.ipv4.conf.all.rp_filter = 0&quot; &gt;&gt; /etc/sysctl.conf
# echo &quot;net.ipv4.conf.default.rp_filter = 0&quot; &gt;&gt; /etc/sysctl.conf
# echo &quot;net.ipv4.conf.lo.rp_filter = 0&quot; &gt;&gt; /etc/sysctl.conf
# echo &quot;net.ipv4.conf.`ip -br link |awk &#039;{print $1}&#039; |grep -v lo`.rp_filter = 0&quot; &gt;&gt; /etc/sysctl.conf
# sysctl -p</pre>
<p>Ative o modulo BGP</p>
<pre class="remontti-code"># sed -i &#039;s/bgpd=no/bgpd=yes/&#039; /etc/frr/daemons</pre>
<p>Reinicie o FRR</p>
<pre class="remontti-code"># systemctl restart frr</pre>
<p>Entre no shell VTY do FRR.</p>
<pre class="remontti-code"># vtysh</pre>
<p>Rode o comando: `show running-config`</p>
<pre class="remontti-code-plain">deb11# show running-config 
Building configuration...

Current configuration:
!
frr version 8.3.1
frr defaults traditional
hostname deb11
log syslog informational
no ip forwarding
no ipv6 forwarding
service integrated-vtysh-config
!
line vty
!
end</pre>
<p>Agora entre no modo de configuração, e vamos preparar nosso peer com o router de borda. No exemplo está praticamente auto explicativo, vamos fechar o peer e <strong>deixar</strong> ser anunciado <strong>apenas nossos prefixos</strong> e aplicaremos a <strong>community 65001:666</strong></p>
<pre class="remontti-code-plain">configure terminal
!
ip prefix-list FASTNETMON_EXPORT seq 5 permit 72.72.72.0/23 le 32
ip prefix-list FASTNETMON_EXPORT seq 10 permit 72.72.74.0/23 le 32
!
!
route-map MARK_FASTNETMON_IMPORT deny 10
!
route-map MARK_FASTNETMON_EXPORT permit 10
 match ip address prefix-list FASTNETMON_EXPORT
 set community 65001:666
!
router bgp 65001
 bgp router-id 10.100.0.2
 neighbor 10.100.0.1 remote-as 260072
 neighbor 10.100.0.1 description &quot;NE8K_BORDA&quot;
# neighbor 10.100.0.1 ebgp-multihop 255 # (Caso seja multihop)
 !
 address-family ipv4 unicast
  neighbor 10.100.0.1 route-map MARK_FASTNETMON_IMPORT in
  neighbor 10.100.0.1 route-map MARK_FASTNETMON_EXPORT out
 exit-address-family
!
line vty
!
end
write memory
exit</pre>
<p>Vamos ao <strong>Huawei</strong></p>
<pre class="remontti-code">&lt;NE-SEUMADRUGA&gt; system-view
Enter system view, return user view with return command.</pre>
<p>Crie uma rota estática de Blackhole</p>
<pre class="remontti-code">[~NE-SEUMADRUGA] ip route-static 192.0.2.1 255.255.255.255 NULL0 description BLACKHOLE</pre>
<p>Crie um filtro que irá aceitar qualquer rota /32</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] ip ip-prefix  ACCEP_PREFIX_MASK32_FASTNETMON_IPV4 index 10 permit 0.0.0.0 0 greater-equal 32</pre>
<p>Crie os prefixos publico para rejeitar e não cair em blackhole mesmo quando atacado, caso você deixar o fastnetmon anúnciar seu NE pode rejeitar (Ex IP Servidores ou CGNAT)</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] ip ip-prefix  IGNORE_PREFIX_FASTNETMON_IPV4 index 10 permit 72.72.72.224 28 greater-equal 28 less-equal 32
[*NE-SEUMADRUGA] ip ip-prefix  IGNORE_PREFIX_FASTNETMON_IPV4 index 20 permit 72.72.73.224 28 greater-equal 28 less-equal 32</pre>
<p>Crie um filtro para a community 65001:666</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] ip community-filter basic COMM_FASTNETMON_BLACKHOLE index 10 permit 65001:666</pre>
<p>Vamos montar agora nosso route policy de import (rotas que iremos receber). A 1ª é ignorar os prefixos <strong>IGNORE_PREFIX_FASTNETMON_IPV4</strong></p>
<pre class="remontti-code">[*NE-SEUMADRUGA] route-policy FASTNETMON_IMPORT_IPV4 deny node 1000
[*NE-SEUMADRUGA]  if-match ip-prefix IGNORE_PREFIX_FASTNETMON_IPV4</pre>
<p>A 2º é o que vir marcado do fastnetmon com 65001:666 (COMM_FASTNETMON_BLACKHOLE) jogar para blackhole e aplicar uma community nova <strong>65444:666</strong>, como no exemplo aqui meu AS é de 32bits vou usar um AS privado, mas onde seu AS é de 16bits o mais comum de se encontrar é AS:666. Assim se você for trânsito de outro AS você pode montar em suas route policy para aceitar prefixos do AS dele com /32 marcados com AS:666 e jogar para blackhole também fica dica!</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] route-policy FASTNETMON_IMPORT_IPV4 permit node 1010
[*NE-SEUMADRUGA]  if-match community-filter COMM_FASTNETMON_BLACKHOLE 
[*NE-SEUMADRUGA]  apply local-preference 999
[*NE-SEUMADRUGA]  apply ip-address next-hop 192.0.2.1
[*NE-SEUMADRUGA]  apply community 65444:666
[*NE-SEUMADRUGA]  if-match ip-prefix ACCEP_PREFIX_MASK32_FASTNETMON_IPV4</pre>
<p>E a 3ª ignoramos o resto como boas praticas.</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] route-policy FASTNETMON_IMPORT_IPV4 deny node 9999</pre>
<p>Para as route policy de export (Rotas que o NE irá ensinar) colocarei apenas um Deny pois ele não precisa ensinar nada.</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] route-policy FASTNETMON_EXPORT_IPV4 deny node 9999
[*NE-SEUMADRUGA] commit</pre>
<p>Vamos ao peer</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] bgp 260072
[~NE-SEUMADRUGA] undo peer 10.100.0.2
[*NE-SEUMADRUGA]  peer 10.100.0.2 as-number 65001
[*NE-SEUMADRUGA]  peer 10.100.0.2 description BORDA_VS_FASTNETMON_IPV4
[*NE-SEUMADRUGA]  peer 10.100.0.2 timer connect-retry 1
[*NE-SEUMADRUGA]  peer 10.100.0.2 connect-interface 10.100.0.1
[*NE-SEUMADRUGA]  peer 10.100.0.2 timer keepalive 10 hold 30 
[*NE-SEUMADRUGA]  ipv4-family unicast
[*NE-SEUMADRUGA]   peer 10.100.0.2 enable
[*NE-SEUMADRUGA]   peer 10.100.0.2 public-as-only
[*NE-SEUMADRUGA]   peer 10.100.0.2 route-policy FASTNETMON_IMPORT_IPV4 import
[*NE-SEUMADRUGA]   peer 10.100.0.2 route-policy FASTNETMON_EXPORT_IPV4 export
[*NE-SEUMADRUGA]   peer 10.100.0.2 next-hop-local
[*NE-SEUMADRUGA]   peer 10.100.0.2 advertise-community
[*NE-SEUMADRUGA]   peer 10.100.0.2 advertise-ext-community
[*NE-SEUMADRUGA] commit
[~NE-SEUMADRUGA] run save </pre>
<p>Em caso de alguma <strong>emergência</strong>, para <strong>baixar</strong> a sessão use:</p>
<pre class="remontti-code">[~NE-SEUMADRUGA] bgp 260072
[*NE-SEUMADRUGA] peer 10.100.0.2 ignore
[*NE-SEUMADRUGA] commit</pre>
<p>Para <strong>subir</strong> novamente:</p>
<pre class="remontti-code">[~NE-SEUMADRUGA] bgp 260072
[*NE-SEUMADRUGA] undo peer 10.100.0.2 ignore
[*NE-SEUMADRUGA] commit</pre>
<p>Verifique se sua sessão subiu:</p>
<pre class="remontti-code">[*NE-SEUMADRUGA] display bgp peer | include 10.100.0.2</pre>
<pre class="remontti-code-plain"> BGP local router ID : x.x.x.x
 Local AS number : 260072
 Total number of peers : 13                 Peers in established state : 13

  Peer                             V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State  PrefRcv
  10.100.0.2                       4       65001   897801  1088107     0 2496h26m Established        0</pre>
<p>No FRR use `show bgp summary`</p>
<pre class="remontti-code"># vtysh</pre>
<pre class="remontti-code-plain"># show bgp summary
IPv4 Unicast Summary:
BGP router identifier 10.100.0.2, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
10.100.0.1      4     260072         5         5        0    0    0 00:02:52            0        0

Total number of neighbors 1
# exit</pre>
<p>Para repassar os prefixos marcados como blackhole para sua operadora você precisará saber qual é a community que a mesma utiliza e se ela lhe oferece esse recurso, em seguida você irá adiciar a route policy da sua operadora uma nova regra:</p>
<p>No exemplo tudo que recebemos do fastnetmon passamos a aplicar a community 65444:666, logo tudo que for marcado com a mesma irei repassar para operadora com a commnunity da operadora. Para isso crie então primeiro a community-filter de Blackhole sua.</p>
<pre class="remontti-code">[~NE-SEUMADRUGA] ip community-filter basic COMM_BLACKHOLE index 10 permit 65444:666</pre>
<p>Agora na route policy da operadora crie algo semelhante ao exemplo, sendo que a community de blackhole que sua operadora passou fosse &#8220;71:666&#8221;:</p>
<pre class="remontti-code">[~NE-SEUMADRUGA] route-policy UPSTREAM_OP_BRUXADO71_EXPORT_IPV4 permit node 2070
[~NE-SEUMADRUGA]  if-match community-filter COMM_BLACKHOLE
[~NE-SEUMADRUGA]  apply community 71:666</pre>
<p>Pronto agora que ja temos nosso peer Up entre router e servidor, nosso Bot mandando mensagem, iremos criar o script que será executado sempre que um ataque for identificado <strong>BAN</strong> ou <strong>UNBAN</strong>. Irei criar um diretório /var/log/fastnetmon_attacks/ataques qual irá ficar os ataques finalizados.</p>
<pre class="remontti-code"># mkdir /var/log/fastnetmon_attacks/ataques -p
# vim /usr/local/bin/notify_about_attack.sh</pre>
<p>Altere <strong>ID_CHAT=&#8217;-1000000000000&#8242;</strong> pelo ID do seu usuário ou grupo.</p>
<pre class="remontti-code">#!/usr/bin/env bash
  
# Este script receberá os seguintes parâmetros:
#  $1 IP do cliente
#  $2 INCOMING -&gt; Vindo de fora da rede | OUTGOING -&gt; Saindo da sua rede
#  $3 Pacotes por seguncoes
#  $4 Ação (ban ou unban)

# Defina o ID do Chat ou Grupo (Grupos sempre começam com &quot;-&quot; )
ID_CHAT=&#039;-1000000000000&#039;

if [ &quot;$2&quot; = &quot;incoming&quot; ]; then
  TIPO=&quot;Sendo atacado&quot;
else 
  TIPO=&quot;Realizando um ataque&quot;
fi

# Desbanindo um IP
if [ &quot;$4&quot; = &quot;unban&quot; ]; then
  /usr/local/bin/telegram -m &quot;$ID_CHAT&quot; &quot;UNBAN IP: &lt;code&gt;$1&lt;/code&gt;&quot; &quot;&lt;code&gt;-&gt;&gt;&lt;/code&gt; Removido da blackhole&quot;
  # Remove IP do anuncio para o FRR
  vtysh --command &quot;configure terminal
  no ip route $1/32 lo
  router bgp 65001
   address-family ipv4 unicast
    no network $1/32
  &quot;
  # Movemos os logs para pasta ataques pois não queremos mais receber elas.
  mv /var/log/fastnetmon_attacks/$1* /var/log/fastnetmon_attacks/ataques
  exit 0
fi

# Banindo um IP
if [ &quot;$4&quot; = &quot;ban&quot; ]; then
  /usr/local/bin/telegram -m &quot;$ID_CHAT&quot; &quot;BAN IP: &lt;code&gt;$1&lt;/code&gt; $TIPO &lt;b&gt;[$3 pps]&lt;/b&gt;&quot; &quot;&lt;code&gt;-&gt;&gt;&lt;/code&gt; Anunciado em blackhole&quot;
  /usr/local/bin/telegram -f &quot;$ID_CHAT&quot; /var/log/fastnetmon_attacks/$1* $1 &quot;Logs do ataque ao IP $1&quot;
  # Anuncia IP ao FRR
  vtysh --command &quot;configure terminal
  ip route $1/32 lo
  router bgp 65001
   address-family ipv4 unicast
    network $1/32
  &quot;
    exit 0
fi

if [ &quot;$4&quot; == &quot;attack_details&quot; ]; then
  #/usr/local/bin/telegram -m &quot;$ID_CHAT&quot; &quot;BAN&quot; &quot;&lt;code&gt;FastNetMon: IP $1 blocked because $2 attack with power $3 pps&lt;/code&gt;&quot;
  exit 0
fi</pre>
<p>De permissão para execução</p>
<pre class="remontti-code"># chmod a+x /usr/local/bin/notify_about_attack.sh</pre>
<p>Restarte o fastnetmon</p>
<pre class="remontti-code"># systemctl restart fastnetmon</pre>
<p>Se quiser fazer um teste manual anunciando um IP (um que não esteja em uso né!!! rsrsrs) exemplo: 72.72.73.255/32<br />
Adicionando:</p>
<pre class="remontti-code"># vtysh --command &quot;configure terminal
  ip route 72.72.73.255/32 lo
  router bgp 65001
   address-family ipv4 unicast
    network 72.72.73.255/32&quot;</pre>
<p>Verificando se esta enviando:</p>
<pre class="remontti-code"># vtysh --command &quot; show ip bgp neighbors 10.100.0.1 advertised-routes&quot;</pre>
<pre class="remontti-code-plain">BGP table version is 3, local router ID is 10.100.0.2, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, &gt; best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop&#039;s vrf id, &lt; announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          Next Hop            Metric LocPrf Weight Path
*&gt; 72.72.73.255/32  0.0.0.0                  0         32768 i

Total number of prefixes 1</pre>
<p>Removendo:</p>
<pre class="remontti-code"># vtysh --command &quot;configure terminal
  no ip route 72.72.73.255/32 lo
  router bgp 65001
   address-family ipv4 unicast
    no network 72.72.73.255/32&quot;</pre>
<p>Finalizamos a primeira parte sem fazer nenhum estrago ao servidor (CPU) <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>
<p>Seria interessante fazer alguns testes de ataques (coisa pequena) mas com características reais de dentro da sua rede e de fora, escolha uma IP que não esteja em uso para tal! Para realizar esse ataque user o a ferramenta criada pelo ekovegeance: <a href="https://github.com/ekovegeance/DDOS" rel="noopener noreferrer" target="_blank">https://github.com/ekovegeance/DDOS</a></p>
<p>Em um servidor/desktop linux vai precisar ter instalado os pacotes bash sudo curl netcat hping3 openssl stunnel nmap whois dnsutils.<br />
<a href="https://github.com/ekovegeance/DDOS/archive/v1.2.4.zip">Baixe os arquivos</a>, extraia entre em sua pasta e execute o arquivo ddos.</p>
<pre class="remontti-code">$ wget https://github.com/ekovegeance/DDOS/archive/v1.2.4.zip
$ unzip v1.2.4.zip 
$ cd DDOS-1.2.4/
$ ./ddos</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos.png" data-rel="lightbox-gallery-Ccj4Kkyl" data-rl_title="" data-rl_caption="" title=""><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos.png" alt="" width="676" height="881" class="alignnone size-full wp-image-3988" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos.png 676w, https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos-230x300.png 230w" sizes="(max-width: 676px) 100vw, 676px" /></a></p>
<h3>Gráficos Grafana</h3>
<p>Habilite o graphite no fastnetmon</p>
<pre class="remontti-code"># sed -i &#039;s/graphite = off/graphite = on/&#039; /etc/fastnetmon.conf</pre>
<p>Vamos instalar o <strong>influxdb</strong> para ser a base de dados</p>
<pre class="remontti-code"># apt install lsb-release gnupg2 curl wget
# wget -q https://repos.influxdata.com/influxdata-archive_compat.key
# echo &#039;393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key&#039; \
  | sha256sum -c &amp;&amp; cat influxdata-archive_compat.key \
  | gpg --dearmor \
  | tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg &gt; /dev/null
# echo &#039;deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main&#039;\
  | tee /etc/apt/sources.list.d/influxdata.list
# apt update
# apt install influxdb</pre>
<p>Edite o influxdb.conf</p>
<pre class="remontti-code"># vim /etc/influxdb/influxdb.conf</pre>
<p>Localize [[graphite]] e abaixo adicione:</p>
<pre class="remontti-code-plain">[[graphite]]
  enabled = true
  bind-address = &quot;:2003&quot;
  protocol = &quot;tcp&quot;
  consistency-level = &quot;one&quot;
  separator = &quot;.&quot;
  batch-size = 5000 # will flush if this many points get buffered
  batch-timeout = &quot;1s&quot; # will flush at least this often even if we haven&#039;t hit buffer limit
  templates = [
    &quot;fastnetmon.hosts.* app.measurement.cidr.direction.function.resource&quot;,
    &quot;fastnetmon.networks.* app.measurement.cidr.direction.resource&quot;,
    &quot;fastnetmon.total.* app.measurement.direction.resource&quot;
  ]</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/influxdb_graphite.png" alt="" width="1038" height="639" class="alignnone size-full wp-image-6314" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/influxdb_graphite.png 1038w, https://blog.remontti.com.br/wp-content/uploads/2022/02/influxdb_graphite-300x185.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/influxdb_graphite-1024x630.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/influxdb_graphite-768x473.png 768w" sizes="auto, (max-width: 1038px) 100vw, 1038px" /></p>
<p>Reinicie o influxdb</p>
<pre class="remontti-code"># systemctl restart influxdb</pre>
<p>Em seguida o fastnetmon</p>
<pre class="remontti-code"># systemctl restart fastnetmon</pre>
<p>Agora vamos acessar o o influxdb para ver se o banco graphite foi criado.</p>
<pre class="remontti-code"># influx</pre>
<pre class="remontti-code-plain">Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10</pre>
<pre class="remontti-code">&gt; use graphite</pre>
<pre class="remontti-code-plain">Using database graphite</pre>
<pre class="remontti-code">&gt; show measurements</pre>
<pre class="remontti-code-plain">name: measurements
name
----
hosts
networks
total</pre>
<pre class="remontti-code">&gt; exit</pre>
<h4> Grafana</h3>
<p>Adicione o repositório do grafana e instale-o</p>
<pre class="remontti-code"># wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -
# echo &quot;deb https://packages.grafana.com/oss/deb stable main&quot; | tee -a /etc/apt/sources.list.d/grafana.list
# apt update; apt install grafana</pre>
<p>Habilite serviço para inicialização e inicie o mesmo</p>
<pre class="remontti-code"># systemctl enable grafana-server
# systemctl start grafana-server</pre>
<p>Acesse em seu navegador <strong>http://ip_privado:3000</strong> e entre com <strong>usuário e senha admin</strong> em seguida defina uma nova senha.<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_01.png" alt="" width="1384" height="769" class="alignnone size-full wp-image-6318" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_01.png 1384w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_01-300x167.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_01-1024x569.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_01-768x427.png 768w" sizes="auto, (max-width: 1384px) 100vw, 1384px" /></p>
<p>No menu <strong>Configuration</strong> e vá em  <strong>Data sources</strong>, clique em <strong>Add data source</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_02.png" alt="" width="1113" height="564" class="alignnone size-full wp-image-6319" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_02.png 1113w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_02-300x152.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_02-1024x519.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_02-768x389.png 768w" sizes="auto, (max-width: 1113px) 100vw, 1113px" /></p>
<p>Localize influxDB e selecione<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_03.png" alt="" width="1370" height="366" class="alignnone size-full wp-image-6320" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_03.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_03-300x80.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_03-1024x274.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_03-768x205.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></p>
<p>Preencha apenas:<br />
URL:<strong> http://localhost:8086</strong><br />
Database: <strong>graphite</strong><br />
E clique em <strong>Save &#038; test</strong>, você deve ter a resposta <strong>Data source is working</strong>.</p>
<p>Faça <strong><a href="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon-Dash.zip" rel="noopener" target="_blank">download aqui</a> </strong>das Dashs e importe.<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_04.png" alt="" width="207" height="187" class="alignnone size-full wp-image-6321" /><br />
Não esqueça de definir o banco InfluxDB<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_05.png" alt="" width="859" height="590" class="alignnone size-full wp-image-6323" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_05.png 859w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_05-300x206.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/grafana_fastnetmon_05-768x527.png 768w" sizes="auto, (max-width: 859px) 100vw, 859px" /></p>
<p>Você pode pesquisar por mais dashs em: <a href="https://grafana.com/grafana/dashboards/?search=fastnetmon" rel="noopener" target="_blank">https://grafana.com/grafana/dashboards/?search=fastnetmon</a></p>
<p><strong>Fastnetmon</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon.png" alt="" width="1920" height="1480" class="alignnone size-full wp-image-6329" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon-300x231.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon-1024x789.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon-768x592.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon-1536x1184.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /><br />
<strong>Fastnetmon PAINEL GERAL</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_PAINEL_GERAL.png" alt="" width="1920" height="984" class="alignnone size-full wp-image-6328" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_PAINEL_GERAL.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_PAINEL_GERAL-300x154.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_PAINEL_GERAL-1024x525.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_PAINEL_GERAL-768x394.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_PAINEL_GERAL-1536x787.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></p>
<p><strong>Fastnetmon TOP HOSTS (+100MB)</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_100MB.png" alt="" width="1920" height="1478" class="alignnone size-full wp-image-6331" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_100MB.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_100MB-300x231.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_100MB-1024x788.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_100MB-768x591.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_100MB-1536x1182.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></p>
<p><strong>Fastnetmon TOP HOSTS (+300MB)</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_300MB.png" alt="" width="1920" height="984" class="alignnone size-full wp-image-6332" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_300MB.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_300MB-300x154.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_300MB-1024x525.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_300MB-768x394.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_HOSTS_300MB-1536x787.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></p>
<p><strong>Fastnetmon TOP NETWORKS</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_NETWORKS.png" alt="" width="1920" height="984" class="alignnone size-full wp-image-6333" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_NETWORKS.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_NETWORKS-300x154.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_NETWORKS-1024x525.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_NETWORKS-768x394.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_NETWORKS-1536x787.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></p>
<p><strong>Fastnetmon TOP TRÁFEGO DE SAÍDA</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_TRAFEGO_DE_SAIDA.png" alt="" width="1920" height="984" class="alignnone size-full wp-image-6334" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_TRAFEGO_DE_SAIDA.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_TRAFEGO_DE_SAIDA-300x154.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_TRAFEGO_DE_SAIDA-1024x525.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_TRAFEGO_DE_SAIDA-768x394.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TOP_TRAFEGO_DE_SAIDA-1536x787.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></p>
<p><strong>Fastnetmon TRÁFEGO REDE ESPECIFICADA</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_REDE_ESPECIFICADA.png" alt="" width="1920" height="912" class="alignnone size-full wp-image-6335" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_REDE_ESPECIFICADA.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_REDE_ESPECIFICADA-300x143.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_REDE_ESPECIFICADA-1024x486.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_REDE_ESPECIFICADA-768x365.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_REDE_ESPECIFICADA-1536x730.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></p>
<p><strong>Fastnetmon TRÁFEGO POR IP ESPECIFICO</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_POR_IP_ESPECIFICO.png" alt="" width="1920" height="912" class="alignnone size-full wp-image-6336" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_POR_IP_ESPECIFICO.png 1920w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_POR_IP_ESPECIFICO-300x143.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_POR_IP_ESPECIFICO-1024x486.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_POR_IP_ESPECIFICO-768x365.png 768w, https://blog.remontti.com.br/wp-content/uploads/2022/02/Fastnetmon_TRAFEGO_POR_IP_ESPECIFICO-1536x730.png 1536w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></p>
<p>E como ficou o hardware agora?<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware_grafana.png" alt="" width="1340" height="458" class="alignnone size-full wp-image-6338" srcset="https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware_grafana.png 1340w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware_grafana-300x103.png 300w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware_grafana-1024x350.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2022/02/fastnetmon_hardware_grafana-768x262.png 768w" sizes="auto, (max-width: 1340px) 100vw, 1340px" /></p>
<p>Gostou? Se sentindo mais seguro agora? É consultor e ganha $ com isso!?</p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p>Fontes:<br />
<a href="https://fastnetmon.com/install/" rel="noopener" target="_blank">https://fastnetmon.com/install/</a><br />
<a href="https://docs.frrouting.org/en/latest/bgp.html" rel="noopener" target="_blank">https://docs.frrouting.org/en/latest/bgp.html</a><br />
<a href="https://deb.frrouting.org/" rel="noopener" target="_blank">https://deb.frrouting.org/</a><br />
<a href="https://fastnetmon.com/docs/influxdb_integration/" rel="noopener" target="_blank">https://fastnetmon.com/docs/influxdb_integration/</a><br />
<a href="https://grafana.com/docs/grafana/latest/installation/debian/" rel="noopener" target="_blank">https://grafana.com/docs/grafana/latest/installation/debian/</a></p>
<h4>BÔNUS PEGANDO PREFIXO /24 DO IP ATACADO E ANUNCIANDO COM OUTRA COMMUNITY PARA MITIGAR</h4>
<pre class="remontti-code-plain">
#####################
# SCRIPT FASTNETMON
#####################

#!/usr/bin/env bash
  
# Este script receberá os seguintes parâmetros:
#  $1 IP do cliente
#  $2 INCOMING -&gt; Vindo de fora da rede | OUTGOING -&gt; Saindo da sua rede
#  $3 Pacotes por seguncoes
#  $4 Ação (ban ou unban)

# Pegando prefixo 24
ip32=$1
prefixo24=&quot;${ip32%.*}.0/24&quot;

# Defina o ID do Chat ou Grupo (Grupos sempre começam com &quot;-&quot; )
ID_CHAT=&#039;-1000000000000&#039;
 
if [ &quot;$2&quot; = &quot;incoming&quot; ]; then
  TIPO=&quot;Sendo atacado&quot;
else 
  TIPO=&quot;Realizando um ataque&quot;
fi
 
# Desbanindo um IP
if [ &quot;$4&quot; = &quot;unban&quot; ]; then
  /usr/local/bin/telegram -m &quot;$ID_CHAT&quot; &quot;UNBAN IP: &lt;code&gt;$1&lt;/code&gt;&quot; &quot;&lt;code&gt;-&gt;&gt;&lt;/code&gt; Removido da blackhole&quot;
  # Remove IP do anuncio para o FRR
  vtysh --command &quot;configure terminal
  no ip route $1/32 lo
  no ip route $prefixo24 lo
  router bgp 65001
   address-family ipv4 unicast
    no network $1/32
    no network $prefixo24
  &quot;
  # Movemos os logs para pasta ataques pois não queremos mais receber elas.
  mv /var/log/fastnetmon_attacks/$1* /var/log/fastnetmon_attacks/ataques
  exit 0
fi
 
# Banindo um IP
if [ &quot;$4&quot; = &quot;ban&quot; ]; then
  /usr/local/bin/telegram -m &quot;$ID_CHAT&quot; &quot;BAN IP: &lt;code&gt;$1&lt;/code&gt; $TIPO &lt;b&gt;[$3 pps]&lt;/b&gt;&quot; &quot;&lt;code&gt;-&gt;&gt;&lt;/code&gt; Anunciado em blackhole&quot;
  /usr/local/bin/telegram -f &quot;$ID_CHAT&quot; /var/log/fastnetmon_attacks/$1* $1 &quot;Logs do ataque ao IP $1&quot;
  # Anuncia IP ao FRR
  vtysh --command &quot;configure terminal
  ip route $1/32 lo
  ip route $prefixo24 lo
  router bgp 65001
   address-family ipv4 unicast
    network $1/32
    network $prefixo24
  &quot;
    exit 0
fi
 
if [ &quot;$4&quot; == &quot;attack_details&quot; ]; then
  #/usr/local/bin/telegram -m &quot;$ID_CHAT&quot; &quot;BAN&quot; &quot;&lt;code&gt;FastNetMon: IP $1 blocked because $2 attack with power $3 pps&lt;/code&gt;&quot;
  exit 0
fi


#####################
# FRR
#####################


!
frr version 8.5.1
frr defaults traditional
hostname fnm
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
router bgp 65001
 bgp router-id 172.16.1.2
 neighbor 172.16.1.1 remote-as 12345
 neighbor 172.16.1.1 description &quot;BORDA&quot;
 !
 address-family ipv4 unicast
  neighbor 172.16.1.1 route-map MARK_FASTNETMON_IMPORT in
  neighbor 172.16.1.1 route-map MARK_FASTNETMON_EXPORT out
 exit-address-family
exit
!
ip prefix-list FASTNETMON_EXPORT_32 seq 5 permit 200.0.0.0/22 le 32
!
ip prefix-list FASTNETMON_EXPORT_24 seq 5 permit 200.0.0.0/22 le 24
!
route-map MARK_FASTNETMON_IMPORT deny 10
exit
!
route-map MARK_FASTNETMON_EXPORT permit 10
 match ip address prefix-list FASTNETMON_EXPORT_24
 set community 65001:777
exit
! 
route-map MARK_FASTNETMON_EXPORT permit 20
 match ip address prefix-list FASTNETMON_EXPORT_32
 set community 65001:666
exit
!
end
write memory


#####################
# HUAWEI
#####################


#Configurando filtros e sessão BGP
ip route-static 192.0.2.1 255.255.255.255 NULL0 description BLACKHOLE

# Aceitas os prefixos 32 do AS para blackhole
ip ip-prefix  ACCEP_PREFIX_MASK32_FASTNETMON_IPV4 index 10 permit 200.0.0.0 22 greater-equal 32

# Aceitas os prefixos 24 do AS para mitigar
ip ip-prefix  ACCEP_PREFIX_MASK24_FASTNETMON_IPV4 index 10 permit 200.0.0.0 22 greater-equal 24

#Iginora Prefixos do CGNAT/Servidores
ip ip-prefix  IGNORE_PREFIX_FASTNETMON_IPV4 index 10 permit 200.0.1.0 28 greater-equal 28 less-equal 32
ip ip-prefix  IGNORE_PREFIX_FASTNETMON_IPV4 index 20 permit 200.0.2.0 26 greater-equal 26 less-equal 32

# community que o FRR ira enviar
ip community-filter basic COMM_FASTNETMON_BLACKHOLE_32 index 10 permit 65001:666
ip community-filter basic COMM_FASTNETMON_BLACKHOLE_24 index 10 permit 65001:777

# Define comm para usar nos RP das operadoras
ip community-filter basic COMM_BLACKHOLE_32 index 10 permit 65444:666
ip community-filter basic COMM_BLACKHOLE_24 index 10 permit 65444:777

# RP
route-policy FASTNETMON_IMPORT_IPV4 deny node 1000
 if-match ip-prefix IGNORE_PREFIX_FASTNETMON_IPV4

route-policy FASTNETMON_IMPORT_IPV4 permit node 1010
 if-match community-filter COMM_FASTNETMON_BLACKHOLE_32 
 apply local-preference 999
 apply ip-address next-hop 192.0.2.1
 apply community 65444:666
 if-match ip-prefix ACCEP_PREFIX_MASK32_FASTNETMON_IPV4
 
route-policy FASTNETMON_IMPORT_IPV4 permit node 1020
 if-match community-filter COMM_FASTNETMON_BLACKHOLE_24
 apply local-preference 999
 apply ip-address next-hop 192.0.2.1
 apply community 65444:777
 if-match ip-prefix ACCEP_PREFIX_MASK24_FASTNETMON_IPV4
 
route-policy FASTNETMON_IMPORT_IPV4 deny node 9999
route-policy FASTNETMON_EXPORT_IPV4 deny node 9999

# FILTRO OPERADORA

# Envia para community de blackhole da operadora 
route-policy UPSTREAM_OP_BRUXADO71_EXPORT_IPV4 permit node 2070
 if-match community-filter COMM_BLACKHOLE_32
 apply community 71:666

# Envia para community de blackhole de mitigraçação
route-policy UPSTREAM_OP_BRUXADO71_EXPORT_IPV4 permit node 2070
 if-match community-filter COMM_BLACKHOLE_24
 apply community 71:999
</pre>
<p>O post <a href="https://blog.remontti.com.br/6278">Como se proteger de ataques DDoS com FastNetMon de graça &#8211; Integração FRR vs NE-Huawei &#8211; Bonus Gráficos Grafana</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/6278/feed</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title>Instalação do Zabbix 5 LTS + Grafana 7/8 + NGINX + PostgreSQL + Notificação Telegram com Debian 10/11</title>
		<link>https://blog.remontti.com.br/5517</link>
					<comments>https://blog.remontti.com.br/5517#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Fri, 16 Apr 2021 20:08:16 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Bullseye]]></category>
		<category><![CDATA[buster]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian 11]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[zabbix]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=5517</guid>

					<description><![CDATA[<p>O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/5517">Instalação do Zabbix 5 LTS + Grafana 7/8 + NGINX + PostgreSQL + Notificação Telegram com Debian 10/11</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/CAPA-ZABBIX-GRAFANA-POSTGRESQL.png" alt="" width="720" height="340" class="alignnone size-full wp-image-5530" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/CAPA-ZABBIX-GRAFANA-POSTGRESQL.png 720w, https://blog.remontti.com.br/wp-content/uploads/2021/04/CAPA-ZABBIX-GRAFANA-POSTGRESQL-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/CAPA-ZABBIX-GRAFANA-POSTGRESQL-520x245.png 520w" sizes="auto, (max-width: 720px) 100vw, 720px" /><br />
O <strong>Zabbix</strong> é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível de notificação que permite configurar alertas por e-mail entre outros como Telegram, para praticamente qualquer evento. As notificações permitem que se reaja rapidamente à problemas no ambiente. O Zabbix oferece excelentes recursos de relatórios e visualização de dados armazenados. Isso faz com que o Zabbix seja a ferramenta ideal para planejamento de capacidade.<br />
O <strong>Grafana</strong> é um software livre que permite a visualização de formato de dados métricos. Ele permite criar painéis e gráficos a partir de várias fontes, mas aqui iremos vamos aprender a integra-lo com o Zabbix.</p>
<h4>Requisitos se Debian 10 Buster</h4>
<p>&#8211; <a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">* Debian 10 instalação limpa</a><br />
&#8211; <a href="https://blog.remontti.com.br/5487" rel="noopener" target="_blank">* Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt</a> (Opcional phpPgAdmin + Letsencrypt)</p>
<h4>Requisitos se Debian 11 Bullseye </h4>
<p>&#8211; <a href="https://blog.remontti.com.br/5792" rel="noopener" target="_blank">Instalação do Debian 11 Bullseye limpa passo-a-passo</a><br />
&#8211; <a href="https://blog.remontti.com.br/5915" rel="noopener" target="_blank">Servidor WEB NGINX + PHP + PostgreSQL + phpPgAdmin + Letsencrypt no Debian 11 Bullseye (LNPP)</a></p>
<h1>Instalação do Zabbix</h1>
<p>Para instalação do Zabbix vamos incluir o repositório do oficial do Zabbix.</p>
<pre class="remontti-code"># su -
# cd /tmp
# apt install wget</pre>
<p><strong>Repositório Debian 10</strong></p>
<pre class="remontti-code"># wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb
# dpkg -i zabbix-release_5.0-1+buster_all.deb</pre>
<p><strong>Repositório  Debian 11</strong></p>
<pre class="remontti-code"># wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-2+debian11_all.deb
# dpkg -i zabbix-release_5.0-2+debian11_all.deb</pre>
<p>Atualize o repositório e realize a instalação </p>
<pre class="remontti-code"># apt update ; apt upgrade
# apt install zabbix-server-pgsql zabbix-frontend-php zabbix-nginx-conf zabbix-agent</pre>
<p>Vamos criar uma base de dados chamada <strong>zabbix</strong> e um usuário também chamado de zabbix no PostgreSQL.<br />
Não esqueça de alterar a senha: Use o gerador de senha: <a href="https://senhasegura.remontti.com.br/" rel="noopener noreferrer" target="_blank">https://senhasegura.remontti.com.br/</a></p>
<pre class="remontti-code"># su - postgres
$ createuser --pwprompt zabbix
Digite a senha para a nova role:  &lt;SENHA ZABBIX&gt;
Digite-a novamente: &lt;SENHA ZABBIX&gt;
Senha: &lt;SENHA POSTGRES CASO TENHA DEFINIDO NA INSTALAÇÃO DO MESMO&gt;

$ createdb -O zabbix zabbix
Senha: &lt;SENHA POSTGRES&gt;</pre>
<p>Importe o esquema inicial e os dados. Você será solicitado a inserir a senha que foi criada anteriormente.</p>
<pre class="remontti-code">$ zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | psql -U zabbix -d zabbix &amp;&gt;/dev/null
Senha para usuário zabbix: : &lt;SENHA ZABBIX&gt;
$ exit</pre>
<p>Edite o arquivo zabbix_server.conf para informar os dados para conexão com do PostgreSQL.</p>
<pre class="remontti-code"># vim /etc/zabbix/zabbix_server.conf</pre>
<p>Procure por <strong># DBPassword=</strong> descomente e sete sua senha.</p>
<pre class="remontti-code">#...
DBPassword=&lt;SENHA ZABBIX&gt;
#...</pre>
<p>Ajuste o arquivo /etc/zabbix/php-fpm.conf, descomente e defina o fuso horário correto. <a href="https://secure.php.net/manual/pt_BR/timezones.america.php" rel="noopener noreferrer" target="_blank">timezone</a> Sua região</a>.</p>
<pre class="remontti-code"># vim /etc/zabbix/php-fpm.conf</pre>
<p>Exemplo:</p>
<pre class="remontti-code">; php_value[date.timezone] = Europe/Riga
php_value[date.timezone] = America/Sao_Paulo</pre>
<p>Este é modelo padrão, altere então para sua região, também irei alterar alguns valores padrões se quiser pode remover as conf do mod_php5.c </p>
<p>Ajuste as configurações do nginx.</p>
<pre class="remontti-code"># vim /etc/nginx/conf.d/zabbix.conf </pre>
<p>Deixei algumas linhas comentadas como exemplo, faça de acordo com sua necessidade.</p>
<pre class="remontti-code">server {
        listen 80;
        listen [::]:80;
        server_name    zabbix.remontti.com.br localhost;
        #server_name   OU_SEU_IP;

        # Metodo simples para quem quer rodar em uma determinada porta
        #listen 8181;
        #listen [::]:8181;
        #server_name     _;

        root    /usr/share/zabbix;
        index   index.php;

        # Desmomente para deixar restringido apenas para determinados prefixos
        #allow  192.168.87.0/24;
        #allow  127.0.0.1;
        #allow  2001:0db8::/32;
        #allow  ::1;
        #deny   all;
        #error_page  403   http://www.remontti.com.br;
 
        location = /favicon.ico {
                log_not_found   off;
        }

        location / {
                try_files       $uri $uri/ =404;
        }

        location /assets {
                access_log      off;
                expires         10d;
        }

        location ~ /\.ht {
                deny            all;
        }

        location ~ /(api\/|conf[^\.]|include|locale) {
                deny            all;
                return          404;
        }

        location ~ [^/]\.php(/|$) {
                fastcgi_pass    unix:/var/run/php/zabbix.sock;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_index   index.php;

                fastcgi_param   DOCUMENT_ROOT   /usr/share/zabbix;
                fastcgi_param   SCRIPT_FILENAME /usr/share/zabbix$fastcgi_script_name;
                fastcgi_param   PATH_TRANSLATED /usr/share/zabbix$fastcgi_script_name;

                include fastcgi_params;
                fastcgi_param   QUERY_STRING    $query_string;
                fastcgi_param   REQUEST_METHOD  $request_method;
                fastcgi_param   CONTENT_TYPE    $content_type;
                fastcgi_param   CONTENT_LENGTH  $content_length;

                fastcgi_intercept_errors        on;
                fastcgi_ignore_client_abort     off;
                fastcgi_connect_timeout         60;
                fastcgi_send_timeout            180;
                fastcgi_read_timeout            180;
                fastcgi_buffer_size             128k;
                fastcgi_buffers                 4 256k;
                fastcgi_busy_buffers_size       256k;
                fastcgi_temp_file_write_size    256k;
        }
}
</pre>
<p>Inicie o servidor Zabbix e os processos do agente e configure-os para que sejam iniciados durante o boot do sistema.</p>
<pre class="remontti-code"># systemctl enable zabbix-server zabbix-agent</pre>
<p><strong>Debian 10</strong></p>
<pre class="remontti-code"># systemctl restart zabbix-server zabbix-agent nginx php7.3-fpm</pre>
<p><strong>Debian 11</strong></p>
<pre class="remontti-code"># systemctl restart zabbix-server zabbix-agent nginx php7.4-fpm</pre>
<p>Acesse em seu navegador <strong>http://seu_ip:porta</strong> ou <strong>http://zabbix.seudominio.com.br</strong></p>
<p><strong>Next Step</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/1.png" alt="" width="1325" height="698" class="alignnone size-full wp-image-5519" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/1.png 1325w, https://blog.remontti.com.br/wp-content/uploads/2021/04/1-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/1-1024x539.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/1-768x405.png 768w" sizes="auto, (max-width: 1325px) 100vw, 1325px" /></p>
<p>Se tudo estiver ok: <strong>Next step</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2.png" alt="" width="1213" height="1224" class="aligncenter size-full wp-image-4359" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2.png 1213w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-297x300.png 297w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-1015x1024.png 1015w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-768x775.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-80x80.png 80w" sizes="auto, (max-width: 1213px) 100vw, 1213px" /></a></p>
<p>Selecione <strong>PostgreSQL</strong> e informe a <strong>senha do usuário zabbix </strong>criada anteriormente, clique em <strong>Next step</strong>.<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/3.png" alt="" width="1325" height="698" class="alignnone size-full wp-image-5520" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/3.png 1325w, https://blog.remontti.com.br/wp-content/uploads/2021/04/3-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/3-1024x539.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/3-768x405.png 768w" sizes="auto, (max-width: 1325px) 100vw, 1325px" /></p>
<p><strong>Next step</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4361" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p><strong>Next step</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/5.png" alt="" width="1325" height="698" class="alignnone size-full wp-image-5521" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/5.png 1325w, https://blog.remontti.com.br/wp-content/uploads/2021/04/5-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/5-1024x539.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/5-768x405.png 768w" sizes="auto, (max-width: 1325px) 100vw, 1325px" /></p>
<p><strong>Finish</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4363" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p>Entre com Usuário <strong>Admin</strong> e senha <strong>zabbix</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4364" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8.png" alt="" width="1401" height="1137" class="aligncenter size-full wp-image-4365" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8.png 1401w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8-300x243.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8-1024x831.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8-768x623.png 768w" sizes="auto, (max-width: 1401px) 100vw, 1401px" /></a></p>
<p>Para dexa-lo em Português / Tema escuro:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4388" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<hr>
<p><strong><font color="red">Possível bug na instalação</font></strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX.jpg" alt="" width="1264" height="446" class="alignnone size-full wp-image-5704" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX.jpg 1264w, https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX-300x106.jpg 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX-1024x361.jpg 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX-768x271.jpg 768w" sizes="auto, (max-width: 1264px) 100vw, 1264px" /><br />
Caso se deparar com essa tela não se assuste, faça o seguinte:</p>
<pre class="remontti-code"># touch /etc/zabbix/web/zabbix.conf.php
# chown www-data. /etc/zabbix/web/zabbix.conf.php</pre>
<p>De um [Back]  depois [Next] q é sucesso!</p>
<hr>
<h1>Alertas no Telegram</h1>
<p>No Zabbix 5 temos o Telegram/Webhook, então bora aprender mexer nisso! Mas antes de mais nada será necessário criarmos um bot no Telegram.</p>
<p><strong>Criando Bot no telegram</strong></p>
<p>Abra o Telegram e procure por <a href="https://t.me/BotFather" rel="noopener noreferrer" target="_blank"><strong>@BotFather</strong></a>.<br />
Inicie a conversa com ele.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2823" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2826" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2827" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>&#8211; Digite o comando <strong>/newbot</strong> para iniciar a criação de um novo bot.<br />
&#8211; Após o comando você vai dar um nome para seu bot. Ex.: <em>&#8220;Bot Legal RR&#8221;</em>.<br />
&#8211; Em seguida é necessário digitar o nome de usuário para o bot, sendo obrigatório terminar com <strong>bot</strong>. Ex.: <em>&#8220;legallrr_bot&#8221;</em>.<br />
&#8211; Ao finalizar você receber informações com seu TOKEN, que vamos utilizar em seguida.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2830" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2833" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2835" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Neste exemplo nosso token para acessar a API HTTP ficou:<br />
<strong>757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</strong></p>
<p>Agora que o token abra o menu <strong>Administração</strong> &#8211;> <strong>Tipos de mídias</strong></p>
<p>Localize o Telegram e clique nele<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1.png" alt="" width="1680" height="968" class="aligncenter size-full wp-image-4386" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-300x173.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-1024x590.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-768x443.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-1536x885.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Edite o ParseMode para HTML e Token para o token q você acabou de criar. Marque Process tags.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2.png" alt="" width="1680" height="885" class="aligncenter size-full wp-image-4387" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-1024x539.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-768x405.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-1536x809.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Neste momento que escrevo na própria descrição da mídia telegram ele recomenda você add o bot @myidbot para descobrir o seu ID, mas parace que este bot está &#8220;dormindo&#8221;. Vamos ao metodos tradicional. Você pode receber notificações direta do seu bot ou então adiciono-lo em um grupo. </p>
<p>Procure pelo seu bot e comece uma conversa com ele e envie uma mensagem de teste para o mesmo, pois vamos precisar descobrir o ID do seu usuário, para que ele possa lhe enviar as mensagens.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2837" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2838" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Abra em seu seu navegador a seguinte URL <em>https://api.telegram.org/bot<strong>TOKEN</strong>/getUpdates</em> para descobrir o ID do usuário que enviou a mensagem ou de um grupo.<br />
Ex.: <font size="2"><em>https://api.telegram.org/bot<strong><font color="red">757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</font></strong>/getUpdates</em></font></p>
<p><strong>:: Chat privado ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208620,&quot;message&quot;:{
		&quot;message_id&quot;:2,&quot;from&quot;:{&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:999999999,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;type&quot;:&quot;private&quot;},
		&quot;date&quot;:1541210279,&quot;text&quot;:&quot;Testando&quot;
	}
}]}</pre>
<p>ID do chat privado: <strong>999999999</strong></p>
<p>Se desejar criar um grupo também, basta adicionar seu bot a ele, após adiciona-lo envia uma mensagem como <strong>/teste</strong> para que possamos coletar o ID do grupo.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2843" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2844" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p><strong>:: Chat em Grupo ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208622,&quot;message&quot;:{&quot;message_id&quot;:4,&quot;from&quot;:{
		&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:-88888888888,&quot;title&quot;:&quot;Grupo Legal&quot;,&quot;type&quot;:&quot;group&quot;,&quot;all_members_are_administrators&quot;:true
	},&quot;date&quot;:1541210975,&quot;text&quot;:&quot;/teste&quot;,&quot;entities&quot;:[{&quot;offset&quot;:0,&quot;length&quot;:6,&quot;type&quot;:&quot;bot_command&quot;}
}]}</pre>
<p>ID do chat grupo: <strong>-88888888888</strong></p>
<p>Atenção para os <strong>grupos</strong> que sempre tem um sinal &#8220;-&#8221; na frente do ID.</p>
<p>Com o ID do grupo/usuário precisamos vincular ao usuário do Zabbix (Neste caso Admin)<br />
<strong>Administração</strong> ⇒ <strong>Usuários</strong> Clique no usuário <strong>Admin</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3.png" alt="" width="1680" height="541" class="aligncenter size-full wp-image-4389" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-300x97.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-1024x330.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-768x247.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-1536x495.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Com as opções do usuário aberto clique na aba <strong>Mídia</strong> em seguita clique no <strong>Adicionar</strong>, selecione o Tipo Telegram e insira o em Enviar para o ID.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5.png" alt="" width="1680" height="624" class="aligncenter size-full wp-image-4390" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-300x111.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-1024x380.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-768x285.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-1536x571.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a> </p>
<p>Atualize<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6.png" alt="" width="1680" height="269" class="aligncenter size-full wp-image-4391" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-300x48.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-1024x164.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-768x123.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-1536x246.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Agora vamos criar a ação que fará o envios dos alertas.<br />
<strong>Configurações</strong> ⇒ <strong>Ações</strong> ⇒ <strong>Criar ação</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7.png" alt="" width="1680" height="495" class="aligncenter size-full wp-image-4392" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-300x88.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-1024x302.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-768x226.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-1536x453.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>De um nome para sua ação<br />
Em Condição clique em adicionar: Selecione <strong>Incidente suprimido</strong> e marque <strong>Não</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8.png" alt="" width="1680" height="527" class="aligncenter size-full wp-image-4393" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-300x94.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-1024x321.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-768x241.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-1536x482.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Na aba <strong>Operações</strong> primeiro item <strong>Operações</strong> clique em <strong>adicionar</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9.png" alt="" width="1680" height="470" class="aligncenter size-full wp-image-4394" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-300x84.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-1024x286.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-768x215.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-1536x430.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><strong>Enviar para usuário</strong>: Selecione o <strong>Admin</strong><br />
Enviar apenas para: <strong>Telegram</strong><br />
Marque <strong>Custom message</strong>, preencha com:<br />
<strong>Assunto</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Problema: &lt;b&gt;{HOST.NAME}&lt;/b&gt;</pre>
<p><strong>Mensagem</strong></p>
<pre class="remontti-code">&lt;code&gt;{EVENT.NAME}&lt;/code&gt;
&lt;b&gt;{ITEM.NAME1}&lt;/b&gt; &lt;i&gt;{ITEM.VALUE1}&lt;/i&gt;

Tempo do evento: {EVENT.AGE} 
&lt;a href=&quot;{HOST.IP}&quot;&gt;{HOST.IP}&lt;/a&gt;
&lt;i&gt;{EVENT.SEVERITY}&lt;/i&gt;</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4395" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>No item <strong>Operações de recuperação</strong> faremos praticamente o mesmo:</p>
<p><strong>Assunto</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Resolvido: &lt;b&gt;{HOST.NAME}&lt;/b&gt;</pre>
<p><strong>Mensagem padrão</strong></p>
<pre class="remontti-code">&lt;code&gt;{EVENT.NAME}&lt;/code&gt;
&lt;b&gt;{ITEM.NAME1}&lt;/b&gt; &lt;i&gt;{ITEM.VALUE1}&lt;/i&gt;

Tempo do evento: {EVENT.AGE} 
&lt;a href=&quot;{HOST.IP}&quot;&gt;{HOST.IP}&lt;/a&gt;
&lt;i&gt;{EVENT.SEVERITY}&lt;/i&gt;
ID&#039;s: {ITEM.ID}/{EVENT.ID}</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4396" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>No item <strong>Operações de atualização</strong><br />
<strong>Assunto</strong>:</p>
<pre class="remontti-code">Problema atualizado: {EVENT.NAME}</pre>
<p><strong>Mensagem padrão</strong></p>
<pre class="remontti-code">{USER.FULLNAME} {EVENT.UPDATE.ACTION} problema em {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}
O status atual do problema é {EVENT.STATUS}, reconhecido: {EVENT.ACK.STATUS}.</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4397" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Operações configurada, clique em atualizar.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13.png" alt="" width="1680" height="544" class="aligncenter size-full wp-image-4398" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-300x97.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-1024x332.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-768x249.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-1536x497.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Pronto! Agora precisamos gerar um incidente para ver se nosso alerta será enviado para o Telegram.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-576x1024.png" alt="" width="576" height="1024" class="alignnone size-large wp-image-3080" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-576x1024.png 576w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-169x300.png 169w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14.png 720w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p>O sistema de envio de mensagem está concluído! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h1>Grafana v7/v8</h1>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana.png" alt="" width="1680" height="1050" class="aligncenter size-full wp-image-4367" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-300x188.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1024x640.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1536x960.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><br />
Pacotes necessários:</p>
<pre class="remontti-code"># apt install gnupg2 apt-transport-https software-properties-common wget</pre>
<p><strong>Para versão 7.5.x:</strong> (Não recomendado)</p>
<pre class="remontti-code"># cd /tmp/
# wget https://dl.grafana.com/oss/release/grafana_7.5.11_amd64.deb
# apt install ./grafana_7.5.11_amd64.deb
# grafana-cli plugins update-all
# systemctl restart grafana-server</pre>
<p><strong>Para versão 8.2.x:</strong> (Não recomendado)</p>
<pre class="remontti-code"># cd /tmp/
# wget https://dl.grafana.com/oss/release/grafana_8.2.7_amd64.deb
# apt install ./grafana_8.2.7_amd64.deb
# grafana-cli plugins update-all
# systemctl restart grafana-server</pre>
<p>Outras versões consulte <a href="https://grafana.com/grafana/download?edition=oss" rel="noopener" target="_blank">https://grafana.com/grafana/download?edition=oss</a></p>
<p><strong>Para Ultima versão v8.X:</strong> (Recomendado)<br />
Vamos baixar a key do repositório e adiciona-lo </p>
<pre class="remontti-code"># wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -
# echo &quot;deb https://packages.grafana.com/oss/deb stable main&quot; | tee -a /etc/apt/sources.list.d/grafana.list</pre>
<p>Atualize o repositório e instale o grafana</p>
<pre class="remontti-code"># apt update
# apt install grafana</pre>
<p>Antes de iniciar o grafana, se deseja alterar a porta padrão <strong>3000</strong> (recomendo) edite:</p>
<pre class="remontti-code"># vim /etc/grafana/grafana.ini</pre>
<p>Localize <strong>http_port</strong> e defina a porta de sua escolha.</p>
<pre class="remontti-code"># The http port  to use
;http_port = 3000</pre>
<p>Exemplo:</p>
<pre class="remontti-code">http_port = 53000</pre>
<p>Instale o <strong>Plugin Zabbix</strong></p>
<pre class="remontti-code"># grafana-cli plugins install alexanderzobnin-zabbix-app</pre>
<p>É recomendado que mensalmente você faça atualizações dos plugins instalados, com o comando:</p>
<pre class="remontti-code"># grafana-cli plugins update-all</pre>
<p>Agora sim colocamos o Grafana para iniciar junto com a inicialização, ativamos e inicializamos o serviço:</p>
<pre class="remontti-code"># systemctl daemon-reload
# systemctl enable grafana-server
# systemctl start grafana-server</pre>
<p>Acesse em seu navegador <strong>http://IP_URL:3000</strong> ou pela porta que você alterou. O nome de usuário padrão é admin e a senha padrão é admin.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1.png" alt="" width="1370" height="781" class="aligncenter size-full wp-image-4368" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1-300x171.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1-1024x584.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1-768x438.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Ao fazer login pela primeira vez, você será solicitado a alterar sua senha.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2.png" alt="" width="1370" height="732" class="aligncenter size-full wp-image-4369" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2-300x160.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2-1024x547.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2-768x410.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Uhull <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3.png" alt="" width="1370" height="720" class="aligncenter size-full wp-image-4370" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3-1024x538.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3-768x404.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<h4>Integração do grafana com o Zabbix</h4>
<p>Acesse o Configuration &#8211;> Plugins:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7.png" alt="" width="1366" height="633" class="aligncenter size-full wp-image-4374" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7.png 1366w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7-300x139.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7-1024x475.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7-768x356.png 768w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></a></p>
<p>Localize o Zabbix e clique no mesmo<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5.png" alt="" width="1370" height="688" class="aligncenter size-full wp-image-4372" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5-300x151.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5-1024x514.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5-768x386.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Agora ative clicando em <strong>Enable</strong>.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6.png" alt="" width="1370" height="688" class="aligncenter size-full wp-image-4373" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6-300x151.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6-1024x514.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6-768x386.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Volte em Configuration &#8211;> Data Sources<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8.png" alt="" width="1366" height="633" class="aligncenter size-full wp-image-4375" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8.png 1366w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8-300x139.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8-1024x475.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8-768x356.png 768w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></a></p>
<p>Clique em <strong>Add data source</strong>.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9.png" alt="" width="1370" height="639" class="aligncenter size-full wp-image-4376" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9-300x140.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9-1024x478.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9-768x358.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Uma nova tela com varias fontes, localize Zabbix e clique em <strong>Select</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10.png" data-rel="lightbox-gallery-nf4b1LFE" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10.png" alt="" width="1370" height="639" class="aligncenter size-full wp-image-4377" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10-300x140.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10-1024x478.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10-768x358.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Nas opções <strong>HTTP</strong> em <strong>URL</strong> informe o endereço do seu servidor Zabbix <strong>http://IP_URL/api_jsonrpc.php</strong>. Em <strong>Access</strong> selecione <strong>Browser</strong>. Em <strong>Zabbix API details</strong> informe seu usuário e senha do Zabbix e selecione a versão correspondente.<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-a.png" alt="" width="1043" height="1384" class="alignnone size-full wp-image-5524" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-a.png 1043w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-a-226x300.png 226w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-a-772x1024.png 772w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-a-768x1019.png 768w" sizes="auto, (max-width: 1043px) 100vw, 1043px" /></p>
<p>Role até o final e e clique em <strong>Save &#038; Test</strong> Se tudo ocorreu bem uma altera positivo com<strong>&#8220;Zabbix API version: 5.x.x&#8221;</strong> aparecerá.</p>
<p>Você pode também pode fazer uma conexão PostgreSQL com o banco de dados do zabbix, para tornar as coisas mais rápidas. Para isso basta &#8220;Add data source&#8221; pesquisar por PostgreSQL, então basta informa nome do banco, usuário e senha.<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-b.png" alt="" width="1043" height="1320" class="alignnone size-full wp-image-5525" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-b.png 1043w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-b-237x300.png 237w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-b-809x1024.png 809w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-b-768x972.png 768w" sizes="auto, (max-width: 1043px) 100vw, 1043px" /></p>
<p>Vá para as configurações do data source do zabbix, localize <strong>Direct DB Connection</strong>, ative-o e selecione <strong>PostgreSQL</strong>.<br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-c.png" alt="" width="1040" height="501" class="alignnone size-full wp-image-5526" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-c.png 1040w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-c-300x145.png 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-c-1024x493.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/graf-c-768x370.png 768w" sizes="auto, (max-width: 1040px) 100vw, 1040px" /></p>
<p>Agora vem a parte mais &#8220;chata/legal&#8221; que é você montar seus gráficos, como isso é algo bem peculiar de cada um, o intuito aqui era ensinar instalar. Recomendo a leitura de <a href="https://alexanderzobnin.github.io/grafana-zabbix/guides/gettingstarted/" rel="noopener noreferrer" target="_blank">Introdução ao Grafana-Zabbix</a> do autor do plugin.</p>
<h3>Bônus &#8211; Proxy Nginx grafana</h3>
<pre class="remontti-code"># vim /etc/nginx/sites-available/grafana.conf</pre>
<p>Adicione:</p>
<pre class="remontti-code">server {
    listen 80;
    listen [::]:80;

    server_name grafana.remontti.com.br;
  
    location / {
        proxy_pass http://localhost:53000;
        proxy_set_header   Host $host;
    }
}</pre>
<p>Cria o link para sites-enabled em seguida verifique as configurações e reinicie o serviço.</p>
<pre class="remontti-code"># ln -s /etc/nginx/sites-available/grafana.conf /etc/nginx/sites-enabled/
# nginx -t
# systemctl restart nginx</pre>
<p>Simples né? Gostou e quer me ajudar? <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p>Fontes:<br />
https://www.zabbix.com/download<br />
https://www.zabbix.com/documentation/<br />
https://grafana.com/docs/grafana/latest/installation/debian/<br />
https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app<br />
https://alexanderzobnin.github.io/grafana-zabbix/configuration/<br />
https://core.telegram.org/bots</p>
<p>O post <a href="https://blog.remontti.com.br/5517">Instalação do Zabbix 5 LTS + Grafana 7/8 + NGINX + PostgreSQL + Notificação Telegram com Debian 10/11</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/5517/feed</wfw:commentRss>
			<slash:comments>28</slash:comments>
		
		
			</item>
		<item>
		<title>Criando backups de forma simples e enviando para o Telegram ou servidor via SSH</title>
		<link>https://blog.remontti.com.br/4791</link>
					<comments>https://blog.remontti.com.br/4791#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Thu, 13 Aug 2020 22:29:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshpass]]></category>
		<category><![CDATA[telegram]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=4791</guid>

					<description><![CDATA[<p>Vamos aprender a criar scripts simples para fazer backups que podem ser úteis no nosso dia dia, vamos enviar eles para um servidor ou no telegram que aceita arquivos de até 2Gb #chupawhatsapp Criando&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/4791">Criando backups de forma simples e enviando para o Telegram ou servidor via SSH</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/08/capa-backup-shell-script.png" alt="" width="720" height="340" class="alignnone size-full wp-image-4833" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/08/capa-backup-shell-script.png 720w, https://blog.remontti.com.br/wp-content/uploads/2020/08/capa-backup-shell-script-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/08/capa-backup-shell-script-520x245.png 520w" sizes="auto, (max-width: 720px) 100vw, 720px" /><br />
Vamos aprender a criar scripts simples para fazer backups que podem ser úteis no nosso dia dia, vamos enviar eles para um servidor ou no telegram que aceita arquivos de até 2Gb #chupawhatsapp</p>
<p><strong>Criando Bot no telegram</strong></p>
<p>Abra o Telegram e procure por <a href="https://t.me/BotFather" rel="noopener noreferrer" target="_blank"><strong>@BotFather</strong></a>.<br />
Inicie a conversa com ele.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2823" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2826" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2827" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>&#8211; Digite o comando <strong>/newbot</strong> para iniciar a criação de um novo bot.<br />
&#8211; Após o comando você vai dar um nome para seu bot. Ex.: <em>&#8220;Bot Legal RR&#8221;</em>.<br />
&#8211; Em seguida é necessário digitar o nome de usuário para o bot, sendo obrigatório terminar com <strong>bot</strong>. Ex.: <em>&#8220;legallrr_bot&#8221;</em>.<br />
&#8211; Ao finalizar você receber informações com seu TOKEN, que vamos utilizar em seguida.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2830" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2833" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2835" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Neste exemplo nosso token para acessar a API HTTP ficou:<br />
<strong>757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</strong></p>
<p>Procure pelo seu bot e comece uma conversa com ele e envie uma mensagem de teste para o mesmo, pois vamos precisar descobrir o ID do seu usuário, para que ele possa lhe enviar as mensagens.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2837" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2838" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Abra em seu seu navegador a seguinte URL <em>https://api.telegram.org/bot<strong>TOKEN</strong>/getUpdates</em> para descobrir o ID do usuário que enviou a mensagem ou de um grupo.<br />
Ex.: <font size="2"><em>https://api.telegram.org/bot<strong><font color="red">757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</font></strong>/getUpdates</em></font></p>
<p><strong>:: Chat privado ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208620,&quot;message&quot;:{
		&quot;message_id&quot;:2,&quot;from&quot;:{&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:999999999,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;type&quot;:&quot;private&quot;},
		&quot;date&quot;:1541210279,&quot;text&quot;:&quot;Testando&quot;
	}
}]}</pre>
<p>ID do chat privado: <strong>999999999</strong></p>
<p>Se desejar criar um grupo também, basta adicionar seu bot a ele, após adiciona-lo envia uma mensagem como <strong>/teste</strong> para que possamos coletar o ID do grupo.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2843" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg" data-rel="lightbox-gallery-7JUoyGGM" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2844" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p><strong>:: Chat em Grupo ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208622,&quot;message&quot;:{&quot;message_id&quot;:4,&quot;from&quot;:{
		&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:-1000000000000,&quot;title&quot;:&quot;Grupo Legal&quot;,&quot;type&quot;:&quot;group&quot;,&quot;all_members_are_administrators&quot;:true
	},&quot;date&quot;:1541210975,&quot;text&quot;:&quot;/teste&quot;,&quot;entities&quot;:[{&quot;offset&quot;:0,&quot;length&quot;:6,&quot;type&quot;:&quot;bot_command&quot;}
}]}</pre>
<p>ID do chat grupo: <strong>-1000000000000</strong></p>
<p>Agora que já temos o Token e o ID do chat/grupo vamos ao script de backup. Se ainda estiver com dificuldade no <a href="https://www.youtube.com/watch?v=-ylbrUyNRZE" rel="noopener noreferrer" target="_blank">vídeo onde ensino integrar com o zabbix</a> aos 52 min explico como criar o bot.</p>
<p>Não esqueça q para o bot enviar algo para você é necessários iniciar uma conversa com o mesmo.<br />
Antes faça um teste abrindo no seu navegador <em>https://api.telegram.org/botTOKEN/sendMessage?chat_id=ID&#038;text=Mensagem</em> ou diretamente pelo terminal com curl.</p>
<pre class="remontti-code"># apt install curl </pre>
<p>Ex.: Enviando mensagem para um usuário</p>
<pre class="remontti-code"># curl --silent -X POST \
 --data-urlencode &quot;chat_id=8888888&quot; \
 --data-urlencode &quot;text=Enviando para usuário&quot; \
 &quot;https://api.telegram.org/bot757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0/sendMessage&quot;</pre>
<p>Ex.: Enviando mensagem para um grupo (Não torne o grupo público para sua segurança)</p>
<pre class="remontti-code"># curl --silent -X POST \
 --data-urlencode &quot;chat_id=-1000000000000&quot; \
 --data-urlencode &quot;text=Enviando para o Grupo&quot; \
 &quot;https://api.telegram.org/bot757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0/sendMessage&quot;</pre>
<p>Se as mensagens chegaram estamos preparados para fazer nossos backups com o telegram.</p>
<hr>
<h3>Scripts</h3>
<p>Pacotes requeridos:</p>
<pre class="remontti-code"># apt install curl wget zip unzip</pre>
<p>Para ficar algo organizado vou criar uma pasta onde colocarei todos os scripts</p>
<pre class="remontti-code"># mkdir /etc/backups/</pre>
<p>Como normalmente eu uso o telegram mesmo que seja apenas para notificar que um backup foi feto, vou criar uma pasta chamada para fazer toda a configuração do bot nela, criei um novo script com base no <a href="https://github.com/remontti/TelegramCMD" target="_blank" rel="noopener noreferrer">código</a> que utilizei no tutorial do <a href="https://blog.remontti.com.br/3981" rel="noopener noreferrer" target="_blank">Fastnetmon</a>, assim toda vez que for chamar telegram para enviar mensagem ou arquivo basta executa-lo sem sofrimero e varias linhas. Bora prepara-ló! </p>
<h3>Preparando o script do telegram (bot)</h3>
<pre class="remontti-code"># wget https://raw.githubusercontent.com/remontti/telegramBotShell/master/telegram -O /bin/telegram
# chmod +x /bin/telegram</pre>
<p>Alterando o TOKEN:</p>
<pre class="remontti-code"># vim /bin/telegram</pre>
<p>Altere o TOKEN e o formato da compactação (zip ou tar)<br />
Altere o token:</p>
<pre class="remontti-code">TOKEN=&quot;000000000:0000000000000-0000000000000000000000000000000&quot;</pre>
<p>Escolha o metodo de compactação tar/zip</p>
<pre class="remontti-code">COMPAC=&#039;tar&#039;</pre>
<p><strong>Como usar?</strong></p>
<p><strong>-m:</strong> Para enviar uma mensagem</p>
<pre class="remontti-code"># telegram -m &quot;-ID Chat&quot; &quot;Mensagem linha 1&quot; &quot;Mensagem linha 2&quot; &quot;Mensagem linha 3&quot;
# telegram -m &quot;ID Usuário&quot; &quot;Mensagem linha 1&quot; &quot;Mensagem linha 2&quot; &quot;Mensagem linha 3&quot;</pre>
<p><strong>-f:</strong> Para enviar um arquivo</p>
<pre class="remontti-code"># telegram -f &quot;-100000000&quot; &quot;/diretorio/arquivo&quot; &quot;nome do arquivo compactado&quot; &quot;Comentário&quot;
# telegram -f &quot;12345689&quot; &quot;/var/log/syslog&quot; &quot;syslog&quot; &quot;Logs do sistema&quot;</pre>
<p>Faça seu testes! Vale lembrar que toda vez que o script do telegram envia um arquivo ele irá compactar e remover este arquivo do servidor após envio.</p>
<h3>Preparando o script para envido do backup via SSH</h3>
<pre class="remontti-code">
# apt install sshpass
# wget https://raw.githubusercontent.com/remontti/backupSSH/master/backup -O /bin/backup
# chmod +x /bin/backup</pre>
<p><strong>Como usar?</strong><br />
Ex.:</p>
<pre class="remontti-code"># backup &quot;nome para o arquivo&quot; &quot;diretório ou diretórios a salvar&quot;  &quot;usuário ssh&quot; &quot;senha ssh&quot; &quot;IP Serv&quot; &quot;Porta ssh&quot; &quot;diretorio de destino&quot;
# backup &quot;etc&quot; &quot;/etc/*&quot;  &quot;jose&quot; &quot;123456&quot; &quot;192.168.0.200&quot; &quot;22&quot; &quot;/home/jose/backup&quot;</pre>
<hr>
<h3>Backups Telegram</h3>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de um diretório</h4>
<p>Vamos imaginar que gostaríamos de salvar o diretório /etc/frr/*</p>
<pre class="remontti-code"># vim /etc/backups/backup_frr_telegram.sh</pre>
<p>Adicionaremos apenas o ID usuário ou grupo (lembre-se que grupo sempre tem um &#8220;-&#8221; antes do ID) ex:</p>
<pre class="remontti-code">#!/bin/bash
/bin/telegram -f &quot;200000000&quot; &quot;/etc/frr/*&quot; &quot;frr&quot; &quot;Backup FRR&quot;</pre>
<p>De permissão para execução: </p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_frr_telegram.sh</pre>
<p>Basta rodar agora o script </p>
<pre class="remontti-code"># /etc/backups/backup_frr_telegram.sh</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/08/backup_frr_telegram.png" alt="" width="329" height="106" class="alignnone size-full wp-image-4812" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/08/backup_frr_telegram.png 329w, https://blog.remontti.com.br/wp-content/uploads/2020/08/backup_frr_telegram-300x97.png 300w" sizes="auto, (max-width: 329px) 100vw, 329px" /></p>
<p>Já já vamos ver como adiciona-lo no CRON (Agenda) para tornar isso automático. </p>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de múltiplos diretórios</h4>
<p>Vamos imaginar que gostaríamos de salvar todos os diretórios do bind9, para isso basta adicionar todos os diretórios/arquivos entre aspas <em>&#8220;/etc/bind/* /usr/share/dns/* /var/cache/bind/*&#8221; </em></p>
<pre class="remontti-code"># vim /etc/backups/backup_bind_telegram.sh</pre>
<p>Altere o ID usuário/grupo (lembre-se que grupo sempre tem um &#8220;-&#8221; antes do ID) ex:</p>
<pre class="remontti-code">#!/bin/bash
/bin/telegram -f &quot;200000000&quot; &quot;/etc/bind/* /usr/share/dns/* /var/cache/bind/*&quot; &quot;ns1&quot; &quot;Backup Bind&quot;</pre>
<p>De permissão para execução: </p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_bind_telegram.sh</pre>
<p>Basta rodar agora o script </p>
<pre class="remontti-code"># /etc/backups/backup_bind_telegram.sh</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de um banco de dados Mysql/MariaDB</h4>
<p>Neste exemplo vamos fazer backup do banco de dados <strong>&#8220;radius&#8221;</strong>. Altere as variáveis informando usuário/senha do seu banco de dados bem como nome do banco e ID do telegram.</p>
<pre class="remontti-code">#!/bin/bash
# Autor: remontti.com.br
# --------------------------------------
# USUARIO  DO BANCO DE DADOS
USER_DB=&#039;root&#039;
# SENHA DO BANCO DE DADOS
SENHA_DB=&#039;senha&#039;
# NOME DO BANCO DE DADOS
NOME_BANCO=&#039;radius&#039;
# NOME PARA O BACKUP
NOME_DO_BKP=&#039;Freeradius&#039;
# ID TELEGRAM
ID_TELEGRAM=&#039;-123456789000&#039;
# --------------------------------------
DATABKP=`date +%Y-%m-%d`
NOME_BD=&quot;/tmp/${NOME_BANCO}.${DATABKP}.tar.gz&quot;
mysqldump -h 127.0.0.1 -u ${USER_DB} -p${SENHA_DB} -B ${NOME_BANCO} &gt; /tmp/${NOME_BANCO}.${DATABKP}.sql 
/bin/telegram -f &quot;${ID_TELEGRAM}&quot; &quot;/tmp/${NOME_BANCO}.${DATABKP}.sql&quot; &quot;${NOME_DO_BKP}&quot; &quot;${NOME_BANCO}&quot; &amp;&gt;/dev/null
rm -f /tmp/*.sql &amp;&gt;/dev/null</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de &#8220;todos&#8221; os banco de dados Mysql/MariaDB</h4>
<p>Neste exemplo vamos fazer backup de &#8220;todos&#8221; os bancos de dados do servidor.<br />
Perceba que o comando: </p>
<pre class="remontti-code"># ls -d /var/lib/mysql/*/ |cut -d / -f 5</pre>
<p>Listará todas as bases, porém o com &#8220;grep -v&#8221; ignoro alguns bancos que não acho necessário.</p>
<pre class="remontti-code"># ls -d /var/lib/mysql/*/ |cut -d / -f 5 |grep -v mysql |grep -v performance_schema</pre>
<p>Altere as variáveis informando usuário/senha do seu banco de dados bem como ID do telegram.</p>
<pre class="remontti-code">#!/bin/bash
# Autor: remontti.com.br
# --------------------------------------
# USUARIO  DO BANCO DE DADOS
USER_DB=&#039;root&#039;
# SENHA DO BANCO DE DADOS
SENHA_DB=&#039;senha&#039;
# NOME PARA O BACKUP
NOME_DO_BKP=&#039;ServidorWeb&#039;
# ID TELEGRAM
ID_TELEGRAM=&#039;-123456789000&#039;
# --------------------------------------

for BANCO in `ls -d /var/lib/mysql/*/ |cut -d / -f 5 |grep -v mysql |grep -v performance_schema`
do
    DATABKP=`date +%Y-%m-%d`
    NOME_BD=&quot;/tmp/${BANCO}.${DATABKP}.tar.gz&quot;
    mysqldump -h 127.0.0.1 -u ${USER_DB} -p${SENHA_DB} -B ${BANCO} &gt; /tmp/${BANCO}.${DATABKP}.sql 
done;
/bin/telegram -f &quot;${ID_TELEGRAM}&quot; &quot;/tmp/*.sql&quot; &quot;${NOME_DO_BKP}&quot; &quot;Backup BDs&quot; 
rm -f /tmp/*.sql &amp;&gt;/dev/null</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup do Zabbix-Server (Apenas do que interessa)</h4>
<p>Para o backup do zabbix utilizo um script do <a href="https://github.com/maxhq/zabbix-backup">maxhq</a> que faz um dump apenas da parte da base que nos interessa, isso significa que você não terá salvo o historio das &#8220;coisa&#8221;! Porém realizei um <a href="https://github.com/remontti/zabbix-backup" rel="noopener" target="_blank">fork</a> do projeto qual fiz alguns ajustes para dar suporte ao zabbix 5.<br />
Vamos baixa-lo em nosso diretório:</p>
<pre class="remontti-code"># cd /etc/backups/ 
# wget https://raw.githubusercontent.com/remontti/zabbix-backup/master/zabbix-dump
# chmod +x /etc/backups/zabbix-dump</pre>
<p>Crie seu script</p>
<pre class="remontti-code"># vim /etc/backups/backup_zbx.sh</pre>
<pre class="remontti-code">#!/bin/bash
# ----Config ----
ID_TELEGRAM=&#039;-123456789000&#039;
# ---------------
/etc/backups/zabbix-dump -o /tmp &amp;&gt;/dev/null
/bin/telegram -f &quot;${ID_TELEGRAM}&quot; &quot;/tmp/zabbix_cfg*.gz&quot; &quot;zabbix&quot; &quot;Backup Bind&quot;
rm -f /tmp/*.gz</pre>
<p>Permissões:</p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_zbx.sh</pre>
<p>Execute:</p>
<pre class="remontti-code"># /etc/backups/backup_zbx.sh</pre>
<hr>
<h3>Backups SSH</h3>
<hr>
<p>Neste caso tenho o um servidor que irá receber nossos backups, sendo:</p>
<pre class="remontti-code-plain">IP: 172.16.0.100 
Porta SSH: 60321
Usuários: jose
Senha: 123456
Diretório onde ficará os backups: /home/jose/backup/</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de um diretório</h4>
<p>Vamos fazer o mesmo backup que fizemos anterior do &#8220;/etc/frr/*&#8221;.</p>
<pre class="remontti-code"># vim /etc/backups/backup_frr_ssh.sh</pre>
<pre class="remontti-code">#!/bin/bash
# /bin/backup &quot;todo_etc&quot; &quot;/etc/*&quot; &quot;jose&quot; &quot;123456&quot; &quot;172.16.0.100&quot; &quot;60321&quot; &quot;/home/jose/backup&quot;</pre>
<p>Permissão: </p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_frr_ssh.sh</pre>
<p>Execute:</p>
<pre class="remontti-code"># /etc/backups/backup_frr_ssh.sh</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de múltiplos diretórios</h4>
<p>Ex backup DNS bind9</p>
<pre class="remontti-code"># vim /etc/backups/backup_bind_ssh.sh</pre>
<pre class="remontti-code">#!/bin/bash
# /bin/backup &quot;ns1_dns&quot; &quot;/etc/bind/* /usr/share/dns/* /var/cache/bind/*&quot; &quot;jose&quot; &quot;123456&quot; &quot;172.16.0.100&quot; &quot;60321&quot; &quot;/home/jose/backup&quot;</pre>
<p>Permissão: </p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_bind_ssh.sh</pre>
<p>Execute:</p>
<pre class="remontti-code"># /etc/backups/backup_bind_ssh.sh</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de um banco de dados Mysql/MariaDB</h4>
<pre class="remontti-code"># vim /etc/backups/backup_bd_ssh.sh</pre>
<pre class="remontti-code">#!/bin/bash
# Autor: remontti.com.br
# --------------------------------------
# USUARIO  DO BANCO DE DADOS
USER_DB=&#039;root&#039;
# SENHA DO BANCO DE DADOS
SENHA_DB=&#039;senha&#039;
# NOME DO BANCO DE DADOS
NOME_BANCO=&#039;radius&#039;
# NOME PARA O BACKUP
NOME_DO_BKP=&#039;Freeradius&#039;
# ID TELEGRAM
ID_TELEGRAM=&#039;-123456789000&#039;
#----Servidor que recebe o Backup ------
# Usuários SSH
USER_SSH=&#039;jose&#039;
# Senha SSH
PASS_SSH=&#039;senha&#039;
# Porta SSH
PORT_SSH=&#039;22&#039;
# Diretório onde ira salvar
DIR_SSH=&#039;/home/jose/backup&#039;
# IP do servidor 
IP_SSH=&#039;172.16.0.100&#039;
# --------------------------------------
DATABKP=`date +%Y-%m-%d`
NOME_BD=&quot;/tmp/${NOME_BANCO}.${DATABKP}.tar.gz&quot;
mysqldump -h 127.0.0.1 -u ${USER_DB} -p${SENHA_DB} -B ${NOME_BANCO} &gt; /tmp/${NOME_BANCO}.${DATABKP}.sql 
backup &quot;${NOME_DO_BKP}&quot; &quot;/tmp/${NOME_BANCO}.${DATABKP}.sql&quot; &quot;${USER_SSH}&quot; &quot;${PASS_SSH}&quot; &quot;${IP_SSH}&quot; &quot;${PORT_SSH}&quot; &quot;${DIR_SSH}&quot;
rm -f /tmp/*.sql &amp;&gt;/dev/null</pre>
<p>Permissão: </p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_bd_ssh.sh</pre>
<p>Execute:</p>
<pre class="remontti-code"># /etc/backups/backup_bd_ssh.sh</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup de &#8220;todos&#8221; os banco de dados Mysql/MariaDB</h4>
<pre class="remontti-code"># vim /etc/backups/backup_bdall_ssh.sh</pre>
<pre class="remontti-code">#!/bin/bash
# Autor: remontti.com.br
# --------------------------------------
# USUARIO  DO BANCO DE DADOS
USER_DB=&#039;root&#039;
# SENHA DO BANCO DE DADOS
SENHA_DB=&#039;senha&#039;
# NOME PARA O BACKUP
NOME_DO_BKP=&#039;ServidorWeb&#039;
# ID TELEGRAM
ID_TELEGRAM=&#039;-123456789000&#039;
#----Servidor que recebe o Backup ------
# Usuários SSH
USER_SSH=&#039;jose&#039;
# Senha SSH
PASS_SSH=&#039;senha&#039;
# Porta SSH
PORT_SSH=&#039;22&#039;
# Diretório onde ira salvar
DIR_SSH=&#039;/home/jose/backup&#039;
# IP do servidor 
IP_SSH=&#039;172.16.0.100&#039;
# --------------------------------------
 
for BANCO in `ls -d /var/lib/mysql/*/ |cut -d / -f 5 |grep -v mysql |grep -v performance_schema`
do
    DATABKP=`date +%Y-%m-%d`
    NOME_BD=&quot;/tmp/${BANCO}.${DATABKP}.tar.gz&quot;
    mysqldump -h 127.0.0.1 -u ${USER_DB} -p${SENHA_DB} -B ${BANCO} &gt; /tmp/${BANCO}.${DATABKP}.sql 
done;
backup &quot;${NOME_DO_BKP}&quot; &quot;/tmp/*.sql&quot; &quot;${USER_SSH}&quot; &quot;${PASS_SSH}&quot; &quot;${IP_SSH}&quot; &quot;${PORT_SSH}&quot; &quot;${DIR_SSH}&quot;
rm -f /tmp/*.sql &amp;&gt;/dev/null</pre>
<p>Permissão: </p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_bdall_ssh.sh</pre>
<p>Execute:</p>
<pre class="remontti-code"># /etc/backups/backup_bdall_ssh.sh</pre>
<hr>
<h4><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2665.png" alt="♥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Backup do Zabbix-Server (Apenas do que interessa)</h4>
<p>Para o backup do zabbix utilizo um script do <a href="https://github.com/maxhq/zabbix-backup">maxhq</a> que faz um dump apenas da parte da base que nos interessa, isso significa que você não terá salvo o historio das &#8220;coisa&#8221;! Porém realizei um <a href="https://github.com/remontti/zabbix-backup" rel="noopener" target="_blank">fork</a> do projeto qual fiz alguns ajustes para dar suporte ao zabbix 5.<br />
Vamos baixa-lo em nosso diretório:</p>
<pre class="remontti-code"># cd /etc/backups/ 
# wget https://raw.githubusercontent.com/remontti/zabbix-backup/master/zabbix-dump
chmod +x /etc/backups/zabbix-dump</pre>
<p>Crie seu script</p>
<pre class="remontti-code"># vim /etc/backups/backup_zbx_ssh.sh</pre>
<pre class="remontti-code">#!/bin/bash
# Autor: remontti.com.br
#----Servidor que recebe o Backup ------
# Usuários SSH
USER_SSH=&#039;jose&#039;
# Senha SSH
PASS_SSH=&#039;senha&#039;
# Porta SSH
PORT_SSH=&#039;22&#039;
# Diretório onde ira salvar
DIR_SSH=&#039;/home/jose/backup&#039;
# IP do servidor 
IP_SSH=&#039;172.16.0.100&#039;
# --------------------------------------
/etc/backups/zabbix-dump  -o /tmp &amp;&gt;/dev/null
backup &quot;zabbix&quot; &quot;/tmp/zabbix_cfg*.gz&quot; &quot;${USER_SSH}&quot; &quot;${PASS_SSH}&quot; &quot;${IP_SSH}&quot; &quot;${PORT_SSH}&quot; &quot;${DIR_SSH}&quot;
rm -f /tmp/*.gz</pre>
<p>Permissões:</p>
<pre class="remontti-code"># chmod +x /etc/backups/backup_zbx_ssh.sh</pre>
<p>Execute:</p>
<pre class="remontti-code"># /etc/backups/backup_zbx_ssh.sh</pre>
<hr>
<p>Bom com base nesses scripts e um pouco de imaginação acredito que você vai conseguir fazer muita coisa, mas como automatizar? Veremos isso agora!</p>
<h3>Agendando o backup (Cron)</h3>
<p>Vamos agendar nosso(s) scripts para serem feitos em algumas situações:</p>
<p>Execute o comando crontab -e.</p>
<pre class="remontti-code"># crontab -e</pre>
<p>A primeira vez que você rodar o comando será solicitado qual editor você deseja, vou selecionar o nano &#8220;1&#8221; (ou apenas de Enter) por ser o mais fácil. Vale a leitura também: <a href="https://blog.remontti.com.br/90" rel="noopener noreferrer" target="_blank">Agendamento CRON / CRONTAB</a> e <a href="https://help.ubuntu.com/community/CronHowto" rel="noopener noreferrer" target="_blank">CronHowto</a></p>
<pre class="remontti-code">Select an editor.  To change later, run &#039;select-editor&#039;.
  1. /bin/nano        &lt;---- easiest
  2. /usr/bin/vim.basic
  3. /usr/bin/vim.tiny

Choose 1-3 [1]: 1 [ENTER]</pre>
<p>Você precisa entender a ordem dos valores interpretado pelo cron:</p>
<pre class="remontti-code"># m h  dom mon dow   command
# * *  *   *   *     comando
# | |  |   |   |     |_ _ _ _ Comando a ser executado
# | |  |   |   |_ _ _ _ _ _ _ Semana (0-7 - domingo à domingo)
# | |  |   |_ _ _ _ _ _ _ _ _ Mês (01-12)
# | |  |_ _ _ _ _ _ _ _ _ _ _ Dia (01-31)
# | |_ _ _ _ _ _ _ _ _ _ _ _ _Hora (00-23)
# |_ _ _ _ _ _ _ _ _ _ _ _ _ _Minuto (00-59)
</pre>
<h5>Alguns exemplos</h5>
<p>Executar um backup todos os dias às 20h e 30min:</p>
<pre class="remontti-code">30 20  *   *   *     /etc/backups/backup_script.sh</pre>
<p>Todo dia primeiro do mês às 00h e 45min:</p>
<pre class="remontti-code">45 00  1   *   *     /etc/backups/backup_script.sh</pre>
<p>Toda segunda-feira às 04h:</p>
<pre class="remontti-code">00 04  *   1   *     /etc/backups/backup_script.sh</pre>
<p>Curtiu o conteúdo? Quer me ajudar? <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Participe do canal no <a href="https://t.me/blogremontti" rel="noopener noreferrer" target="_blank">telegram</a> para ficar atualizado sempre que publicar um novo tutorial. </p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p>O post <a href="https://blog.remontti.com.br/4791">Criando backups de forma simples e enviando para o Telegram ou servidor via SSH</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/4791/feed</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Instalação do Zabbix 5.0 LTS + notificações pelo Telegram nativo + Grafana 7/8 + Debian 10/11</title>
		<link>https://blog.remontti.com.br/4348</link>
					<comments>https://blog.remontti.com.br/4348#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Fri, 22 May 2020 03:21:04 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian10 buste]]></category>
		<category><![CDATA[grafana]]></category>
		<category><![CDATA[grafana7]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[webhook]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix5]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=4348</guid>

					<description><![CDATA[<p>Aqui está o nosso kit de primeiros socorros! 😀 O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/4348">Instalação do Zabbix 5.0 LTS + notificações pelo Telegram nativo + Grafana 7/8 + Debian 10/11</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Aqui está o nosso kit de primeiros socorros! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-grafana-telegram.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-grafana-telegram.png" alt="" width="719" height="341" class="aligncenter size-full wp-image-4402" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-grafana-telegram.png 719w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-grafana-telegram-300x142.png 300w" sizes="auto, (max-width: 719px) 100vw, 719px" /></a><br />
O <strong>Zabbix</strong> é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível de notificação que permite configurar alertas por e-mail entre outros como Telegram, para praticamente qualquer evento. As notificações permitem que se reaja rapidamente à problemas no ambiente. O Zabbix oferece excelentes recursos de relatórios e visualização de dados armazenados. Isso faz com que o Zabbix seja a ferramenta ideal para planejamento de capacidade.</p>
<p>O <strong>Grafana</strong> é um software livre que permite a visualização de formato de dados métricos. Ele permite criar painéis e gráficos a partir de várias fontes, mas aqui iremos vamos aprender a integra-lo com o Zabbix.</p>
<h4>Este tutorial está também disponível no youtube:</h4>
<div class="video-container"><iframe loading="lazy" title="Instalação do Zabbix 5 + notificações pelo Telegram nativo + Grafana 7 + Debian 10 Buster" width="500" height="375" src="https://www.youtube.com/embed/-ylbrUyNRZE?feature=oembed&#038;wmode=opaque" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
<h4>Requisitos:</h4>
<p><a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">* Debian 10 (Buster) -> Instalação Limpa</a><br />
<a href="https://blog.remontti.com.br/3006" rel="noopener noreferrer" target="_blank">* Passo-a-passo como criar um servidor WEB Apache + PHP + MariaDB + phpMyAdmin no Debian 10 Buster &#8220;LAMP&#8221;</a> (Opcional phpMyAdmin)</p>
<h1>Zabbix</h1>
<p>Para instalação do Zabbix vamos incluir o repositório do oficial do Zabbix.</p>
<pre class="remontti-code"># su -
# cd /tmp
# apt install wget</pre>
<p><strong>Debian 10</strong></p>
<pre class="remontti-code"># wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb
# dpkg -i zabbix-release_5.0-1+buster_all.deb</pre>
<p><strong>Debian 11</strong></p>
<pre class="remontti-code"># wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+bullseye_all.deb
# dpkg -i zabbix-release_5.0-1+bullseye_all.deb</pre>
<p>Atualize o repositório e realize a instalação </p>
<pre class="remontti-code"># apt update ; apt upgrade
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent</pre>
<p>Vamos criar uma base de dados chamada <strong>zabbix</strong> e um usuário também chamado de zabbix no MariaDB.<br />
Não esqueça de alterar a senha: Use o gerador de senha: <a href="https://senhasegura.remontti.com.br/" rel="noopener noreferrer" target="_blank">https://senhasegura.remontti.com.br/</a></p>
<pre class="remontti-code"># mariadb -u root -p</pre>
<p>Senha</p>
<pre class="remontti-code">create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by &#039;SUA_SENHA&#039;;
grant all privileges on zabbix.* to zabbix@localhost;
quit;</pre>
<p>Importe o esquema de tabelas e dados padrões. (Demora um pouco!)</p>
<pre class="remontti-code"># zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mariadb -uzabbix -p zabbix</pre>
<p>Digite a senha de seu usuário zabbix criada no passo anterior para importar as tabelas.</p>
<p>Edite o arquivo zabbix_server.conf para informar os dados para conexão com o MySQL.</p>
<pre class="remontti-code"># vim /etc/zabbix/zabbix_server.conf</pre>
<p>Procure por <strong># DBPassword=</strong> descomente e sete sua senha.</p>
<pre class="remontti-code">#...
DBPassword=SUA_SENHA
#...</pre>
<p>Ajuste o <a href="https://secure.php.net/manual/pt_BR/timezones.america.php" rel="noopener noreferrer" target="_blank">timezone</a> pela sua região</a>.</p>
<pre class="remontti-code"># vim /etc/zabbix/apache.conf</pre>
<p>Este é modelo padrão, altere então para sua região, também irei alterar alguns valores padrões se quiser pode remover as conf do mod_php5.c </p>
<p>Se você quiser um modelo para acessa-lo por ex: zabbix.remontti.com.br, vou deixar um em seguida como proceder, bem como fechar o acesso apenas a determinado IP ou bloco.</p>
<pre class="remontti-code"># Define /zabbix alias, this is the default
&lt;IfModule mod_alias.c&gt;
    Alias /zabbix /usr/share/zabbix
&lt;/IfModule&gt;

&lt;Directory &quot;/usr/share/zabbix&quot;&gt;
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

    &lt;IfModule mod_php5.c&gt;
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        # php_value date.timezone Europe/Rig
    &lt;/IfModule&gt;
    &lt;IfModule mod_php7.c&gt;
        php_value max_execution_time 300
        php_value memory_limit 512M
        php_value post_max_size 48M
        php_value upload_max_filesize 24M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        php_value date.timezone America/Sao_Paulo
    &lt;/IfModule&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/conf&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/app&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/include&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/local&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;</pre>
<p>Caso você queira o modelo acima então mova o /etc/zabbix/apache.conf para /etc/zabbix/apache.conf.old. Faça uma apontamento em seu DNS do subdomínio zabbix para o IP do seu servidor. Agora crie um novo arquivo:</p>
<pre class="remontti-code"># mv /etc/zabbix/apache.conf /etc/zabbix/apache.conf.default
# vim /etc/zabbix/apache.conf</pre>
<p>Altere em <strong>Require ip</strong> para os ips que terão acesso.</p>
<pre class="remontti-code">&lt;VirtualHost *:80&gt;
        ServerName zabbix.remontti.com.br
        ServerAlias localhost
        ServerAdmin noc@remontti.com.br
        DocumentRoot /usr/share/zabbix
        ErrorDocument 403 http://www.remontti.com.br
        &lt;Directory &quot;/usr/share/zabbix&quot;&gt;
            Options FollowSymLinks
            AllowOverride all
            Require ip 127.0.0.1 ::1 200.200.200.0/26 2001:db8::/32 192.168.0.0/16

            &lt;IfModule mod_php7.c&gt;
                php_value max_execution_time 300
                php_value memory_limit 512M
                php_value post_max_size 48M
                php_value upload_max_filesize 24M
                php_value max_input_time 300
                php_value max_input_vars 10000
                php_value always_populate_raw_post_data -1
                php_value date.timezone America/Sao_Paulo
            &lt;/IfModule&gt;
        &lt;/Directory&gt;

        &lt;Directory &quot;/usr/share/zabbix/conf&quot;&gt;
            Order deny,allow
            Deny from all
            &lt;files *.php&gt;
                Order deny,allow
                Deny from all
            &lt;/files&gt;
        &lt;/Directory&gt;

        &lt;Directory &quot;/usr/share/zabbix/app&quot;&gt;
            Order deny,allow
            Deny from all
            &lt;files *.php&gt;
                Order deny,allow
                Deny from all
            &lt;/files&gt;
        &lt;/Directory&gt;

        &lt;Directory &quot;/usr/share/zabbix/include&quot;&gt;
            Order deny,allow
            Deny from all
            &lt;files *.php&gt;
                Order deny,allow
                Deny from all
            &lt;/files&gt;
        &lt;/Directory&gt;

        &lt;Directory &quot;/usr/share/zabbix/local&quot;&gt;
            Order deny,allow
            Deny from all
            &lt;files *.php&gt;
                Order deny,allow
                Deny from all
            &lt;/files&gt;
        &lt;/Directory&gt;

        LogLevel warn

        ErrorLog ${APACHE_LOG_DIR}/zabbix_error.log
        CustomLog ${APACHE_LOG_DIR}/zabbix_access.log combined
&lt;/VirtualHost&gt;</pre>
<p>Por segurança recomendo remover a assinatura do servidor, evitando os &#8220;espertinhos&#8221;</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
 # sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<p>Ative a o serviço junto com a inicialização do sistema, e restarte os mesmos.</p>
<pre class="remontti-code"># systemctl enable zabbix-server zabbix-agent
# systemctl restart zabbix-server zabbix-agent apache2</pre>
<p>Acesse em seu navegador <strong>http://seu_ip/zabbix</strong> ou <strong>http://zabbix.seudominio.com.br</strong></p>
<p>Next Step<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-1.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-1.png" alt="" width="1220" height="734" class="aligncenter size-full wp-image-4358" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-1.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-1-300x180.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-1-1024x616.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-1-768x462.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p>Se tudo estiver ok: Next step<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2.png" alt="" width="1213" height="1224" class="aligncenter size-full wp-image-4359" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2.png 1213w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-297x300.png 297w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-1015x1024.png 1015w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-768x775.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-2-80x80.png 80w" sizes="auto, (max-width: 1213px) 100vw, 1213px" /></a></p>
<p>Informe a senha do banco de dados criada anteriormente para o zabbix, e clique em Next step.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-3.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-3.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4360" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-3.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-3-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-3-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-3-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p>Next step<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4361" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-4-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p>Next step<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-5.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-5.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4362" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-5.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-5-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-5-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-5-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p>Finish<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4363" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-6-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p>Entre com Usuário <strong>Admin</strong> e senha <strong>zabbix</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7.png" alt="" width="1220" height="685" class="aligncenter size-full wp-image-4364" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7.png 1220w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7-300x168.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7-1024x575.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-7-768x431.png 768w" sizes="auto, (max-width: 1220px) 100vw, 1220px" /></a></p>
<p>Ualaaa <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8.png" alt="" width="1401" height="1137" class="aligncenter size-full wp-image-4365" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8.png 1401w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8-300x243.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8-1024x831.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zb5-8-768x623.png 768w" sizes="auto, (max-width: 1401px) 100vw, 1401px" /></a></p>
<p>Para dexa-lo em Português / Tema escuro:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4388" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/zabbix-black-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<hr>
<p><strong>Possível bug na instalação</strong><br />
<img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX.jpg" alt="" width="1264" height="446" class="alignnone size-full wp-image-5704" srcset="https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX.jpg 1264w, https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX-300x106.jpg 300w, https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX-1024x361.jpg 1024w, https://blog.remontti.com.br/wp-content/uploads/2021/04/BUG_ZABBIX-768x271.jpg 768w" sizes="auto, (max-width: 1264px) 100vw, 1264px" /><br />
Caso se deparar com essa tela não se assuste, faça o seguinte:</p>
<pre class="remontti-code"># touch /etc/zabbix/web/zabbix.conf.php
# chown www-data. /etc/zabbix/web/zabbix.conf.php</pre>
<p>De um [Back]  depois [Next] q é sucesso!</p>
<hr>
<h1>Alertas no Telegram</h1>
<p>No Zabbix 5 temos o Telegram/Webhook, então bora aprender mexer nisso! Mas antes de mais nada será necessário criarmos um bot no Telegram.</p>
<p><strong>Criando Bot no telegram</strong></p>
<p>Abra o Telegram e procure por <a href="https://t.me/BotFather" rel="noopener noreferrer" target="_blank"><strong>@BotFather</strong></a>.<br />
Inicie a conversa com ele.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2823" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2826" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2827" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>&#8211; Digite o comando <strong>/newbot</strong> para iniciar a criação de um novo bot.<br />
&#8211; Após o comando você vai dar um nome para seu bot. Ex.: <em>&#8220;Bot Legal RR&#8221;</em>.<br />
&#8211; Em seguida é necessário digitar o nome de usuário para o bot, sendo obrigatório terminar com <strong>bot</strong>. Ex.: <em>&#8220;legallrr_bot&#8221;</em>.<br />
&#8211; Ao finalizar você receber informações com seu TOKEN, que vamos utilizar em seguida.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2830" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2833" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2835" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Neste exemplo nosso token para acessar a API HTTP ficou:<br />
<strong>757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</strong></p>
<p>Agora que o token abra o menu <strong>Administração</strong> &#8211;> <strong>Tipos de mídias</strong></p>
<p>Localize o Telegram e clique nele<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1.png" alt="" width="1680" height="968" class="aligncenter size-full wp-image-4386" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-300x173.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-1024x590.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-768x443.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-1-1536x885.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Edite o ParseMode para HTML e Token para o token q você acabou de criar. Marque Process tags.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2.png" alt="" width="1680" height="885" class="aligncenter size-full wp-image-4387" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-1024x539.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-768x405.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-2-1536x809.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Neste momento que escrevo na própria descrição da mídia telegram ele recomenda você add o bot @myidbot para descobrir o seu ID, mas parace que este bot está &#8220;dormindo&#8221;. Vamos ao metodos tradicional. Você pode receber notificações direta do seu bot ou então adiciono-lo em um grupo. </p>
<p>Procure pelo seu bot e comece uma conversa com ele e envie uma mensagem de teste para o mesmo, pois vamos precisar descobrir o ID do seu usuário, para que ele possa lhe enviar as mensagens.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2837" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2838" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Abra em seu seu navegador a seguinte URL <em>https://api.telegram.org/bot<strong>TOKEN</strong>/getUpdates</em> para descobrir o ID do usuário que enviou a mensagem ou de um grupo.<br />
Ex.: <font size="2"><em>https://api.telegram.org/bot<strong><font color="red">757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</font></strong>/getUpdates</em></font></p>
<p><strong>:: Chat privado ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208620,&quot;message&quot;:{
		&quot;message_id&quot;:2,&quot;from&quot;:{&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:999999999,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;type&quot;:&quot;private&quot;},
		&quot;date&quot;:1541210279,&quot;text&quot;:&quot;Testando&quot;
	}
}]}</pre>
<p>ID do chat privado: <strong>999999999</strong></p>
<p>Se desejar criar um grupo também, basta adicionar seu bot a ele, após adiciona-lo envia uma mensagem como <strong>/teste</strong> para que possamos coletar o ID do grupo.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2843" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2844" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p><strong>:: Chat em Grupo ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208622,&quot;message&quot;:{&quot;message_id&quot;:4,&quot;from&quot;:{
		&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:-88888888888,&quot;title&quot;:&quot;Grupo Legal&quot;,&quot;type&quot;:&quot;group&quot;,&quot;all_members_are_administrators&quot;:true
	},&quot;date&quot;:1541210975,&quot;text&quot;:&quot;/teste&quot;,&quot;entities&quot;:[{&quot;offset&quot;:0,&quot;length&quot;:6,&quot;type&quot;:&quot;bot_command&quot;}
}]}</pre>
<p>ID do chat grupo: <strong>-88888888888</strong></p>
<p>Atenção para os <strong>grupos</strong> que sempre tem um sinal &#8220;-&#8221; na frente do ID.</p>
<p>Com o ID do grupo/usuário precisamos vincular ao usuário do Zabbix (Neste caso Admin)<br />
<strong>Administração</strong> ⇒ <strong>Usuários</strong> Clique no usuário <strong>Admin</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3.png" alt="" width="1680" height="541" class="aligncenter size-full wp-image-4389" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-300x97.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-1024x330.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-768x247.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-3-1536x495.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Com as opções do usuário aberto clique na aba <strong>Mídia</strong> em seguita clique no <strong>Adicionar</strong>, selecione o Tipo Telegram e insira o em Enviar para o ID.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5.png" alt="" width="1680" height="624" class="aligncenter size-full wp-image-4390" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-300x111.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-1024x380.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-768x285.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-5-1536x571.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a> </p>
<p>Atualize<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6.png" alt="" width="1680" height="269" class="aligncenter size-full wp-image-4391" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-300x48.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-1024x164.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-768x123.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-6-1536x246.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Agora vamos criar a ação que fará o envios dos alertas.<br />
<strong>Configurações</strong> ⇒ <strong>Ações</strong> ⇒ <strong>Criar ação</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7.png" alt="" width="1680" height="495" class="aligncenter size-full wp-image-4392" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-300x88.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-1024x302.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-768x226.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-7-1536x453.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>De um nome para sua ação<br />
Em Condição clique em adicionar: Selecione <strong>Incidente suprimido</strong> e marque <strong>Não</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8.png" alt="" width="1680" height="527" class="aligncenter size-full wp-image-4393" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-300x94.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-1024x321.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-768x241.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-8-1536x482.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Na aba <strong>Operações</strong> primeiro item <strong>Operações</strong> clique em <strong>adicionar</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9.png" alt="" width="1680" height="470" class="aligncenter size-full wp-image-4394" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-300x84.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-1024x286.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-768x215.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-9-1536x430.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p><strong>Enviar para usuário</strong>: Selecione o <strong>Admin</strong><br />
Enviar apenas para: <strong>Telegram</strong><br />
Marque <strong>Custom message</strong>, preencha com:<br />
<strong>Assunto</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Problema: &lt;b&gt;{HOST.NAME}&lt;/b&gt;</pre>
<p><strong>Mensagem</strong></p>
<pre class="remontti-code">&lt;code&gt;{EVENT.NAME}&lt;/code&gt;
&lt;b&gt;{ITEM.NAME1}&lt;/b&gt; &lt;i&gt;{ITEM.VALUE1}&lt;/i&gt;

&lt;a href=&quot;{HOST.IP}&quot;&gt;{HOST.IP}&lt;/a&gt;
&lt;i&gt;{EVENT.SEVERITY}&lt;/i&gt;</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4395" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-10-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>No item <strong>Operações de recuperação</strong> faremos praticamente o mesmo:</p>
<p><strong>Assunto</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Resolvido: &lt;b&gt;{HOST.NAME}&lt;/b&gt;</pre>
<p><strong>Mensagem padrão</strong></p>
<pre class="remontti-code">&lt;code&gt;{EVENT.NAME}&lt;/code&gt;
&lt;b&gt;{ITEM.NAME1}&lt;/b&gt; &lt;i&gt;{ITEM.VALUE1}&lt;/i&gt;

&lt;a href=&quot;{HOST.IP}&quot;&gt;{HOST.IP}&lt;/a&gt;
&lt;i&gt;{EVENT.SEVERITY}&lt;/i&gt;</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4396" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-11-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>No item <strong>Operações de atualização</strong><br />
<strong>Assunto</strong>:</p>
<pre class="remontti-code">Problema atualizado: {EVENT.NAME}</pre>
<p><strong>Mensagem padrão</strong></p>
<pre class="remontti-code">{USER.FULLNAME} {EVENT.UPDATE.ACTION} problema em {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}
O status atual do problema é {EVENT.STATUS}, reconhecido: {EVENT.ACK.STATUS}.</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12.png" alt="" width="1680" height="836" class="aligncenter size-full wp-image-4397" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-300x149.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-1024x510.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-768x382.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-12-1536x764.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Operações configurada, clique em atualizar.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13.png" alt="" width="1680" height="544" class="aligncenter size-full wp-image-4398" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-300x97.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-1024x332.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-768x249.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/tele-13-1536x497.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Pronto! Agora precisamos gerar um incidente para ver se nosso alerta será enviado para o Telegram.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-576x1024.png" alt="" width="576" height="1024" class="alignnone size-large wp-image-3080" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-576x1024.png 576w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-169x300.png 169w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14.png 720w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p>O sistema de envio de mensagem está concluído! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h1>Grafana 7</h1>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana.png" alt="" width="1680" height="1050" class="aligncenter size-full wp-image-4367" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-300x188.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1024x640.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1536x960.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a></p>
<p>Pacotes necessários:</p>
<pre class="remontti-code"># apt install gnupg2 apt-transport-https software-properties-common</pre>
<p>Vamos baixar a key do repositório e adiciona-lo </p>
<pre class="remontti-code"># wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -
# echo &quot;deb https://packages.grafana.com/oss/deb stable main&quot; | tee -a /etc/apt/sources.list.d/grafana.list</pre>
<p>Atualize o repositório e instale o grafana</p>
<pre class="remontti-code"># apt update
# apt install grafana</pre>
<hr>
<p><strong>OBS Julho/2021: </strong><br />
Atualmente o grafana que está sendo instalado é a versão 8, o mesmo na data de hoje está passando por um <a href="https://github.com/alexanderzobnin/grafana-zabbix/issues/1221" rel="noopener" target="_blank">bug com o plugin do Zabbix</a> caso você queira instalar a ultima versão 7.x faça o seguinte:<br />
Solução fazer downgrade para última versão 7:</p>
<pre class="remontti-code"># vim /etc/apt/sources.list.d/grafana.list</pre>
<p>Comente a linha do repositório (quando o <a href="https://github.com/alexanderzobnin/grafana-zabbix/issues/1221" rel="noopener" target="_blank">bug</a> for corrigido você pode descomenta-la para fazer o upgrade para versão 8). </p>
<pre class="remontti-code">#deb https://packages.grafana.com/oss/deb stable main</pre>
<pre class="remontti-code"># apt update
# cd /tmp/
# wget https://dl.grafana.com/oss/release/grafana_7.5.9_amd64.deb
# apt install ./grafana_7.5.9_amd64.deb
# grafana-cli plugins update-all
# systemctl restart grafana-server</pre>
<hr>
<p>Antes de iniciar o grafana, se deseja alterar a porta padrão <strong>3000</strong> (recomendo) edite:</p>
<pre class="remontti-code"># vim /etc/grafana/grafana.ini</pre>
<p>Localize <strong>http_port</strong> e defina a porta de sua escolha.</p>
<pre class="remontti-code"># The http port  to use
;http_port = 3000</pre>
<p>Exemplo:</p>
<pre class="remontti-code">http_port = 53000</pre>
<p>Localize em [plugins] <strong>;allow_loading_unsigned_plugins</strong> descomente removendo o &#8220;;&#8221; e adicionando:</p>
<pre class="remontti-code">allow_loading_unsigned_plugins = alexanderzobnin-zabbix-datasource</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana7_zabbix.png" alt="" width="1451" height="155" class="alignnone size-full wp-image-5022" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana7_zabbix.png 1451w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana7_zabbix-300x32.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana7_zabbix-1024x109.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana7_zabbix-768x82.png 768w" sizes="auto, (max-width: 1451px) 100vw, 1451px" /><br />
Caso contrário o plugin de integração com o zabbix não irá funcionar.</p>
<p>Já instalamos também o plugin Zabbix com ferramenta grafana-cli:</p>
<pre class="remontti-code"># grafana-cli plugins install alexanderzobnin-zabbix-app</pre>
<p>É recomendado que mensalmente você faça atualizações dos plugins instalados, com o comando:</p>
<pre class="remontti-code"># grafana-cli plugins update-all</pre>
<p>Agora sim colocamos o Grafana para iniciar junto com a inicialização, ativamos e inicializamos o serviço:</p>
<pre class="remontti-code"># systemctl daemon-reload
# systemctl enable grafana-server
# systemctl start grafana-server</pre>
<p>Acesse em seu navegador <strong>http://IP_URL:3000</strong> ou pela porta que você alterou. O nome de usuário padrão é admin e a senha padrão é admin.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1.png" alt="" width="1370" height="781" class="aligncenter size-full wp-image-4368" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1-300x171.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1-1024x584.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-1-768x438.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Ao fazer login pela primeira vez, você será solicitado a alterar sua senha.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2.png" alt="" width="1370" height="732" class="aligncenter size-full wp-image-4369" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2-300x160.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2-1024x547.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-2-768x410.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Uhull <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3.png" alt="" width="1370" height="720" class="aligncenter size-full wp-image-4370" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3-300x158.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3-1024x538.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-3-768x404.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<h4>Integração do grafana com o Zabbix</h4>
<p>Acesse o Configuration &#8211;> Plugins:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7.png" alt="" width="1366" height="633" class="aligncenter size-full wp-image-4374" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7.png 1366w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7-300x139.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7-1024x475.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-7-768x356.png 768w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></a></p>
<p>Localize o Zabbix e clique no mesmo<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5.png" alt="" width="1370" height="688" class="aligncenter size-full wp-image-4372" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5-300x151.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5-1024x514.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-5-768x386.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Agora ative clicando em <strong>Enable</strong>.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6.png" alt="" width="1370" height="688" class="aligncenter size-full wp-image-4373" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6-300x151.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6-1024x514.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-6-768x386.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Volte em Configuration &#8211;> Data Sources<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8.png" alt="" width="1366" height="633" class="aligncenter size-full wp-image-4375" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8.png 1366w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8-300x139.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8-1024x475.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-8-768x356.png 768w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></a></p>
<p>Clique em <strong>Add data source</strong>.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9.png" alt="" width="1370" height="639" class="aligncenter size-full wp-image-4376" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9-300x140.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9-1024x478.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-9-768x358.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Uma nova tela com varias fontes, localize Zabbix e clique em <strong>Select</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10.png" alt="" width="1370" height="639" class="aligncenter size-full wp-image-4377" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10-300x140.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10-1024x478.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-10-768x358.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Nas opções <strong>HTTP</strong> em <strong>URL</strong> informe o endereço do seu servidor Zabbix <strong>http://IP_URL/zabbix/api_jsonrpc.php</strong>. Em <strong>Access</strong> selecione <strong>Browser</strong>. Em <strong>Zabbix API details</strong> informe seu usuário e senha do Zabbix e selecione a versão correspondente.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zb_conexao.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zb_conexao.png" alt="" width="641" height="840" class="alignnone size-full wp-image-4032" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zb_conexao.png 641w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zb_conexao-229x300.png 229w" sizes="auto, (max-width: 641px) 100vw, 641px" /></a></p>
<p>Role até o final e e clique em <strong>Save &#038; Test</strong> Se tudo ocorreu bem uma altera positivo com<strong>&#8220;Zabbix API version: 5.x.x&#8221;</strong> aparecerá.</p>
<p>Você pode também pode fazer uma conexão MySQL (MariaDB) com o banco de dados do zabbix, para tornar as coisas mais rápidas. Para isso basta &#8220;Add data source&#8221; pesquisar por mysql, e informar os dados de conexões, provavelmente seu grafana esteja junto com seu zabbix, então basta informa nome do banco, usuário e senha.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-12.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-12.png" alt="" width="1370" height="1180" class="aligncenter size-full wp-image-4378" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-12.png 1370w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-12-300x258.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-12-1024x882.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-12-768x661.png 768w" sizes="auto, (max-width: 1370px) 100vw, 1370px" /></a></p>
<p>Vá para as configurações do data source do zabbix, localize <strong>Direct DB Connection</strong>, ative-o e selecione <strong>MySQL</strong>.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-13.png" data-rel="lightbox-gallery-sxJHL9V4" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-13.png" alt="" width="1366" height="633" class="aligncenter size-full wp-image-4379" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-13.png 1366w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-13-300x139.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-13-1024x475.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/05/grafana-13-768x356.png 768w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></a></p>
<p>Agora vem a parte mais &#8220;chata/legal&#8221; que é você montar seus gráficos, como isso é algo bem peculiar de cada um, o intuito aqui era ensinar instalar. Recomendo a leitura de <a href="https://alexanderzobnin.github.io/grafana-zabbix/guides/gettingstarted/" rel="noopener noreferrer" target="_blank">Introdução ao Grafana-Zabbix</a> do autor do plugin.</p>
<p>Simples né? Gostou e quer me ajudar? <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<h3>Bônus &#8211; Proxy grafana</h3>
<pre class="remontti-code"># a2enmod rewrite
# a2enmod headers
# a2enmod proxy
# a2enmod proxy_http
# mkdir /var/www/grafana
</pre>
<pre class="remontti-code"># vim /etc/apache2/sites-available/grafana.conf</pre>
<pre class="remontti-code">&lt;VirtualHost *:80&gt;
	Protocols h2 http/1.1
	ServerName grafana.remontti.com.br
	ServerAdmin noc@remontti.com.br
	DocumentRoot /var/www/grafana

	ErrorDocument 403 http://www.remontti.com.br

	&lt;Directory /var/www/grafana/&gt;
		Options Indexes FollowSymLinks
		AllowOverride all
		Require ip 127.0.0.1 ::1 200.200.200.0/26 2001:db8:cafe::/48
	&lt;/Directory&gt;

	LogLevel warn

	ProxyPreserveHost On
	ProxyPass / http://localhost:53000/
	ProxyPassReverse / http://localhost:53000/

	ErrorLog ${APACHE_LOG_DIR}/grafana_error.log
	CustomLog ${APACHE_LOG_DIR}/grafana_access.log combined
	TransferLog ${APACHE_LOG_DIR}/grafana_access.log

&lt;/VirtualHost&gt;</pre>
<pre class="remontti-code"># a2ensite grafana
# systemctl restart apache2</pre>
<p>Fontes:<br />
https://www.zabbix.com/download<br />
https://www.zabbix.com/documentation/<br />
https://grafana.com/docs/grafana/latest/installation/debian/<br />
https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app<br />
https://alexanderzobnin.github.io/grafana-zabbix/configuration/<br />
https://core.telegram.org/bots</p>
<p>O post <a href="https://blog.remontti.com.br/4348">Instalação do Zabbix 5.0 LTS + notificações pelo Telegram nativo + Grafana 7/8 + Debian 10/11</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/4348/feed</wfw:commentRss>
			<slash:comments>71</slash:comments>
		
		
			</item>
		<item>
		<title>Instalação do Zabbix 4.4 no Debian 10 Buster</title>
		<link>https://blog.remontti.com.br/3995</link>
					<comments>https://blog.remontti.com.br/3995#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sat, 08 Feb 2020 18:30:27 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php7.3]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix 4.4]]></category>
		<category><![CDATA[zabbix-frontend-php]]></category>
		<category><![CDATA[zabbix4]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3995</guid>

					<description><![CDATA[<p>O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3995">Instalação do Zabbix 4.4 no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível de notificação que permite configurar alertas por e-mail entre outros como Telegram, para praticamente qualquer evento. As notificações permitem que se reaja rapidamente à problemas no ambiente. O Zabbix oferece excelentes recursos de relatórios e visualização de dados armazenados. Isso faz com que o Zabbix seja a ferramenta ideal para planejamento de capacidade.</p>
<p>Requisitos:<br />
<a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">* Debian 10 (Buster) -> Instalação Limpa</a><br />
<a href="https://blog.remontti.com.br/3006" rel="noopener noreferrer" target="_blank">* Passo-a-passo como criar um servidor WEB Apache + PHP + MariaDB + phpMyAdmin no Debian 10 Buster &#8220;LAMP&#8221;</a></p>
<p>Para instalação do Zabbix vamos incluir o repositório do oficial do Zabbix.</p>
<pre class="remontti-code"># su -
# cd /tmp</pre>
<p>Versão 4.4</strong></p>
<pre class="remontti-code"># wget https://repo.zabbix.com/zabbix/4.4/debian/pool/main/z/zabbix-release/zabbix-release_4.4-1+buster_all.deb
# dpkg -i zabbix-release_4.4-1+buster_all.deb</pre>
<p>Atualize o repositório e realize a instalação </p>
<pre class="remontti-code"># apt update ; apt upgrade
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent</pre>
<p>Vamos criar uma base de dados chamada <strong>zabbix</strong> e um usuário também chamado de zabbix no MariaDB.<br />
Não esqueça de alterar a senha: Use o gerador de senha: <a href="https://senhasegura.remontti.com.br/" rel="noopener noreferrer" target="_blank">https://senhasegura.remontti.com.br/</a></p>
<pre class="remontti-code"># mariadb -u root -p</pre>
<pre class="remontti-code">CREATE DATABASE zabbix CHARACTER SET utf8 collate utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY &#039;SUA_SENHA&#039;;
FLUSH PRIVILEGES;
EXIT;</pre>
<p>Importe o esquema de tabelas e dados padrões. (Demora um pouco!)</p>
<pre class="remontti-code"># zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix</pre>
<p>Digite a senha de seu usuário zabbix criada no passo anterior para importar as tabelas.</p>
<p>Edite o arquivo zabbix_server.conf para informar os dados para conexão com o MySQL.</p>
<pre class="remontti-code"># vim /etc/zabbix/zabbix_server.conf</pre>
<p>Procure por <strong># DBPassword=</strong> descomente e sete sua senha.</p>
<pre class="remontti-code">#...
DBPassword=SUA_SENHA
#...</pre>
<p>Parece que na versão 4.4 esqueceram do arquivo do apache (pelo menos até hj) então será necessário cria-lo.</p>
<pre class="remontti-code"># vim /etc/zabbix/apache.conf</pre>
<p>Ajuste o <a href="https://secure.php.net/manual/pt_BR/timezones.america.php" rel="noopener noreferrer" target="_blank">timezone</a> pela sua região</a>.</p>
<pre class="remontti-code">&lt;IfModule mod_alias.c&gt;
    Alias /zabbix /usr/share/zabbix
&lt;/IfModule&gt;

&lt;Directory &quot;/usr/share/zabbix&quot;&gt;
    Options FollowSymLinks
    AllowOverride None
   # Se quiser limitar apenas o acesso a alguns ips da rede
   # AllowOverride all
   # Require ip 127.0.0.1 ::1 200.200.200.192/29 2001:db8:bebe::/48

    &lt;IfModule mod_php7.c&gt;
        php_value max_execution_time 300
        php_value memory_limit 512M
        php_value post_max_size 100M
        php_value upload_max_filesize 80M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        php_value date.timezone America/Sao_Paulo
    &lt;/IfModule&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/conf&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/app&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/include&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;

&lt;Directory &quot;/usr/share/zabbix/local&quot;&gt;
    Order deny,allow
    Deny from all
    &lt;files *.php&gt;
        Order deny,allow
        Deny from all
    &lt;/files&gt;
&lt;/Directory&gt;
</pre>
<p>Por segurança recomendo remover a assinatura do servidor, evitando os &#8220;espertinhos&#8221;</p>
<pre class="remontti-code"># sed -i &#039;s/ServerTokens OS/ServerTokens Prod/&#039; /etc/apache2/conf-available/security.conf
# sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/conf-available/security.conf</pre>
<p>Lincamos as configurações e restartamos o apache.</p>
<pre class="remontti-code"># ln -s /etc/zabbix/apache.conf /etc/apache2/conf-available/zabbix.conf
# a2enconf zabbix 
# systemctl restart apache2</pre>
<p>Iniciando o Zabbix Server e Agente junto com a inicialização do sistema.</p>
<pre class="remontti-code"># systemctl enable zabbix-server zabbix-agent
# systemctl restart zabbix-server zabbix-agent</pre>
<p>Acesse em seu navegador http://seu_ip/zabbix</p>
<p>Next Step<br />
<div id="attachment_3999" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3999" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster.png" alt="" width="1680" height="875" class="size-full wp-image-3999" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-300x156.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-1024x533.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-768x400.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster-1536x800.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-3999" class="wp-caption-text">Next Step</p></div></p>
<p>Se tudo estiver ok: Next step<br />
<div id="attachment_4000" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4000" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check.png" alt="" width="1680" height="1316" class="size-full wp-image-4000" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-300x235.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-1024x802.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-768x602.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check-1536x1203.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4000" class="wp-caption-text">Se tudo estiver ok: Next step</p></div></p>
<p>Informe a senha do banco de dados criada anteriormente para o zabbix, e clique em Next step.<br />
<div id="attachment_4001" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4001" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1.png" alt="" width="1680" height="826" class="size-full wp-image-4001" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check1-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4001" class="wp-caption-text">Informe a senha do banco de dados criada anteriormente para o zabbix, e clique em Next step.</p></div></p>
<p>Next step<br />
<div id="attachment_4002" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4002" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2.png" alt="" width="1680" height="826" class="size-full wp-image-4002" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check2-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4002" class="wp-caption-text">Next step</p></div></p>
<p>Next step<br />
<div id="attachment_4003" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4003" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3.png" alt="" width="1680" height="826" class="size-full wp-image-4003" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check3-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4003" class="wp-caption-text">Next step</p></div></p>
<p>Next step<br />
<div id="attachment_4004" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4004" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4.png" alt="" width="1680" height="826" class="size-full wp-image-4004" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check4-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4004" class="wp-caption-text">Next step</p></div></p>
<p>Entre com Usuário <strong>Admin</strong> e senha <strong>zabbix</strong><br />
<div id="attachmeEntrecomUsurioAdminesenhaZabbixnt_4005" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachmeEntrecomUsurioAdminesenhaZabbixnt-4005" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5.png" alt="" width="1680" height="826" class="size-full wp-image-4005" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check5-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachmeEntrecomUsurioAdminesenhaZabbixnt-4005" class="wp-caption-text">Entre com Usuário Admin e senha zabbix</p></div></p>
<p>Para trocar o idioma para português, clique no ícone no canto direito superior no &#8220;bonequinho&#8221;<br />
<div id="attachment_4007" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4007" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6.png" alt="" width="1680" height="1199" class="size-full wp-image-4007" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-300x214.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-1024x731.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-768x548.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_check6-1536x1096.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4007" class="wp-caption-text">Para trocar o idioma para português, clique no ícone no canto direito superior no &#8220;bonequinho&#8221;</p></div></p>
<p>Selecione Português<br />
<div id="attachment_4008" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4008" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues.png" alt="" width="1680" height="826" class="size-full wp-image-4008" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-300x148.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-1024x503.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-768x378.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues-1536x755.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4008" class="wp-caption-text">Selecione Português</p></div></p>
<p>Seu Zabbix agora está em PT-BR<br />
<div id="attachment_4009" style="width: 1690px" class="wp-caption alignnone"><a href="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1.png" data-rel="lightbox-gallery-RjKaZV5h" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4009" src="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1.png" alt="" width="1680" height="1241" class="size-full wp-image-4009" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1.png 1680w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-300x222.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-1024x756.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-768x567.png 768w, https://blog.remontti.com.br/wp-content/uploads/2020/02/zabbix_4.4_debian_buster_portugues1-1536x1135.png 1536w" sizes="auto, (max-width: 1680px) 100vw, 1680px" /></a><p id="caption-attachment-4009" class="wp-caption-text">Seu Zabbix agora está em PT-BR</p></div></p>
<p>Você pode gostar de integra-lo com o telegram:<br />
<a href="https://blog.remontti.com.br/3053" rel="noopener noreferrer" target="_blank">Zabbix 4 + Alertas no Telegram via Bot</a><br />
<a href="https://blog.remontti.com.br/4014" rel="noopener noreferrer" target="_blank">Instalação do Grafana e integrando com Zabbix 4</a></p>
<h3>Script de Backup</h1>
<p><a href="https://github.com/remontti/zabbix-backup" rel="noopener noreferrer" target="_blank">https://github.com/remontti/zabbix-backup</a></p>
<p>Este script backup script tem suporte ao (MariadB/MySQL/PostgreSQL) e não salva o históricos, tornado um backup rápido e salvando somente o necessário. </p>
<p>Baixe o script (em um diretório de sua escolha)</p>
<pre class="remontti-code"># wget https://raw.githubusercontent.com/remontti/zabbix-backup/master/zabbix-dump</pre>
<p>De permissão de execução: </p>
<pre class="remontti-code"># chmod +x zabbix-dump</pre>
<p>Execute</p>
<pre class="remontti-code"># ./zabbix-dump</pre>
<p>Ele irá gerar um arquivo <strong>zabbix_cfg_localhost_202XXXXX-XXXX_db-mysql-4.x.x.sql.gz</strong> basta você copia-lo ou criar uma rotina que rode o script e envie para seu servidor de backup&#8230; (seja criativo) <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Gostou?</p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p>Fontes:<br />
<a href="https://www.zabbix.com/documentation/" rel="noopener noreferrer" target="_blank">https://www.zabbix.com/documentation/</a></p>
<p>O post <a href="https://blog.remontti.com.br/3995">Instalação do Zabbix 4.4 no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3995/feed</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title>Proteja-se de ataques DoS/DDoS mitigando com FastNetMon e anuncie os prefixos atacados (blackholes) para sua operadora, usando Mikrotik :-)</title>
		<link>https://blog.remontti.com.br/3981</link>
					<comments>https://blog.remontti.com.br/3981#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sat, 25 Jan 2020 02:28:33 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[ataques]]></category>
		<category><![CDATA[bgp]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debina 10]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[exabgp]]></category>
		<category><![CDATA[fastnetmon]]></category>
		<category><![CDATA[ibgp]]></category>
		<category><![CDATA[mitigação]]></category>
		<category><![CDATA[notificações]]></category>
		<category><![CDATA[proteção]]></category>
		<category><![CDATA[routeros]]></category>
		<category><![CDATA[telegram]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3981</guid>

					<description><![CDATA[<p>Existe um tutorial mais atualizado acesse: Fortalecendo a Resiliência da Rede: Detecção de Ataques DDoS com FastNetMon, FRRouting, Grafana e Implementação em Debian 12 com Huawei &#038; RouterOS 👆 👆 👆 👆 👆 👆&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3981">Proteja-se de ataques DoS/DDoS mitigando com FastNetMon e anuncie os prefixos atacados (blackholes) para sua operadora, usando Mikrotik :-)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><font color="red">Existe um tutorial mais atualizado acesse:</font></h2>
<p><a href="https://blog.remontti.com.br/7322">Fortalecendo a Resiliência da Rede: Detecção de Ataques DDoS com FastNetMon, FRRouting, Grafana e Implementação em Debian 12 com Huawei &#038; RouterOS</a><br />
 <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f446.png" alt="👆" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<pre class="remontti-code">#
#
#
#
#
#
#
#
</pre>
<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp.jpg" alt="" width="720" height="340" class="alignnone size-full wp-image-3991" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp.jpg 720w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp-300x142.jpg 300w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp-520x245.jpg 520w" sizes="auto, (max-width: 720px) 100vw, 720px" /></p>
<p>Neste tutorial vamos aprender como identificar os ataques Dos/DDoS e anunciar os prefixo atacados (ou atacantes) <strong>de seu AS</strong> em envia-los para uma blackhole, e repassar os mesmo para sua operadora. (Acordo)</p>
<p>Vamos utilizar o <a href="https://github.com/pavel-odintsov/fastnetmon/" rel="noopener noreferrer" target="_blank">FastNetMon</a> que é um analisador de carga DoS/DDoS de alto desempenho, construído sobre vários mecanismos de captura de pacotes (NetFlow, IPFIX, sFlow, AF_PACKET, SnabbSwitch, netmap, PF_RING, PCAP). </p>
<p>Farei a instalação do FastNetMon no Debian 10 (Instalação Limpa)</p>
<p>Você irá precisar configurar o envido dos Flows em seu roteador de bora. Vou deixar aqui um exemplo de como configurar com o routerOS/Mikrotik.</p>
<p><strong>Cenário Ex.:</strong><br />
AS &#8211; 15169<br />
172.31.31.1/30 &#8211; RouterOS/Mikrotik<br />
172.31.31.2/30 &#8211; Servidor FastNetMon<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp.png" data-rel="lightbox-gallery-vYF2aD2q" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp.png" alt="" width="1332" height="606" class="alignnone size-full wp-image-3984" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp.png 1332w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp-300x136.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp-1024x466.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_mikrotik_bgp-768x349.png 768w" sizes="auto, (max-width: 1332px) 100vw, 1332px" /></a></p>
<p>Ative o envido dos flows em seu routerOS/Mikrotik, selecionando as interfaces de entrada (WAN) ex suas operadoras, PTTs (No exemplo sfp1,VLAN.1234-PTT) <em>observe que não irei usar a porta padrão 2055 e sim 62055.</em></p>
<pre class="remontti-code">/ip traffic-flow set active-flow-timeout=1m cache-entries=4k enabled=yes interfaces=&quot;sfp1,VLAN.1234-PTT&quot;
/ip traffic-flow target add dst-address=172.31.31.2 port=62055</pre>
<h3>Instalação FastNetMon</h3>
<p>Antes de iniciar a instalação do seu do seu servidor em nosso exemplo estou usando o IP 172.31.31.2/30, porém eu NUCA recomendaria você fazer NAT em seu roteador de borda ainda mais ele sendo um Mikrotik, a performasse estaria comprometida, quem tem NAT estude de uma pesquisada sobrem IPv4 Fast Path,  IPv4 Fasttrack, Connection Tracking. Quando você compreender esses &#8220;caras&#8221; e aplicar dentro de sua rede, vai descobrir que o mikrotik não é tão ruim quanto falam por ai kkkkk. (Quem sabe um dia escrevo algo sobre), mas voltando&#8230; Porque utilizar o IP 172.31.31.2 então? Primeiramente por que ele não é acessível pelo mundo, logo não pode ser atacado, mas por outro lado se ele não tiver internet você não poderá por exemplo configurar para receber uma notificação (que neste tutorial vou explicar como fazer para enviar alertas no telegram) então como proceder, se você manja já deve ter pensado em uma solução. No meu caso eu sempre divido a a rede, o que é borda é borda, nunca ligo um servidor nela! O ideal é termos um router apenas para os servidores, ou então ligado quem sabe no concentrador de NAT, então nesse caso você pode fazer uma NAT para seu servidor, na pior das hipóteses use um ip válido. Você pode também fechar uma sessão <strong>multihop</strong>. Bom de seus pulos, ai já é engenharia de redes! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f61b.png" alt="😛" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>O pacote do fastnetmon já se encontra no repositório do debian, juntamente algumas pacotes extras que vamos utilizar em seguida.</p>
<pre class="remontti-code"># apt install fastnetmon zip curl wget python-pip socat -y</pre>
<p>Adicione todos os prefixos de se AS, são esses os IPs que ele fará analise. </p>
<pre class="remontti-code"># vim /etc/networks_list</pre>
<p>Exemplo</p>
<pre class="remontti-code">216.58.192.0/22
2800:3f0::/32</pre>
<p>Ajustes as configurações</p>
<pre class="remontti-code"># vim /etc/fastnetmon.conf</pre>
<p>Exlplicarei nos comentários</p>
<pre class="remontti-code"># Quantos pacotes serão coletados do tráfego de ataque
# Aumentamos para ter um log com mais informações
ban_details_records_count = 1000

# Defina por quanto tempo você irá ficar anunciando seu IP atacado a blackhole 
ban_time = 600

# Ative o rastreamento de conexão
enable_connection_tracking = on

# Ativaremos a detecção de ataques, por pacotes por/s, por limite de banda e pro flows.
ban_for_pps = on
ban_for_bandwidth = on
ban_for_flows = on

# Limites de pacotes
threshold_pps = 20000
# Limite de banda (Pode pegar como base o cliente/ plano com mair trafego 
# cuidado com ips de cgnat, eles terão bem mais consumo. 
threshold_mbps = 1000
# Limite por flows
threshold_flows = 3500

# Você pode desativar o sflow (Já que com RouterOS não vamos utiliza-lo)
sflow = off

# Ative o netflow
netflow = on

# Ative o exabgp (É com ele que vamos fechamos nosso per com a borda)
exabgp = on
# Defina para 60 o mesmo tempo setado la no Router (active-flow-timeout=1m)
average_calculation_time = 60

# Altere a porta para mesma que configuramos no Router
netflow_port = 62055

# Informe o IP da sua interface do servidor
exabgp_next_hop = 172.31.31.2

# Script que será executado sempre quer um banir/desbanir
notify_script_path = /usr/local/bin/notify_about_attack.sh</pre>
<p>O fastnetmon sempre que identificar um ataque irá executar <strong>notify_script_path</strong>, identificando o IP da sua rede que está sofrendo <strong>(incoming)</strong> o ataque ou que está cometendo <strong>(outgoing)</strong> o ataque. Ele <strong>NÃO</strong> irá identificar os IPs de origem. Em um futuro quando tivermos mais testes elaborados eu juntamente com o Gabriel Vargas Padilha estamos estudando os logs e através desses com um script (python) analisarmos a fundo vamos armazena-los em uma base de dados bem como identificar (porem no momento ainda tem falsos positivos), mas a ideia e saber a origem e através de um outro script notificar os IPs de origens enviando os logs para o dono do IP para que ele tome suas providencias, e por que não anunciar também nas blackholes.  </p>
<p>Criaremos então nosso arquivo chamado pelo opção &#8220;notify_script_path&#8221;, mas antes vamos criar um script para enviar notificações (mensagens) e arquivos pelo Telegram. Vai ser necessário criar um bot do telegram para o uso do mesmo. Se você não sabe como criar um Bot para telegram veja como fazer o mesmo no início do tutorial que já postei de como enviar alertas pelo zabbix, <a href="https://blog.remontti.com.br/3053" rel="noopener noreferrer" target="_blank">Zabbix 4.2 enviando alertas no Telegram via Bot (Debian 10)</a>, lá no ínico do tutorial explica como criar o bot, pegar o token e como descobrir o ID de um usuário ou grupo. </p>
<pre class="remontti-code"># cd /tmp/
# wget https://github.com/remontti/TelegramCMD/archive/master.zip
# unzip /tmp/master.zip
# chmod a+x /tmp/TelegramCMD-master/telegram
# mv /tmp/TelegramCMD-master/telegram* /usr/local/bin/</pre>
<p>Não esqueça de alterar o TOKEN para o do seu bot.</p>
<pre class="remontti-code"># vim /usr/local/bin/telegram.conf/token.conf</pre>
<pre class="remontti-code">######################################
# Telegram bot                       #
# Create a new bot with @BotFather   #
# get TOKEN                          #
######################################

TOKEN=&quot;000000000:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF&quot;</pre>
<p>Como usar? É importante você saber que o IDs de grupos tem um &#8220;-&#8221; no inicio do ID, já usuários direto não.</p>
<pre class="remontti-code">Uso: telegram [Opções]
  -m: Para enviar uma mensagem
     ex: telegram -m &quot;ID Chat&quot; &quot;Meu assunto&quot; &quot;Minha mensagem...&quot;
     ex: telegram -m &quot;-123456789&quot; &quot;Notificação&quot; &quot;Mensagem para um grupo ID&quot;
     ex: telegram -m &quot;123456789&quot; &quot;Notificação&quot; &quot;Mensagem para direta/privado&quot;

  -f: Para enviar um arquivo
     ex: telegram -f &quot;ID Chat&quot; &quot;/diretorio/arquivo&quot; &quot;nome do arquivo zip&quot; &quot;Comentário&quot;
     ex: telegram -f &quot;12345689&quot; /var/log/syslog syslog &quot;Logs do sistema para user privado&quot;</pre>
<p>     ex: telegram -f &#8220;-12345689&#8221; /var/log/syslog syslog &#8220;Logs do sistema para um grupo&#8221;</p>
<p>Bot funcionando, criamos então uma pasta onde os logs de ataques que terminaram vão ser movidos, e o script que será executado sempre que um ataque for identificado (BAN/UNBAN).</p>
<pre class="remontti-code"># mkdir /var/log/fastnetmon_attacks/ataques
# vim /usr/local/bin/notify_about_attack.sh</pre>
<pre class="remontti-code">
#!/usr/bin/env bash

# This script will get following params:
#  $1 client_ip_as_string
#  $2 data_direction
#  $3 pps_as_string
#  $4 action (ban or unban)

# Desbanindo um IP
if [ &quot;$4&quot; = &quot;unban&quot; ]; then
    /usr/local/bin/telegram -m &quot;-12345678&quot; &quot;UNBAN: $2 Ataque&quot; &quot;&lt;code&gt;IP $1&lt;/code&gt; removido da blackhole&quot;
    # Movemos os logs para pasta ataques pois não queremos mais receber elas.
    mv /var/log/fastnetmon_attacks/$1* /var/log/fastnetmon_attacks/ataques
    # Unban actions if used
    exit 0
fi

# Banindo
if [ &quot;$4&quot; = &quot;ban&quot; ]; then
    /usr/local/bin/telegram -m &quot;-12345678&quot; &quot;BAN: $2 ataque&quot; &quot;&lt;code&gt;IP $1&lt;/code&gt; prefixo anunciado a blackhole&quot;
    /usr/local/bin/telegram -f &quot;-12345678&quot; /var/log/fastnetmon_attacks/$1* $1 &quot;Logs do ataque ao IP $1&quot;
    exit 0
fi

if [ &quot;$4&quot; == &quot;attack_details&quot; ]; then    
    #/usr/local/bin/telegram -m &quot;-12345678&quot; &quot;BAN&quot; &quot;&lt;code&gt;FastNetMon: IP $1 blocked because $2 attack with power $3 pps&lt;/code&gt;&quot;
    exit 0
fi</pre>
<pre class="remontti-code"># chmod a+x /usr/local/bin/notify_about_attack.sh</pre>
<p>Restarte o fastnetmon</p>
<pre class="remontti-code"># systemctl restart fastnetmon</pre>
<h3>Instalação do exaBGP</h3>
<p>Iremos utilizar o <a href="https://github.com/Exa-Networks/exabgp" rel="noopener noreferrer" target="_blank">exaBGP</a> fechar nossa conexão BGP para realizar os anúncios dos prefixos atacados.</p>
<pre class="remontti-code"># pip install exabgp==3.4.20</pre>
<p>Configure o arquivo para fechar o peer.</p>
<pre class="remontti-code"># vim /etc/exabgp.conf</pre>
<pre class="remontti-code">group RouterBorda {
    hold-time 180;
    # AS do nosso ExaBGP (Pode deixar 65001)
    local-as 65001;
    # AS Remoto (Seu AS pois você vai estar fechando com seu roteador de borda)
    peer-as 15169;
    # ID do ExaBGP router (use o mesmo IP da sua placa de rede)
    router-id 172.31.31.2;
    graceful-restart 1200;
    # Remote peer
    neighbor 172.31.31.1 {
        # Endereço IP da interface desse servidor
        local-address 172.31.31.2;
        description &quot;ExaBGP&quot;;
        family {
            ipv4 unicast;
            ipv6 unicast;
        }
    }
    # Processo que vai receber as linhas de comandos para adicionar ou excluir uma prefixo
    process service-dynamic {
        run /usr/bin/socat stdout pipe:/var/run/exabgp.cmd;
    }
}</pre>
<p>Antes de iniciar o exaBGP você precisa criar um peer e alguns filtros em seu roteador de borda, no nosso exemplo routerOS/Mikrotik.</p>
<p><strong>Filtros</strong>:<br />
Crie um filtro de entrada que todas as rotas aprendida do fastnetmon seja setadas como blackhole, e não ensine nada para ele.</p>
<pre class="remontti-code">/routing filter
add action=accept chain=FastNetMon-IN set-type=blackhole
add action=discard chain=FastNetMon-OUT</pre>
<p><strong>Peer</strong>:<br />
Atenção para a <strong>instance</strong> que deve estar selecionada corretamente (use a mesma que você usa com sua operadora). Caso seu servidor não esteja com um conexão direta a borda poe usar multihop=<strong>yes</strong>, como comentado anteriormente.</p>
<pre class="remontti-code">/routing bgp peer
add name=FastNetMon instance=default remote-as=65001 multihop=no  \
 in-filter=FastNetMon-IN out-filter=FastNetMon-OUT \
 remote-address=172.31.31.2 update-source=172.31.31.1</pre>
<p>Para não ter que carregar na mão o exabgp, criaremos um script para inicialização do exaBGP automaticamente.</p>
<pre class="remontti-code"># vim /etc/init.d/exabgp </pre>
<pre class="remontti-code">#!/bin/bash
### BEGIN INIT INFO
# Provides:          exabgp
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
### END INIT INFO

VERMELHO=&#039;\033[1;31m&#039;
VERDE=&#039;\033[1;32m&#039;
NC=&#039;\033[0m&#039;

PROCESSO=$(ps -x |grep -v &quot;grep&quot; |grep -v &quot;/bin/bash&quot; |grep exabgp |wc -l); 

function startExaBGP(){
    if [  $PROCESSO -eq 0 ]
    then
        echo &quot;Iniciandos...&quot;;
        env exabgp.daemon.user=root \
          exabgp.daemon.daemonize=true \
          exabgp.daemon.pid=/var/run/exabgp.pid \
          exabgp.log.destination=/var/log/exabgp.log \
          exabgp /etc/exabgp.conf
        sleep 0.3
        echo -e &quot;ExaBGP [${VERDE} Iniciado ${NC}] &quot;;
    else
        echo -e &quot;ExaBGP já exstá em execuxão. [${VERDE} Ativo ${NC}] &quot;;
    fi
}
 
function stopExaBGP(){
    if [  $PROCESSO -eq 0 ]
    then
        echo -e &quot;ExaBGP não está sendo executado. [${VERMELHO} Parado ${NC}]&quot;;
        
    else 
        echo &quot;Parando...&quot;;
        kill -9 `cat /var/run/exabgp.pid` &amp;&gt;/dev/null
        echo -e &quot;ExaBGP [${VERMELHO} Parado ${NC}] &quot;;
    fi
}

function statusExaBGP(){
    if [  $PROCESSO -eq 0 ]
    then
        echo -e &quot;ExaBGP está [${VERMELHO} Parado ${NC}]&quot;;
    else 
        echo -e &quot;ExaBGP está [${VERDE} Ativo ${NC}]&quot;;
    fi
    echo 
    echo &quot;Logs:&quot;
    tail /var/log/exabgp.log
}

case &quot;$1&quot; in
    start )
        startExaBGP
        ;;
 
    stop )
        stopExaBGP
        ;;
 
    restart )
        stopExaBGP
        sleep 1
        startExaBGP
        ;;
 
    status )
        statusExaBGP      
        ;;
 
    * )
        echo &quot;Opção inválida, use start | stop | restart | status&quot;
        ;;
esac</pre>
<p>De permissão para execução</p>
<pre class="remontti-code"># chmod a+x /etc/init.d/exabgp</pre>
<p>Crie o arquivo de serviço para o programa exabgp.</p>
<pre class="remontti-code"># vim /lib/systemd/system/exabgp.service</pre>
<p>Adicione</p>
<pre class="remontti-code">[Unit]
Description=ExaBGP
After=network.target remote-fs.target

[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/etc/init.d/exabgp start
ExecStop=/etc/init.d/exabgp stop
ExecReload=/etc/init.d/exabgp restart
 
[Install]
WantedBy=multi-user.target</pre>
<p>Recarregue a nova definição do serviço:</p>
<pre class="remontti-code"># systemctl daemon-reload</pre>
<p>Ative o novo serviço, e verifique se o mesmo foi ativado</p>
<pre class="remontti-code"># systemctl enable exabgp
# systemctl list-unit-files | grep exabgp</pre>
<p>Reinicie seu servidor</p>
<pre class="remontti-code"># reboot</pre>
<p>Verifique se o exabgp foi carregado na inicialização, e seu peer estabilizou.</p>
<pre class="remontti-code"># systemctl status exabgp</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/12/exabgp_fastnetmon_mikrotik.png" data-rel="lightbox-gallery-vYF2aD2q" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/12/exabgp_fastnetmon_mikrotik.png" alt="" width="1639" height="381" class="alignnone size-full wp-image-3894" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/12/exabgp_fastnetmon_mikrotik.png 1639w, https://blog.remontti.com.br/wp-content/uploads/2019/12/exabgp_fastnetmon_mikrotik-300x70.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/12/exabgp_fastnetmon_mikrotik-1024x238.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/12/exabgp_fastnetmon_mikrotik-768x179.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/12/exabgp_fastnetmon_mikrotik-1536x357.png 1536w" sizes="auto, (max-width: 1639px) 100vw, 1639px" /></a></p>
<p>Para iniciar/reiniciar os exabgp pode usar os seguintes comandos:</p>
<pre class="remontti-code"># systemctl stop exabgp
# systemctl start exabgp
# systemctl restart exabgp</pre>
<p>Para acompanhar a coleta de flows use o comando:</p>
<pre class="remontti-code"># fastnetmon_client</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon.png" data-rel="lightbox-gallery-vYF2aD2q" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon.png" alt="" width="661" height="610" class="alignnone size-full wp-image-3986" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon.png 661w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon-300x277.png 300w" sizes="auto, (max-width: 661px) 100vw, 661px" /></a></p>
<p>Você vai encontrar tutoriais como integrar com grafana&#8230;. mas para mim isso é perfumaria, o mais legal é ver o processamento sem frescura, e saber que pode ser implementado com uma minimo de hardware, essa mesma analise de flows do gráfico assim que está na casa dos 3GBps de tráfego temos o seguinte uso do hasrdware:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_htop.png" data-rel="lightbox-gallery-vYF2aD2q" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_htop.png" alt="" width="1114" height="277" class="alignnone size-full wp-image-3987" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_htop.png 1114w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_htop-300x75.png 300w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_htop-1024x255.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2020/01/fastnetmon_htop-768x191.png 768w" sizes="auto, (max-width: 1114px) 100vw, 1114px" /></a></p>
<p>Se quiser fazer algum teste, para anunciar uma rotas manualmente user os seguintes comandos:</p>
<pre class="remontti-code"># echo &quot;announce route 100.101.255.200 next-hop 172.31.31.2 community 65001:666&quot; &gt; /var/run/exabgp.cmd</pre>
<p>E para remover:</p>
<pre class="remontti-code"># echo &quot;withdraw route 100.101.255.200 next-hop 172.31.31.2&quot;  &gt; /var/run/exabgp.cmd</pre>
<h3>Acordo de communities com sua operadora</h3>
<p>Não vai adiantar muito você identificar o IP que está tomando o ataque se você não repassar o mesmo para sua operadora e ela o mesmo. Como você identificou o IP que esta recebendo o ataque (ou ate mesmo atacando) o mesmos vai subir na sua tabela de rotas como tipo blackhole, logo seu roteador não vai mais responder para esse IP. <strong>Sim esse IP não terá mais internet </strong>(clientes, servidor&#8230;.) sim não terá! rsrs, por isso é importante receber o alerta, para saber qual medidas realizar. Nas configurações do fastnetmon existe um arquivo de <strong>lista branca /etc/networks_whitelist</strong> se desejar você pode incluir os IPs que não quer que o fastnetmon analise (logo não ira bani-lo) porém você também não vai saber se ele foi atacado, eu prefiro deixar esse networks_whitelist vazio e criar então um filtro no roteador para descartar os IPs que não quero que ele jogue na blackhole, assim eu sou notificado, e se o bicho realmente estiver pegando eu deixo passar o ip do servidor e penso no que vou fazer hehehe.</p>
<p>As grande operadoras normalmente tem uma politica de communities que aceita você repassar prefixos /32 com a communities onde em quase todos os casos é AS:666 ou 65xxx:666, então o que você precisa fazer é primeira mente entrar em contato com a mesma para pegar essas informações, caso ela não saiba do que você está falando manda esse o link  deste tutorial <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Bom, vamos imaginar que sua operadora senha o AS28146 (olha o marketing ai de graça/patrocina eu MH) e seu bloco seja 200.200.200.0/22, como ficaria seu filtro no seu MK? </p>
<pre class="remontti-code">/routing filter
add action=accept  chain=AS28146-IPv4-OUT bgp-communities=65001:666 prefix-length=32 set-bgp-communities=28146:666
add action=accept  chain=AS28146-IPv4-OUT prefix=45.189.228.0/22 prefix-length=22-23
add action=discard chain=AS28146-IPv4-OUT</pre>
<p>Explicando a primiera linha:<br />
<strong>action=accept</strong> &#8211;> aceita<br />
<strong>chain=AS28146-IPv4-OUT</strong> &#8211;> nome do seu filtro<br />
<strong>bgp-communities=65001:666</strong> -> todas as rotas marcadas com a communities=65001:666 (as q o fastnetmon nos enviou)<br />
<strong>prefix-length=32</strong> &#8211;> com prefixo apenas /32<br />
set-bgp-communities=28146:666 &#8211;> seta a communitie que você verificou com sua operadora</p>
<p>Se você quiser descartar algum IP, ex um servidor (como comentei anteriormente) apenas para a operadora você precisa colocar antes das regras (antes da linha 1). Ex servidor 200.200.200.7 quero descartar para não cair na blackhole:</p>
<pre class="remontti-code">/routing filter
add action=discard chain=AS28146-IPv4-OUT prefix=45.189.228.7/32 prefix-length=32 
add action=accept  chain=AS28146-IPv4-OUT bgp-communities=65001:666 prefix-length=32 set-bgp-communities=28146:666
add action=accept  chain=AS28146-IPv4-OUT prefix=45.189.228.0/22 prefix-length=22-23
add action=discard chain=AS28146-IPv4-OUT</pre>
<p>Agora se você simplesmente não quer que seja bloqueado de forma alguma é só add no filtro do peer com o fastnetmon.</p>
<pre class="remontti-code">/routing filter
add action=discard chain=FastNetMon-IN prefix=45.189.228.7/32 prefix-length=32
add action=accept  chain=FastNetMon-IN set-type=blackhole
add action=discard chain=FastNetMon-OUT</pre>
<p>Seria interessante fazer alguns teste de ataques (coisa pequena) de dentro da sua rede e de fora, escolha uma IP que não esteja em uso para tal! Para realizar esse ataque user o a ferramenta criada pelo ekovegeance:<br />
<a href="https://github.com/ekovegeance/DDOS" rel="noopener noreferrer" target="_blank">https://github.com/ekovegeance/DDOS</a></p>
<p>Em um servidor/desktop linux  vai precisar ter instalado os pacotes bash sudo curl netcat hping3 openssl stunnel nmap whois dnsutils.<br />
<a href="https://github.com/ekovegeance/DDOS/archive/v1.2.4.zip">Baixe os arquivos</a>, extraia entre em sua pasta e execute o arquivo ddos.</p>
<pre class="remontti-code">$ wget https://github.com/ekovegeance/DDOS/archive/v1.2.4.zip
$ unzip v1.2.4.zip 
$ cd DDOS-1.2.4/
$ ./ddos</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos.png" data-rel="lightbox-gallery-vYF2aD2q" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos.png" alt="" width="676" height="881" class="alignnone size-full wp-image-3988" srcset="https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos.png 676w, https://blog.remontti.com.br/wp-content/uploads/2020/01/ddos-230x300.png 230w" sizes="auto, (max-width: 676px) 100vw, 676px" /></a></p>
<p>Gostou? Se sentindo mais seguro agora?</p>
<p><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p>O post <a href="https://blog.remontti.com.br/3981">Proteja-se de ataques DoS/DDoS mitigando com FastNetMon e anuncie os prefixos atacados (blackholes) para sua operadora, usando Mikrotik :-)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3981/feed</wfw:commentRss>
			<slash:comments>47</slash:comments>
		
		
			</item>
		<item>
		<title>Como é meu desktop #2? Debian 10 + KDE Plasma Minimalista + Extras</title>
		<link>https://blog.remontti.com.br/3322</link>
					<comments>https://blog.remontti.com.br/3322#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Tue, 13 Aug 2019 15:02:47 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[Angry IP Scan]]></category>
		<category><![CDATA[buster]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian10]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Etcher]]></category>
		<category><![CDATA[Filezilla]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Gimp]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[googleearth]]></category>
		<category><![CDATA[impressora]]></category>
		<category><![CDATA[Kdenlive]]></category>
		<category><![CDATA[nextcloud]]></category>
		<category><![CDATA[playonlinuyx]]></category>
		<category><![CDATA[rdesktop]]></category>
		<category><![CDATA[spotify]]></category>
		<category><![CDATA[Sublime Text]]></category>
		<category><![CDATA[Teamviewer]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[Torrent]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3322</guid>

					<description><![CDATA[<p>Antes de começar se você é iniciante e achar que é muito complexo instalar desta forma, você pode fazer a instalação selecionando a interface que deseja. Este formato é um meio de instalar apenas&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3322">Como é meu desktop #2? Debian 10 + KDE Plasma Minimalista + Extras</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Antes de começar se você é iniciante e achar que é muito complexo instalar desta forma, você pode fazer a instalação selecionando a interface que deseja. Este formato é um meio de instalar apenas os pacotes que você realmente usa e consequentemente deixará muito mais leve seu sistema.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/08/meudesktop-debian10.png" data-rel="lightbox-gallery-ILmr2zld" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/08/meudesktop-debian10-1024x640.png" alt="" width="1024" height="640" class="alignnone size-large wp-image-3363" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/08/meudesktop-debian10-1024x640.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/08/meudesktop-debian10-300x188.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/08/meudesktop-debian10-768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/08/meudesktop-debian10.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p><strong>Download</strong><br />
Vamos usar a ISO incluído Non-free + Firmware. Pq non-free e Firmware? A instalação Debian padrão é configurada para instalar apenas o Software Livre e drives não proprietários. Como muita pessoas tem dificuldade de carregar drives e instalar pacotes ex “flash-player” recomendo baixar esta iso, vou deixar dois links oficiais:<br />
<a href="https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/" rel="noopener noreferrer" target="_blank">https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/</a></p>
<p><strong>Instalação</strong><br />
Para instalação você pode seguir o tutorial: <a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">Instalação do Debian 10 Limpa</a> passo-a-passo a parte mais importante para nossa instalação minimalista é  na hora de <strong>Escolha o software a ser instalado</strong> <strong>NÃO</strong> marcar nenhuma opção.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/08/debian10.png" data-rel="lightbox-gallery-ILmr2zld" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/08/debian10-300x225.png" alt="" width="300" height="225" class="alignnone size-medium wp-image-3350" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/08/debian10-300x225.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/08/debian10-768x576.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/08/debian10.png 800w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p><strong>Repositório contrib non-free</strong></p>
<pre class="remontti-code">#  vim /etc/apt/sources.list</pre>
<p>Certifique-se de que ao final de cada repositório tenha <strong>contrib non-free</strong>, se não tiver adicione.</p>
<pre class="remontti-code">deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free

deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

# buster-updates, previously known as &#039;volatile&#039;
deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free</pre>
<p>Tenha tudo atualizado!</p>
<pre class="remontti-code"># apt update ; apt upgrade</pre>
<p>Agora vamos instalar apenas os pacotes básicos (para mim) do nosso desktop minimalista.</p>
<pre class="remontti-code">
# su -
# apt install sddm kde-plasma-desktop kde-l10n-ptbr plasma-nm\
  bash-completion vim wget sudo curl unrar-free ark kcalc\
  okular gwenview kolourpaint4 vlc ksnapshot polkit-kde-1\
  htop iotop nethogs iftop locate traceroute mtr whois\
  nmap sddm-theme-debian-breeze gtk3-engines-breeze wireless-tools\
  dirmngr net-tools dnsutils apt-transport-https python-ipaddr\
  usermode firmware-linux-free network-manager-dev network-manager-pptp\
  network-manager-vpnc network-manager-ssh network-manager-openvpn\
  network-manager-pptp net-tools libavcodec-extra ffmpeg synaptic\
  lm-sensors msttcorefonts partitionmanager dialog firmware-linux\
  firmware-linux-free firmware-linux-nonfree firmware-misc-nonfree</pre>
<p>Adicione seu usuário ao grupo sudo</p>
<pre class="remontti-code"># usermod -G sudo SEU_USUARIO</pre>
<p>Ajustes de idioma</p>
<pre class="remontti-code"># dpkg-reconfigure locales</pre>
<p>Marque as opções:<br />
<em>[*] pt_BR ISO-8859-1<br />
[*] pt_BR.UTF-8 UTF-8</em><br />
Selecione:<br />
<em>pt_BR.UTF-8 UTF-8</em><br />
Já vamos aproveitar para otimizar a parametrização do kernel.</p>
<pre class="remontti-code"># echo &quot;# Reduz o uso de SWAP&quot; &gt;&gt; /etc/sysctl.conf
# echo &quot;vm.swappiness=10&quot; &gt;&gt; /etc/sysctl.conf
# echo &quot;# Melhora a gestão de cache&quot; &gt;&gt; /etc/sysctl.conf
# echo &quot;vm.vfs_cache_pressure=50&quot; &gt;&gt; /etc/sysctl.conf
# echo &quot;vm.dirty_background_ratio = 5&quot; &gt;&gt; /etc/sysctl.conf</pre>
<p>Reinicie e sua interface desktop já deve estar pronta!</p>
<pre class="remontti-code"># systemctl reboot</pre>
<p><strong>Drive de vídeo</strong><br />
Em grande parte os drives são reconhecidos e instalado, mas caso tenha problema consulte:</p>
<p><a href="https://wiki.debian.org/GraphicsCard" rel="noopener noreferrer" target="_blank">https://wiki.debian.org/GraphicsCard</a><br />
<a href="https://wiki.debian.org/AtiHowTo" rel="noopener noreferrer" target="_blank">https://wiki.debian.org/AtiHowTo</a><br />
<a href="https://wiki.debian.org/ATIProprietary" rel="noopener noreferrer" target="_blank">https://wiki.debian.org/ATIProprietary</a><br />
<a href="https://wiki.debian.org/NvidiaGraphicsDrivers" rel="noopener noreferrer" target="_blank">https://wiki.debian.org/NvidiaGraphicsDrivers</a></p>
<h3>APLICATIVOS</h3>
<p>:: <a href="https://www.mozilla.org/pt-BR/firefox/" rel="noopener noreferrer" target="_blank"><strong>Firefox</strong></a> :: (Navegador)</p>
<pre class="remontti-code">$ sudo apt install firefox-esr firefox-esr-l10n-pt-br</pre>
<p>:: <strong><a href="https://www.chromium.org/">Chromium</a></strong> :: (Navegador)</p>
<pre class="remontti-code">$ sudo apt install chromium chromium-l10n</pre>
<p>:: <a href="https://www.google.com/intl/pt-BR/chrome/" rel="noopener noreferrer" target="_blank"><strong>Chrome</strong></a> :: (Navegador)</p>
<pre class="remontti-code">$ cd /tmp/
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo apt install ./google-chrome-stable_current_amd64.deb</pre>
<p>:: <a href="https://www.google.com.br/intl/pt-BR/earth/" rel="noopener noreferrer" target="_blank"><strong>Google Earth</strong></a> :: (Mapas)</p>
<pre class="remontti-code">$ cd /tmp/
$ wget https://dl.google.com/dl/earth/client/current/google-earth-pro-stable_current_amd64.deb
$ sudo apt install ./google-earth-pro-stable_current_amd64.deb</pre>
<p>:: <a href="https://www.libreoffice.org/" rel="noopener noreferrer" target="_blank"><strong>LibreOffice</strong></a> :: (Suite office)</p>
<pre class="remontti-code">$ sudo apt install libreoffice libreoffice-style-breeze libreoffice-l10n-pt-br</pre>
<p>:: <a href="https://www.thunderbird.net/pt-BR/" rel="noopener noreferrer" target="_blank"><strong>Thunderbird</strong></a> :: (Cliente E-mails)</p>
<pre class="remontti-code">$ sudo apt install thunderbird thunderbird-l10n-pt-br lightning-l10n-pt-br</pre>
<p>:: <a href="https://filezilla-project.org/" rel="noopener noreferrer" target="_blank"><strong>Filezilla</strong></a> :: (Cliente FTP +SFTP)</p>
<pre class="remontti-code">$ sudo apt install filezilla</pre>
<p>:: <strong><a href="https://github.com/GNOME/vinagre" rel="noopener noreferrer" target="_blank">Vinagre</a></strong> :: (Visualizador de área de trabalho remota)</p>
<pre class="remontti-code">$ sudo apt install vinagre</pre>
<p>:: <a href="https://www.rdesktop.org/" rel="noopener noreferrer" target="_blank"><strong>Rdesktop</strong></a> :: (Cliente RDP para o Terminal Server do Windows modo texto)</p>
<pre class="remontti-code">$ sudo apt install rdesktop</pre>
<p>:: <a href="https://kdenlive.org/" rel="noopener noreferrer" target="_blank"><strong>Kdenlive</strong></a>:: (Editor video)</p>
<pre class="remontti-code">$ sudo apt install kdenlive</pre>
<p>:: <a href="https://www.gimp.org/" rel="noopener noreferrer" target="_blank"><strong>Gimp</strong></a> :: (Editor imagem)</p>
<pre class="remontti-code">$ sudo apt install gimp</pre>
<p>:: <a href="https://www.playonlinux.com/" rel="noopener noreferrer" target="_blank"><strong>Playonlinux</strong></a> :: (Gerenciamento Wine para rodar aplicativos do Windows)</p>
<pre class="remontti-code">$ sudo dpkg --add-architecture i386 ; sudo apt update ; sudo apt upgrade
$ sudo apt install playonlinux</pre>
<p>Inclua as fontes da MS.</p>
<pre class="remontti-code">$ cp /usr/share/fonts/truetype/msttcorefonts/* ~/PlayOnLinux\&#039;s\ virtual\ drives/default/drive_c/windows/Fonts/</pre>
<p>:: <strong><a href="https://desktop.telegram.org" rel="noopener noreferrer" target="_blank">Telegram</a></strong> ::<br />
A versão via apt não é a mais recente, a instalação manual é mais recomendada se você quiser ter a versão mais atual.<br />
Acesse: <a href="https://github.com/telegramdesktop/tdesktop/releases/latest" rel="noopener noreferrer" target="_blank">https://github.com/telegramdesktop/tdesktop/releases/latest</a> e baixe a ultima versão &#8220;Linux 64 bit: Binary&#8221; ou 32 se for o seu caso. </p>
<pre class="remontti-code">$ cd /tmp/
$ wget https://telegram.org/dl/desktop/linux -O tsetup.tar.xz
$ tar xvf tsetup.tar.xz
$ sudo mv Telegram/ /opt/
$ sudo chown $USER. /opt/Telegram/ -R
$ sudo ln -sf /opt/Telegram/Telegram /usr/bin/telegram
$ telegram &amp;</pre>
<p>:: <a href="https://www.spotify.com/br/download/linux/" rel="noopener noreferrer" target="_blank"><strong>Spotify</strong></a> :: </p>
<pre class="remontti-code">$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90
$ echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list
$ sudo apt update
$ sudo apt install spotify-client</pre>
<p>:: <strong><a href="https://www.skype.com/pt-br/get-skype/" rel="noopener noreferrer" target="_blank">Skype</a></strong> ::</p>
<pre class="remontti-code">$ cd /tmp/
$ wget https://repo.skype.com/latest/skypeforlinux-64.deb
$ sudo apt install ./skypeforlinux-64.deb</pre>
<p>:: <strong><a href="https://wiki.debian.org/Java/" rel="noopener noreferrer" target="_blank">Java</a></strong> :: </p>
<pre class="remontti-code">$ sudo apt install icedtea-netx default-jre</pre>
<p>:: <strong><a href="http://angryip.org/download/#linux" rel="noopener noreferrer" target="_blank">Angry IP Scan</a></strong>:: (Scaner Redes)</p>
<pre class="remontti-code">$ cd /tmp/
$ wget https://github.com/angryip/ipscan/releases/download/3.6.2/ipscan_3.6.2_amd64.deb
$ sudo apt install ./ipscan_3.6.2_amd64.deb</pre>
<p>:: <strong><a href="https://www.sublimetext.com/docs/3/linux_repositories.html" rel="noopener noreferrer" target="_blank">Sublime Text</a></strong> :: (Editor de texto)</p>
<pre class="remontti-code">$ wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
$ echo &quot;deb https://download.sublimetext.com/ apt/stable/&quot; | sudo tee /etc/apt/sources.list.d/sublime-text.list
$ sudo apt update ; sudo apt install sublime-text</pre>
<p>:: <strong><a href="https://etcher.io" rel="noopener noreferrer" target="_blank">Etcher</a></strong> :: (Flash USB bootaveis)</p>
<pre class="remontti-code">$ echo &quot;deb https://deb.etcher.io stable etcher&quot; | sudo tee /etc/apt/sources.list.d/balena-etcher.list
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61
$ sudo apt update
$ sudo apt install balena-etcher-electron</pre>
<p>:: <strong><a href="https://www.teamviewer.com/pt-br/download/linux/" rel="noopener noreferrer" target="_blank">Teamviewer</a></strong> ::</p>
<pre class="remontti-code">$ cd /tmp/
$ wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
$ sudo apt install ./teamviewer_amd64.deb</pre>
<p>:: <strong><a href="https://www.dropbox.com/install" rel="noopener noreferrer" target="_blank">Dropbox</a></strong> :: (Cloud)</p>
<pre class="remontti-code">$ cd /tmp/
$ sudo apt install python3-gpg python-gpg
$ wget https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2019.02.14_amd64.deb -O dropbox.deb
$ sudo apt install ./dropbox.deb</pre>
<p>:: <strong><a href="https://nextcloud.com/install/#install-clients" rel="noopener noreferrer" target="_blank">Nextcloud</a></strong> :: (Cloud)</p>
<pre class="remontti-code">$ cd /tmp/
$ wget https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-2.6.3-x86_64.AppImage -O Nextcloud.AppImage
$ chmod a+x Nextcloud.AppImage
$ sudo mkdir /opt/Nextcloud
$ sudo chown $USER. /opt/Nextcloud/ -R
$ mv Nextcloud.AppImage /opt/Nextcloud/</pre>
<p>Atalho (pesquise um ícone na internet)</p>
<pre class="remontti-code">$ wget http://www.iconarchive.com/download/i106074/papirus-team/papirus-apps/nextcloud.ico -O /opt/Nextcloud/nextcloud.ico
$ sudo vim /usr/share/applications/nextcloud.desktop</pre>
<p>Crie um atalho em seus aplicativos</p>
<pre class="remontti-code">[Desktop Entry]
Version=2.6.3
Name=NextCloud
Comment=NextCloud Desktop
TryExec=/opt/Nextcloud/Nextcloud.AppImage
Exec=/opt/Nextcloud/Nextcloud.AppImage
Icon=/opt/Nextcloud/nextcloud.ico
Terminal=false
StartupWMClass=NextcloudDesktop
Type=Application
Categories=Network;</pre>
<p>Para colocar inicializar com o sistema vá nas configurações do aplicativo.<br />
<strong>:: Torrent::</strong><br />
Eu gosto do <strong><a href="https://github.com/rakshasa/rtorrent" rel="noopener noreferrer" target="_blank">rtorrent</a></strong> via terminal</p>
<pre class="remontti-code">$ sudo apt install rtorrent</pre>
<p>Mas para interface prefiro <strong><a href="https://www.qbittorrent.org/" rel="noopener noreferrer" target="_blank">qBittorrent</a></strong></p>
<pre class="remontti-code">$ sudo apt install qbittorrent</pre>
<p>:: <strong><a href="https://www.virtualbox.org/wiki/Linux_Downloads" rel="noopener noreferrer" target="_blank">Virtualbox</a></strong> :: </p>
<pre class="remontti-code">$ echo &quot;deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian buster contrib&quot; | sudo tee /etc/apt/sources.list.d/virtualbox.list
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
$ sudo apt update
$ sudo apt install virtualbox-6.1
$ sudo usermod -a -G vboxusers $USER</pre>
<pre class="remontti-code">$ cd /tmp/
$ wget --no-check-certificate https://download.virtualbox.org/virtualbox/6.1.0/Oracle_VM_VirtualBox_Extension_Pack-6.1.0.vbox-extpack
$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.0.vbox-extpack</pre>
<p><strong>:: Iniciar Nun Lok ativo e corrigir problema do ponto no Wine ::</strong></p>
<pre class="remontti-code">$ sudo apt install numlockx</pre>
<p>Crie um arquivo com:</p>
<pre class="remontti-code">$ vim ~/.config/autostart-scripts/inicializar.sh</pre>
<p>Adicione</p>
<pre class="remontti-code">#!/bin/bash
# Liga o nunlok
/usr/bin/numlockx on
# Corrige ponto do teclado numerico
/usr/bin/xmodmap -e &#039;keycode 129 = period&#039;</pre>
<pre class="remontti-code">$ chmod +x ~/.config/autostart-scripts/inicializar.sh</pre>
<p>Pronto na próxima inicialização ele já vai executar seu script.<br />
<strong>:: Possíveis Dificuldades ::</strong><br />
<strong>Ajuste na rede</strong></p>
<pre class="remontti-code">$ sudo sed -i &#039;s/plugins=ifupdown,keyfile/plugins=keyfile/&#039; /etc/NetworkManager/NetworkManager.conf
$ sudo addgroup $USER netdev
$ sudo /etc/init.d/network-manager restart</pre>
<p><strong>Impressora</strong></p>
<pre class="remontti-code">$ sudo tasksel
$ sudo apt install printer-driver-hpijs printer-driver-hplip hpcups system-config-printer printer-driver-all</pre>
<p><strong>Solução para o volume que fica indo para 100% sozinho.</strong></p>
<pre class="remontti-code">$ echo &#039;flat-volumes = no&#039; &gt;&gt; ~/.config/pulse/daemon.conf
$ sudo sed -i &#039;s/; flat-volumes = yes/flat-volumes = no/&#039; /etc/pulse/daemon.conf
$ pulseaudio -k ; pulseaudio --start</pre>
<p>Parabéns! Você concluiu! Gostou?</p>
<p><center><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></center></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p>O post <a href="https://blog.remontti.com.br/3322">Como é meu desktop #2? Debian 10 + KDE Plasma Minimalista + Extras</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3322/feed</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>Zabbix 4.2/4.4 enviando  alertas no Telegram via Bot (Debian 10)</title>
		<link>https://blog.remontti.com.br/3053</link>
					<comments>https://blog.remontti.com.br/3053#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Thu, 18 Jul 2019 19:04:41 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[4.4]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[token]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix 4.4]]></category>
		<category><![CDATA[zabbix4]]></category>
		<category><![CDATA[zabbix4.2]]></category>
		<category><![CDATA[zabbix4.4]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3053</guid>

					<description><![CDATA[<p>Vamos aprender como receber os alertas do zabbix através do telegram. Requisitos: Instalação do Zabbix 4.4 no Debian 10 Buster ou Instalação do Zabbix 4.2 no Debian 10 Buster Criando Bot no telegram Abra&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3053">Zabbix 4.2/4.4 enviando  alertas no Telegram via Bot (Debian 10)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Vamos aprender como receber os alertas do zabbix através do telegram.</p>
<p><strong>Requisitos:</strong><br />
<a href="https://blog.remontti.com.br/3995" rel="noopener noreferrer" target="_blank">Instalação do Zabbix 4.4 no Debian 10 Buster</a><br />
ou<br />
<a href="https://blog.remontti.com.br/3032" rel="noopener noreferrer" target="_blank">Instalação do Zabbix 4.2 no Debian 10 Buster</a></p>
<p><strong>Criando Bot no telegram</strong></p>
<p>Abra o Telegram e procure por <a href="https://t.me/BotFather" rel="noopener noreferrer" target="_blank"><strong>@BotFather</strong></a>.<br />
Inicie a conversa com ele.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2823" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2826" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2827" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>&#8211; Digite o comando <strong>/newbot</strong> para iniciar a criação de um novo bot.<br />
&#8211; Após o comando você vai dar um nome para seu bot. Ex.: <em>&#8220;Bot Legal RR&#8221;</em>.<br />
&#8211; Em seguida é necessário digitar o nome de usuário para o bot, sendo obrigatório terminar com <strong>bot</strong>. Ex.: <em>&#8220;legallrr_bot&#8221;</em>.<br />
&#8211; Ao finalizar você receber informações com seu TOKEN, que vamos utilizar em seguida.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2830" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2833" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2835" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Neste exemplo nosso token para acessar a API HTTP ficou:<br />
<strong>757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</strong></p>
<p>Agora procure pelo seu bot e comece uma conversa com ele e envie uma mensagem de teste para o mesmo, pois vamos precisar descobrir o ID do seu usuário, para que ele possa lhe enviar as mensagens.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2837" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2838" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Abra em seu seu navegador a seguinte URL https://api.telegram.org/bot<strong>TOKEN</strong>/getUpdates para descobrir o ID do usuário que enviou a mensagem ou de um grupo.<br />
Ex.: <font size="2"><em>https://api.telegram.org/bot<strong><font color="red">757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</font></strong>/getUpdates</em></font></p>
<p><strong>:: Chat privado ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208620,&quot;message&quot;:{
		&quot;message_id&quot;:2,&quot;from&quot;:{&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:999999999,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;type&quot;:&quot;private&quot;},
		&quot;date&quot;:1541210279,&quot;text&quot;:&quot;Testando&quot;
	}
}]}</pre>
<p>ID do chat privado: <strong>999999999</strong></p>
<p>Se desejar criar um grupo também, basta adicionar seu bot a ele, após adiciona-lo envia uma mensagem como <strong>/teste</strong> para que possamos coletar o ID do grupo.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2843" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2844" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p><strong>:: Chat em Grupo ::</strong></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{
	&quot;update_id&quot;:649208622,&quot;message&quot;:{&quot;message_id&quot;:4,&quot;from&quot;:{
		&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},
		&quot;chat&quot;:{&quot;id&quot;:-888888888,&quot;title&quot;:&quot;Grupo Legal&quot;,&quot;type&quot;:&quot;group&quot;,&quot;all_members_are_administrators&quot;:true
	},&quot;date&quot;:1541210975,&quot;text&quot;:&quot;/teste&quot;,&quot;entities&quot;:[{&quot;offset&quot;:0,&quot;length&quot;:6,&quot;type&quot;:&quot;bot_command&quot;}
}]}</pre>
<p>ID do chat grupo: <strong>-888888888</strong></p>
<p>Grupo sempre tem um sinal &#8220;-&#8221; na frente do ID.</p>
<p>Para testarmos se o envio esta funcionando, abra seu navegador e cole a seguinte URL:<br />
https://api.telegram.org/bot<font color="red">TOKEN</font>/sendMessage?chat_id=<font color="red">ID</font>&amp;text=<font color="red">Minha%20Mensagem</font></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2847" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12.jpg" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2848" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>É necessário ter o curl instalado, uma ferramenta para comando para transferência de dados com sintaxe URL.</p>
<pre class="remontti-code"># apt install curl</pre>
<p>O diretório padrão no zabbix para os scripts fica em /usr/lib/zabbix/alertscripts/.<br />
<font size="2">(Obs: No tutorial Zabbix 3.0.x com notificações via Telegram nos alteramos o valor de AlertScriptsPath, então caso você seja um leitor que quer apenas migrar, volte o diretório esta em /opt/telegram)</font></p>
<p>Vamos criar o arquivo telegram</p>
<pre class="remontti-code"># vim /usr/lib/zabbix/alertscripts/telegram</pre>
<pre class="remontti-code">#!/bin/bash
# Autor: remontti.com.br
TOKEN=&quot;ALTERE-PELO-SEU-TOKEN&quot;

USER=$1
SUBJECT=$2
MESSAGE=$3
NL=&quot;
&quot;
curl --silent -X POST --data-urlencode &quot;chat_id=${USER}&quot; --data-urlencode &quot;text=${SUBJECT}${NL}${NL}${MESSAGE}&quot; &quot;https://api.telegram.org/bot${TOKEN}/sendMessage?disable_web_page_preview=true&amp;parse_mode=html&quot; | grep -q &#039;&quot;ok&quot;:true&#039;

exit 0</pre>
<p>De permissão para executar, em seguida vamos criar um atalho em /usr/bin/ e alterar as permissões para o usuário do zabbix.</p>
<pre class="remontti-code"># chmod  +x /usr/lib/zabbix/alertscripts/telegram
# ln -s /usr/lib/zabbix/alertscripts/telegram /usr/bin/telegram
# chown zabbix. -R /usr/lib/zabbix/alertscripts</pre>
<p>Agora execute em seu terminal para verificar se seu bot já consegue fazer o envio de mensages.</p>
<pre class="remontti-code"># telegram &quot;-888888888&quot; &quot;Mensagem via Terminal para grupo&quot;
# telegram &quot;999999999&quot; &quot;Mensagem via Terminal para privado&quot;</pre>
<h3>::Configurações no Zabbix ::</h3>
<p><strong>Administração</strong> ⇒ <strong>Tipos de mídias</strong> ⇒ <strong>Criar tipo de mídia</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-1.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-1-1024x585.png" alt="" width="1024" height="585" class="alignnone size-large wp-image-3064" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-1-1024x585.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-1-300x171.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-1-768x439.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-1.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Nome: <strong>Telegram</strong><br />
Tipo: <strong>Script</strong><br />
Nome script: <strong>telegram</strong><br />
Parâmetros do script<br />
<strong>{ALERT.SENDTO}<br />
{ALERT.SUBJECT}<br />
{ALERT.MESSAGE}</strong><br />
Ativo: <strong>Sim</strong></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-2.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-2-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3065" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-2-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-2-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-2-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-2.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p><strong>Administração</strong> ⇒ <strong>Usuários</strong> Clique no usuário <strong>Admin</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-3.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-3-1024x584.png" alt="" width="1024" height="584" class="alignnone size-large wp-image-3066" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-3-1024x584.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-3-300x171.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-3-768x438.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-3.png 1216w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Com as opções do usuário aberto clique na aba <strong>Mídia</strong> clique no <strong>Adicionar</strong> (2)<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-4.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-4-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3067" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-4-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-4-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-4-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-4.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Tipo: <strong>Telegram</strong><br />
Enviar para: <strong>ID-Do-Grupo/ID-Usuário</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-5.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-5-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3068" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-5-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-5-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-5-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-5.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-6.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-6-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3069" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-6-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-6-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-6-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-6.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Agora vamos criar a ação que fará o envios dos alertas.<br />
<strong>Configurações</strong> ⇒ <strong>Ações</strong> ⇒ <strong>Criar ação</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-7.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-7-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3070" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-7-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-7-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-7-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-7.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>De um nome para sua ação<br />
Nova condição: <strong>Incidente suprimido</strong> &#8211; <strong>Não</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-8.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-8-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3071" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-8-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-8-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-8-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-8.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-9.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-9-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3072" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-9-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-9-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-9-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-9.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Aba <strong>Operações</strong><br />
<strong>Assunto padrão</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Problema: &lt;b&gt;{HOST.NAME} &lt;/b&gt;</pre>
<p><strong>Mensagem padrão</strong></p>
<pre class="remontti-code">&lt;code&gt;{EVENT.NAME}&lt;/code&gt;
&lt;b&gt;{ITEM.NAME1}&lt;/b&gt; &lt;i&gt;{ITEM.VALUE1}&lt;/i&gt;

&lt;a href=&quot;{HOST.IP}&quot;&gt;{HOST.IP}&lt;/a&gt;
&lt;i&gt;{EVENT.SEVERITY}&lt;/i&gt;</pre>
<p>Operações: Clique em <strong>Nova</strong> Mais campos se abrirão, agora em <strong>Enviar para Usuário</strong> Clique em <strong>Adicionar</strong> e Selecione o Usuário <strong>Admin</strong> qual configuramos a mídia. Na opção <strong>Enviar apenas para</strong>: Selecione <strong>Telegram</strong>, e em seguida <strong>Adicionar</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-10.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-10-1024x953.png" alt="" width="1024" height="953" class="alignnone size-large wp-image-3073" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-10-1024x953.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-10-300x279.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-10-768x715.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-10.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Vamos repetir praticamente na aba <strong>Operações de recuperação</strong></p>
<p><strong>Assunto padrão</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" />   Resolvido:  &lt;b&gt;{HOST.NAME} &lt;/b&gt;</pre>
<p><strong>Mensagem padrão</strong></p>
<pre class="remontti-code">&lt;code&gt;{EVENT.NAME}&lt;/code&gt;
&lt;b&gt;{ITEM.NAME1}&lt;/b&gt; &lt;i&gt;{ITEM.VALUE1}&lt;/i&gt;

&lt;a href=&quot;{HOST.IP}&quot;&gt;{HOST.IP}&lt;/a&gt;
&lt;i&gt;{EVENT.SEVERITY}&lt;/i&gt;</pre>
<p>Pode clicar agora em <strong>Adicionar</strong> na seção Operações<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-11.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-11-1024x770.png" alt="" width="1024" height="770" class="alignnone size-large wp-image-3074" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-11-1024x770.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-11-300x226.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-11-768x578.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-11.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Aba <strong>Operações de atualização</strong></p>
<p><strong>Assunto padrão</strong>:</p>
<pre class="remontti-code">Problema atualizado: {EVENT.NAME}</pre>
<p><strong>Mensagem padrão</strong></p>
<pre class="remontti-code">{USER.FULLNAME} {EVENT.UPDATE.ACTION} problema em {EVENT.UPDATE.DATE} {EVENT.UPDATE.TIME}.
{EVENT.UPDATE.MESSAGE}

O status atual do problema é {EVENT.STATUS}, reconhecido: {EVENT.ACK.STATUS}.</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-12.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-12-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3075" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-12-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-12-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-12-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-12.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-13.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-13-1024x544.png" alt="" width="1024" height="544" class="alignnone size-large wp-image-3076" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-13-1024x544.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-13-300x159.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-13-768x408.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-13.png 1215w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>E por fim clique no botão Adicionar.</p>
<p>Pronto! Agora precisamos gerar um incidente para ver se nosso alerta será enviado para o Telegram.<br />
No meu caso vou atualizar meu root server do bind9.11 para ver se recebo alertas. Vou editar o arquivo /usr/share/dns/root.hints (que na versão do debian 9 era /etc/bind/db.root). Possuo um template que criei onde ele verifica alterações no arquivo:  <a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zbx_export_templates_bin9.11.xml">zbx_export_templates_bin9.11.xml</a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14.png" data-rel="lightbox-gallery-PPTkE7DK" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-576x1024.png" alt="" width="576" height="1024" class="alignnone size-large wp-image-3080" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-576x1024.png 576w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14-169x300.png 169w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-telegram-bot-14.png 720w" sizes="auto, (max-width: 576px) 100vw, 576px" /></a></p>
<p>Bingo! Tudo certo, nosso sistema de envio de mensagem está concluído!</p>
<p>Gostou?</p>
<p><center><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></center></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p><font size="2">Fontes: <a href="https://core.telegram.org/bots" rel="noopener noreferrer" target="_blank">https://core.telegram.org/bots</a> &amp; <a href="https://www.zabbix.com/documentation/" rel="noopener noreferrer" target="_blank">https://www.zabbix.com/documentation/</a></font></p>
<p>O post <a href="https://blog.remontti.com.br/3053">Zabbix 4.2/4.4 enviando  alertas no Telegram via Bot (Debian 10)</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3053/feed</wfw:commentRss>
			<slash:comments>62</slash:comments>
		
		
			</item>
		<item>
		<title>Instalação do Zabbix 4.2 no Debian 10 Buster</title>
		<link>https://blog.remontti.com.br/3032</link>
					<comments>https://blog.remontti.com.br/3032#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Tue, 16 Jul 2019 20:15:48 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[debian 10]]></category>
		<category><![CDATA[debian10]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix 4.2]]></category>
		<category><![CDATA[zabbix 4.4]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=3032</guid>

					<description><![CDATA[<p>O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/3032">Instalação do Zabbix 4.2 no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>O Zabbix é uma solução de nível enterprise, de código aberto. O Zabbix é um software que monitora vários parâmetros da rede, dos servidores e da saúde dos serviços. Utiliza-se de um mecanismo flexível de notificação que permite configurar alertas por e-mail entre outros como Telegram, para praticamente qualquer evento. As notificações permitem que se reaja rapidamente à problemas no ambiente. O Zabbix oferece excelentes recursos de relatórios e visualização de dados armazenados. Isso faz com que o Zabbix seja a ferramenta ideal para planejamento de capacidade.</p>
<p>Requisitos:<br />
<a href="https://blog.remontti.com.br/2966" rel="noopener noreferrer" target="_blank">* Debian 10 (Buster) -> Instalação Limpa</a><br />
<a href="https://blog.remontti.com.br/3006" rel="noopener noreferrer" target="_blank">* Passo-a-passo como criar um servidor WEB Apache + PHP + MariaDB + phpMyAdmin no Debian 10 Buster &#8220;LAMP&#8221;</a></p>
<p>Para instalação do Zabbix vamos incluir o repositório do oficial do Zabbix.</p>
<pre class="remontti-code"># su -
# cd /tmp</pre>
<p>Versão 4.2</strong></p>
<pre class="remontti-code"># wget https://repo.zabbix.com/zabbix/4.2/debian/pool/main/z/zabbix-release/zabbix-release_4.2-1+buster_all.deb
# dpkg -i zabbix-release_4.2-1+buster_all.deb</pre>
<p>Atualize o repositório e realize a instalação </p>
<pre class="remontti-code"># apt update ; apt upgrade
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent</pre>
<p>Vamos criar uma base de dados chamada <strong>zabbix</strong> e um usuário também chamado de zabbix no MariaDB.<br />
Não esqueça de alterar a senha: Use o gerador de senha: <a href="https://senhasegura.remontti.com.br/" rel="noopener noreferrer" target="_blank">https://senhasegura.remontti.com.br/</a></p>
<pre class="remontti-code"># mariadb -u root -p</pre>
<pre class="remontti-code">CREATE DATABASE zabbix CHARACTER SET utf8 collate utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY &#039;SUA_SENHA&#039;;
FLUSH PRIVILEGES;
EXIT;</pre>
<p>Na versão do MariaDB 10.3.17 está apresentando um &#8220;problema&#8221; ao importar a base de dados do zabbix.<br />
<strong>ERROR 1118 (42000) at line 1284: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.</strong><br />
Verifique se sua versão é a 10.3.17</p>
<pre class="remontti-code"># mariadb --version
mariadb  Ver 15.1 Distrib 10.3.17-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2</pre>
<p>Se sim uma solução de momento é editar:</p>
<pre class="remontti-code"># vim /etc/mysql/mariadb.conf.d/50-server.cnf</pre>
<p>adicione a baixo de <strong>[mysqld]</strong></p>
<pre class="remontti-code">innodb_strict_mode = 0</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/Row-size-too-large.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/Row-size-too-large-300x221.png" alt="" width="300" height="221" class="alignnone size-medium wp-image-3537" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/Row-size-too-large-300x221.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/Row-size-too-large.png 715w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Restarte o mariadb</p>
<pre class="remontti-code"># systemctl restart mariadb</pre>
<p>Importe o esquema de tabelas e dados padrões. (Demora um pouco!)</p>
<pre class="remontti-code"># zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix</pre>
<p>Digite a senha de seu usuário zabbix criada no passo anterior para importar as tabelas.</p>
<p>Agora que você já importou sem erros, edite novamente o <strong>/etc/mysql/mariadb.conf.d/50-server.cnf</strong> e remova a linha com <strong>innodb_strict_mode = 0</strong></p>
<pre class="remontti-code"># vim /etc/mysql/mariadb.conf.d/50-server.cnf</pre>
<p><del datetime="2019-09-11T20:12:26+00:00">innodb_strict_mode = 0</del></p>
<p>Edite o arquivo zabbix_server.conf para informar os dados para conexão com o MySQL.</p>
<pre class="remontti-code"># vim /etc/zabbix/zabbix_server.conf</pre>
<p>Procure por <strong># DBPassword=</strong> descomente e sete sua senha.</p>
<pre class="remontti-code">#...
DBPassword=SUA_SENHA
#...</pre>
<pre class="remontti-code"># vim /etc/apache2/conf-enabled/zabbix.conf</pre>
<p>Procure por: <strong># php_value date.timezone Europe/Riga</strong> e <a href="https://secure.php.net/manual/pt_BR/timezones.america.php" rel="noopener noreferrer" target="_blank">altere pela sua região</a>.<br />
Ex:</p>
<pre class="remontti-code">php_value date.timezone America/Sao_Paulo</pre>
<p>Após a alteração será necessário o reiniciar o apache.</p>
<pre class="remontti-code"># systemctl restart apache2</pre>
<p>Iniciando o Zabbix Server e Agente junto com a inicialização do sistema.</p>
<pre class="remontti-code"># systemctl enable zabbix-server
# systemctl enable zabbix-agent
# systemctl restart zabbix-server
# systemctl restart zabbix-agent</pre>
<p><center><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-1.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-1-1024x530.png" alt="" width="1024" height="530" class="alignnone size-large wp-image-3036" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-1-1024x530.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-1-300x155.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-1-768x397.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-1.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-2.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-2-1024x798.png" alt="" width="1024" height="798" class="alignnone size-large wp-image-3037" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-2-1024x798.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-2-300x234.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-2-768x599.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-2.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-3.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-3-1024x500.png" alt="" width="1024" height="500" class="alignnone size-large wp-image-3038" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-3-1024x500.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-3-300x146.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-3-768x375.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-3.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-4.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-4-1024x500.png" alt="" width="1024" height="500" class="alignnone size-large wp-image-3039" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-4-1024x500.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-4-300x146.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-4-768x375.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-4.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-5.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-5-1024x500.png" alt="" width="1024" height="500" class="alignnone size-large wp-image-3040" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-5-1024x500.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-5-300x146.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-5-768x375.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-5.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-1024x500.png" alt="" width="1024" height="500" class="alignnone size-large wp-image-3041" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-1024x500.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-300x146.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-768x375.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-1024x500.png" alt="" width="1024" height="500" class="alignnone size-large wp-image-3041" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-1024x500.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-300x146.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6-768x375.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-6.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
Logue com <strong>Admin</strong> senha <strong>zabbix</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-7.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-7-1024x500.png" alt="" width="1024" height="500" class="alignnone size-large wp-image-3042" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-7-1024x500.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-7-300x146.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-7-768x375.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-7.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-8.png" data-rel="lightbox-gallery-iT6NyIdA" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-8-1024x724.png" alt="" width="1024" height="724" class="alignnone size-large wp-image-3043" srcset="https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-8-1024x724.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-8-300x212.png 300w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-8-768x543.png 768w, https://blog.remontti.com.br/wp-content/uploads/2019/07/zabbix-4.2-debian-10-buster-8.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><br />
</center><br />
Você pode gostar de:<br />
<a href="https://blog.remontti.com.br/3053" rel="noopener noreferrer" target="_blank">Zabbix 4 + Alertas no Telegram via Bot</a></p>
<p>Gostou?</p>
<p><center><strong>Se quiser fazer uma doação para o café ficarei muito feliz pelo seu reconhecimento!</strong><br />
<a href="https://blog.remontti.com.br/doar"><img decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2019/07/quero-doar-remontti.png" /></a></center></p>
<p>Se não puder doar pode deixar seu agradecimento nos comentário também ficarei feliz em saber que ajudei. Se tiver qualquer pergunta deixe-a também. Se preferir entrar em Contato <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">clique aqui.</a></p>
<p>Abraço!</p>
<p>Fonte: https://www.zabbix.com/documentation/</p>
<p>O post <a href="https://blog.remontti.com.br/3032">Instalação do Zabbix 4.2 no Debian 10 Buster</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/3032/feed</wfw:commentRss>
			<slash:comments>35</slash:comments>
		
		
			</item>
		<item>
		<title>Zabbix 4.0 + Alertas no Telegram via Bot</title>
		<link>https://blog.remontti.com.br/2817</link>
					<comments>https://blog.remontti.com.br/2817#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sat, 03 Nov 2018 20:11:46 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[4.0]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[notificações]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[token]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zabbix 4]]></category>
		<category><![CDATA[zabbix4]]></category>
		<guid isPermaLink="false">https://blog.remontti.com.br/?p=2817</guid>

					<description><![CDATA[<p>Existe um tutorial mais atualizado Zabbix 4.2 enviando alertas no Telegram via Bot (Debian 10) Vamos aprender como receber os alertas do zabbix através do telegram. Para instalação do Zabbix 4.0 Instalação do Zabbix&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/2817">Zabbix 4.0 + Alertas no Telegram via Bot</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-4.0-telegram.jpg" alt="" width="719" height="342" class="alignnone size-full wp-image-2879" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-4.0-telegram.jpg 719w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-4.0-telegram-300x143.jpg 300w" sizes="auto, (max-width: 719px) 100vw, 719px" /></p>
<h2><font color="red">Existe um tutorial mais atualizado</font> <a href="https://blog.remontti.com.br/3053" rel="noopener noreferrer" target="_blank">Zabbix 4.2 enviando alertas no Telegram via Bot (Debian 10)</a></h2>
<p>Vamos aprender como receber os alertas do zabbix através do telegram.</p>
<p><strong>Para instalação do Zabbix 4.0</strong><br />
<a href="https://blog.remontti.com.br/2126" rel="noopener noreferrer" target="_blank">Instalação do Zabbix 4.0 / 3.4 / 3.0 no Debian 9 Stretch com banco de dados MariaBD</a></p>
<p><strong>Criando nosso bot</strong></p>
<p>Abra APP do telegram e procure por <a href="https://t.me/BotFather" rel="noopener noreferrer" target="_blank"><strong>@BotFather</strong></a> Comece uma uma conversa com ele.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2823" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram1.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2826" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram2.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2827" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram3.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Agora digite <strong>/newbot</strong> para criar um novo bot. Após o comando você vai dar um nome <em>&#8220;Bot Legal RR&#8221;</em>. Em seguida é necessário digitar o nome de login sendo obrigatório terminar com <strong>bot</strong> <em>&#8220;legallrr_bot&#8221;</em>. Você vai ter um retorno com token que vamos utilizar em seguida.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2830" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram4.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2833" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram5.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2835" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram6.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Nosso token para acessar a API HTTP:<br />
<strong>757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</strong></p>
<p>Agora procure pelo seu bot e comece uma conversa com ele e envie uma mensagem de teste para o mesmo, pois vamos precisar descobrir o ID do seu usuário, para que ele possa lhe enviar as mensagens.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2837" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram7.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2838" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram8.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Agora vamos acessar a seguinte URL https://api.telegram.org/bot<strong>TOKEN</strong>/getUpdates para descobrir o ID do usuário que enviou a mensagem.<br />
Ex.: <font size="2"><em>https://api.telegram.org/bot<strong>757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0</strong>/getUpdates</em></font></p>
<pre class="remontti-code">{&quot;ok&quot;:true,&quot;result&quot;:[{&quot;update_id&quot;:649208620,
&quot;message&quot;:{&quot;message_id&quot;:2,&quot;from&quot;:{&lt;strong&gt;&lt;font color=&quot;red&quot;&gt;&quot;id&quot;:221122111,&quot;&lt;/font&gt;&lt;/strong&gt;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},&quot;chat&quot;:{&quot;id&quot;:201149282,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;type&quot;:&quot;private&quot;},&quot;date&quot;:1541210279,&quot;text&quot;:&lt;strong&gt;&lt;font color=&quot;red&quot;&gt;&quot;Testando&quot;&lt;/font&gt;&lt;/strong&gt;}}]}  
</pre>
<p>Você pode criar um grupo também e adicionar seu bot nele, após adiciona-lo envia uma mensagem como <strong>/teste</strong> para que possamos coletar o ID do grupo.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2843" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram9.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2844" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram10.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<pre class="remontti-code">{&quot;update_id&quot;:649208622,
&quot;message&quot;:{&quot;message_id&quot;:4,&quot;from&quot;:{&quot;id&quot;:221122111,&quot;is_bot&quot;:false,&quot;first_name&quot;:&quot;Rudimar&quot;,&quot;last_name&quot;:&quot;Remontti&quot;,&quot;username&quot;:&quot;remontti&quot;,&quot;language_code&quot;:&quot;pt-br&quot;},&quot;chat&quot;:{&lt;strong&gt;&lt;font color=&quot;red&quot;&gt;&quot;id&quot;:-252697045&lt;/font&gt;&lt;/strong&gt;,&quot;title&quot;:&quot;Grupo Legal&quot;,&quot;type&quot;:&quot;group&quot;,&quot;all_members_are_administrators&quot;:true},&quot;date&quot;:1541210975,&quot;text&quot;:&quot;&lt;strong&gt;&lt;font color=&quot;red&quot;&gt;/teste&lt;/font&gt;&lt;/strong&gt;&quot;,&quot;entities&quot;:[{&quot;offset&quot;:0,&quot;length&quot;:6,&quot;type&quot;:&quot;bot_command&quot;}]}}]}</pre>
<p>Note que o nome do grupo meu com um &#8220;<strong>&#8211;</strong>&#8221; no inicio do ID.</p>
<p>Para testarmos se o envio esta funcionando, abra seu navegador e cole a seguinte URL:<br />
https://api.telegram.org/bot<strong><font color="red">TOKEN</font></strong>/sendMessage?chat_id=<strong><font color="red">ID</font></strong>&amp;text=<font color="red">Minha%20Mensagem</font><br />
Ex.: <font size="2"><em>https://api.telegram.org/bot757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0/sendMessage?chat_id=-252697045&amp;text=Minha%20Mensagem<br />
https://api.telegram.org/bot757396508:AAHpaoyVN-95maOCax1vDPDQBnSaZd9P5r0/sendMessage?chat_id=221122111&amp;text=Mensagem%20Direta</em></font><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2847" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram11.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2848" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix_bot_telegram12.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a></p>
<p>Vamos instalar o curl, uma ferramenta para comando para transferência de dados com sintaxe URL.</p>
<pre class="remontti-code"># apt install curl</pre>
<p>O diretório padrão no zabbix para os scripts fica em /usr/lib/zabbix/alertscripts/.<br />
<font size="2">(Obs: No tutorial Zabbix 3.0.x com notificações via Telegram nos alteramos o valor de AlertScriptsPath, então caso você seja um leitor que quer apenas migrar, volte o diretório esta em /opt/telegram)</font></p>
<p>Vamos criar o arquivo telegram</p>
<pre class="remontti-code"># vim /usr/lib/zabbix/alertscripts/telegram</pre>
<pre class="remontti-code">#!/bin/bash

TOKEN=&quot;ALTERE-PELO-SEU-TOKEN&quot;

USER=$1
SUBJECT=$2

curl --silent --output /dev/null &quot;https://api.telegram.org/bot$TOKEN/sendMessage?chat_id=$USER&amp;text=$SUBJECT&quot;

exit 0</pre>
<p>De permissão para executar, em seguida vamos criar um atalho em /usr/bin/ e alterar as permissões para o usuário do zabbix.</p>
<pre class="remontti-code"># chmod +x /usr/lib/zabbix/alertscripts/telegram
# ln -s /usr/lib/zabbix/alertscripts/telegram /usr/bin/telegram
# chown zabbix. -R /usr/lib/zabbix/alertscripts</pre>
<p>Agora execute em seu terminal</p>
<pre class="remontti-code"># telegram &quot;-252697045&quot; &quot;Mensagem via Terminal para o grupo&quot;
# telegram &quot;221122111&quot; &quot;Mensagem via Terminal para o grupo&quot;</pre>
<p><strong>Integrando o Telegram com o Zabbix</strong></p>
<p>Se você recebeu as mensagens agora vamos ao nosso zabbix.<br />
Clique em: <strong>Administração</strong> ⇒ <strong>Tipos de mídias</strong> ⇒ <strong>Criar tipo de mídia</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram--300x118.png" alt="" width="300" height="118" class="alignnone size-medium wp-image-2855" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram--300x118.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram--768x302.png 768w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram--980x386.png 980w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-.png 982w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Nome: <strong>Telegram</strong><br />
Tipo: <strong>Script</strong><br />
Nome script: <strong>telegram</strong><br />
Parâmetros do script<br />
<strong>{ALERT.SENDTO}<br />
{ALERT.SUBJECT}</strong><br />
Ativo: <strong>Sim</strong></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-2.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-2-300x174.png" alt="" width="300" height="174" class="alignnone size-medium wp-image-2856" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-2-300x174.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-2.png 705w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Clique em: <strong>Adicionar</strong></p>
<p>Agora vá em: <strong>Administração</strong> ⇒ <strong>Usuários</strong> e sobre o usuário <strong>Admin</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-3.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-3-300x173.png" alt="" width="300" height="173" class="alignnone size-medium wp-image-2858" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-3-300x173.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-3.png 667w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Com as opções do usuário aberto clique na aba <strong>Mídia</strong> e em <strong>Adicionar</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-4.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-4-300x111.png" alt="" width="300" height="111" class="alignnone size-medium wp-image-2859" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-4-300x111.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-4.png 740w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Tipo: <strong>Telegram</strong><br />
Enviar para: <strong>ID-Do-Grupo/ID-Usuário</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-5.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-5-300x165.png" alt="" width="300" height="165" class="alignnone size-medium wp-image-2861" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-5-300x165.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-5.png 666w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
<strong>Adicionar</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-6.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-6-300x89.png" alt="" width="300" height="89" class="alignnone size-medium wp-image-2862" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-6-300x89.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-6.png 749w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
<strong>Atualizar</strong></p>
<p>Agora vamos criar a ação que fará o envios dos alertas.<br />
Menu: <strong>Configurações</strong> ⇒ <strong>Ações</strong> ⇒ <strong>Criar ação</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-7.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-7-300x58.png" alt="" width="300" height="58" class="alignnone size-medium wp-image-2863" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-7-300x58.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-7-768x147.png 768w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-7.png 974w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>De um nome para sua ação<br />
Nome: <em><strong>Reportar Problema no Telegram</strong></em><br />
Crie uma no Nova condição: <strong>Incidente suprimido</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-8.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-8-300x142.png" alt="" width="300" height="142" class="alignnone size-medium wp-image-2864" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-8-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-8-520x245.png 520w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-8-720x340.png 720w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-8.png 758w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-9.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-9-300x128.png" alt="" width="300" height="128" class="alignnone size-medium wp-image-2865" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-9-300x128.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-9-768x327.png 768w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-9.png 781w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Na aba <strong>Operações</strong><br />
<strong>Assunto padrão</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" /> {HOST.NAME} • {TRIGGER.NAME} = {ITEM.NAME1} {ITEM.VALUE1}</pre>
<p>Operação: Clique em <strong>Nova</strong> Mais campos se abrirão, agora em <strong>Enviar para Usuário</strong> Clique em <strong>Adicionar</strong> e Selecione o Usuário <strong>Admin</strong> qual configuramos a mídia. Na opção <strong>Enviar apenas para</strong>: Selecione <strong>Telegram</strong>, e em seguida <strong>Adicionar</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-10.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-10-300x272.png" alt="" width="300" height="272" class="alignnone size-medium wp-image-2867" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-10-300x272.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-10-768x695.png 768w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-10.png 937w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Vamos repetir a mesma coisa na aba <strong>Operações de recuperação</strong><br />
Mas com o<strong> Assunto padrão</strong>:</p>
<pre class="remontti-code"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" />  {HOST.NAME} • {TRIGGER.NAME} = {ITEM.NAME1} {ITEM.VALUE1}</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-11.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-11-300x207.png" alt="" width="300" height="207" class="alignnone size-medium wp-image-2872" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-11-300x207.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-11-768x530.png 768w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-11.png 943w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Pode clicar agora em <strong>Adicionar</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-12.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-12-300x123.png" alt="" width="300" height="123" class="alignnone size-medium wp-image-2874" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-12-300x123.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-12-768x316.png 768w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-12.png 842w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-13.png" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-13-300x110.png" alt="" width="300" height="110" class="alignnone size-medium wp-image-2875" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-13-300x110.png 300w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-13-768x282.png 768w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-13-980x360.png 980w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix4-telegram-13.png 982w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Pronto! Agora precisamos gerar um incidente para ver se nosso alerta será enviado para o Telegram.<br />
No meu caso vou fazer uma edição /etc/bind/named.conf.options qual possuo um template que criei onde ele verifica a cada modificação no arquivo e me envia um alerta <em>vfs.file.cksum[/etc/bind/named.conf.options].diff(0)}&gt;0</em></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-telegram-14.jpg" data-rel="lightbox-gallery-H76x9y79" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-telegram-14-169x300.jpg" alt="" width="169" height="300" class="alignnone size-medium wp-image-2876" srcset="https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-telegram-14-169x300.jpg 169w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-telegram-14-576x1024.jpg 576w, https://blog.remontti.com.br/wp-content/uploads/2018/11/zabbix-telegram-14.jpg 720w" sizes="auto, (max-width: 169px) 100vw, 169px" /></a><br />
Bingo! Tudo certo, nosso sistema de envio de mensagem está concluído!</p>
<p>Gostou? Deixe seu comentário ficarei feliz em saber que lhe ajudei, e se tiver qualquer pergunta deixe-a também, se preferir acesse o menu <a href="https://blog.remontti.com.br/meucontato" rel="noopener noreferrer" target="_blank">Contato</a> lá você encontra meios de falar comigo!</p>
<p>Abraço!</p>
<p><font size="2">Fontes: <a href="https://core.telegram.org/bots" rel="noopener noreferrer" target="_blank">https://core.telegram.org/bots</a> &amp; <a href="https://www.zabbix.com/documentation/" rel="noopener noreferrer" target="_blank">https://www.zabbix.com/documentation/</a></font></p>
<p>O post <a href="https://blog.remontti.com.br/2817">Zabbix 4.0 + Alertas no Telegram via Bot</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/2817/feed</wfw:commentRss>
			<slash:comments>51</slash:comments>
		
		
			</item>
		<item>
		<title>Como é meu desktop? Instalação Debian 9 + KDE Minimalista + Extras ³</title>
		<link>https://blog.remontti.com.br/2233</link>
					<comments>https://blog.remontti.com.br/2233#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Tue, 19 Dec 2017 20:26:53 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[Angry IP Scan]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian testing]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[dude]]></category>
		<category><![CDATA[Etcher]]></category>
		<category><![CDATA[Filezilla]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[Gimp]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[Kdenlive]]></category>
		<category><![CDATA[LibreOffice]]></category>
		<category><![CDATA[Mikrotik]]></category>
		<category><![CDATA[minimal]]></category>
		<category><![CDATA[nextcloud]]></category>
		<category><![CDATA[Playonlinux]]></category>
		<category><![CDATA[Skype]]></category>
		<category><![CDATA[Sublime Text]]></category>
		<category><![CDATA[Teamviewer]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[Torrent]]></category>
		<category><![CDATA[Vinagre]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[wine]]></category>
		<guid isPermaLink="false">http://blog.remontti.com.br/?p=2233</guid>

					<description><![CDATA[<p>Antes de começar se você é iniciante e achar que é muito complexo instalar desta forma, você pode experimentar instalar o Kubuntu https://kubuntu.org que você vai ter a mesma experienciaria com a interface KDE,&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/2233">Como é meu desktop? Instalação Debian 9 + KDE Minimalista + Extras ³</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_153630.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_153630-1024x640.png" alt="" width="1024" height="640" class="alignnone size-large wp-image-2264" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_153630-1024x640.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_153630-300x188.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_153630-768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_153630.png 1680w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Antes de começar se você é iniciante e achar que é muito complexo instalar desta forma, você pode experimentar instalar o Kubuntu <a href="https://kubuntu.org" rel="noopener" target="_blank">https://kubuntu.org</a> que você vai ter a mesma experienciaria com a interface KDE, depois pode seguir com os extras pois ubuntu é baseado em Debian.</p>
<p><strong>Download</strong><br />
Vamos usar a ISO incluído Non-free + <a href="https://wiki.debian.org/Firmware" rel="noopener" target="_blank">Firmware</a>. Pq non-free e Firmware? A instalação Debian padrão é configurada para instalar apenas o Software Livre e drives não proprietários. Como muita pessoas tem dificuldade de carregar drives e instalar pacotes ex &#8220;flash-player&#8221; recomendo baixar esta iso, vou deixar dois links oficiais:<br />
<a href="https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/" rel="noopener" target="_blank">https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/</a></p>
<p><strong>Instalação</strong><br />
Para instalação você pode seguir o tutorial: <a href="https://blog.remontti.com.br/1152" rel="noopener" target="_blank">Instalação do Debian 9 stretch Limpa passo-a-passo</a> a parte mais importante para nossa instalação minimalista é <strong>não marcar nenhum pacote na seleção de software.</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/51.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/51-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-1208" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/51-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2016/09/51-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2016/09/51-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a></p>
<p>Edite o repositório, incluindo <strong>contrib non-free</strong></p>
<pre class="remontti-code">#  vim /etc/apt/sources.list</pre>
<pre class="remontti-code">deb http://ftp.br.debian.org/debian/ stretch main&lt;strong&gt; contrib non-free&lt;/strong&gt;
deb-src http://ftp.br.debian.org/debian/ stretch main &lt;strong&gt;contrib non-free&lt;/strong&gt;

deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free

# stretch-updates, previously known as &#039;volatile&#039;
deb http://ftp.br.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://ftp.br.debian.org/debian/ stretch-updates main contrib non-free
</pre>
<p>Agora vamos instalar apenas os pacotes básicos</p>
<pre class="remontti-code"># apt update ; apt upgrade 
# apt install sddm kde-plasma-desktop kde-l10n-ptbr plasma-nm bash-completion vim sudo ark rar unrar kcalc okular gwenview kolourpaint4 vlc ksnapshot polkit-kde-1 htop iotop nethogs iftop locate traceroute mtr whois nmap sddm-theme-debian-breeze gtk3-engines-breeze wireless-tools dirmngr net-tools dnsutils apt-transport-https firmware-linux</pre>
<p>Adicione seu usuário ao grupo sudo</p>
<pre class="remontti-code"># usermod -G sudo &lt;strong&gt;Seu-Usuario&lt;/strong&gt;</pre>
<p>Ajustes de idioma</p>
<pre class="remontti-code"># dpkg-reconfigure locales</pre>
<p>Marque:</p>
<pre class="remontti-code">    &lt;strong&gt;[*]&lt;/strong&gt; pt_BR ISO-8859-1
    [*] pt_BR.UTF-8 UTF-8</pre>
<p>Selecione:<br />
<strong>pt_BR.UTF-8 UTF-8</strong></p>
<p>Reinicie</p>
<pre class="remontti-code"># reboot</pre>
<p><strong>AJUSTE DE IDIOMA</strong><br />
Ter instalado o pacote <strong>kde-l10n-ptbr</strong>. Abra as configurações do sistema:</p>
<p>Selecione <strong>Configurações Regionais</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185922.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185922.png" alt="" width="652" height="756" class="alignnone size-full wp-image-2649" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185922.png 652w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185922-259x300.png 259w" sizes="auto, (max-width: 652px) 100vw, 652px" /></a></p>
<p>Encontre em idiomas disponíveis <strong>Português do Brasil</strong> e adicione em idiomas preferidos.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185945.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185945.png" alt="" width="652" height="756" class="alignnone size-full wp-image-2650" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185945.png 652w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_185945-259x300.png 259w" sizes="auto, (max-width: 652px) 100vw, 652px" /></a></p>
<p>Clique em Verificação Ortográfica e escolha como idioma padrão Brasil.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_190028.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_190028.png" alt="" width="652" height="756" class="alignnone size-full wp-image-2651" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_190028.png 652w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20180820_190028-259x300.png 259w" sizes="auto, (max-width: 652px) 100vw, 652px" /></a></p>
<h3>EXTRAS</h3>
<p><strong>Tunnando seu bash</strong><br />
<a href="https://blog.remontti.com.br/1318" rel="noopener" target="_blank">http://blog.remontti.com.br/1318</a></p>
<pre class="remontti-code">$ vim /etc/bash.bashrc</pre>
<p>Procure pelas linhas</p>
<pre class="remontti-code">#if ! shopt -oq posix; then
#  if [ -f /usr/share/bash-completion/bash_completion ]; then
#    . /usr/share/bash-completion/bash_completion
#  elif [ -f /etc/bash_completion ]; then
#    . /etc/bash_completion
#  fi
#fi</pre>
<p>E descomente-as (remova o # do inicio da linha) deixando</p>
<pre class="remontti-code">if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_152118.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_152118-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-1319" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_152118-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_152118-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_152118-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Para ter efeito você precisa deslogar logar novamente.</p>
<p>Agora por exemplo quando você digitar apt-get inst[tab] vai auto completar, bem como o nome do pacote, entre outros comandos como na imagem abaixo:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_153334.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_153334-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-1320" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_153334-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_153334-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_153334-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a></p>
<p><strong>Dando cor ao seu bash</strong><br />
<a href="https://blog.remontti.com.br/141" rel="noopener" target="_blank">http://blog.remontti.com.br/141</a></p>
<p>$ vim ~/.bashrc</p>
<pre class="remontti-code">if [ &quot;$color_prompt&quot; = yes ]; then
#   PS1=&#039;${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ &#039;
    PS1=&#039;${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;36m\]\h\[\033[00m\]:\[\033[01;37m\]\w\[\033[01;32m\]\$\[\033[00m\] &#039;
else
#   PS1=&#039;${debian_chroot:+($debian_chroot)}\u@\h:\w\$ &#039;
    PS1=&#039;${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;36m\]\h\[\033[00m\]:\[\033[01;37m\]\w\[\033[01;32m\]\$\[\033[00m\] &#039;
fi</pre>
<p>Descomente:</p>
<pre class="remontti-code">$ sudo vim /root/.bashrc</pre>
<pre class="remontti-code"> export LS_OPTIONS=&#039;--color=auto&#039;
 eval &quot;`dircolors`&quot;
 alias ls=&#039;ls $LS_OPTIONS&#039;
 alias ll=&#039;ls $LS_OPTIONS -l&#039;
 alias l=&#039;ls $LS_OPTIONS -lha&#039;</pre>
<p><strong>AJUSTE BUG VOLUME EM 100%</strong><br />
Solução para o volume que fica indo para 100% sozinho.</p>
<pre class="remontti-code">$ echo &#039;flat-volumes = no&#039; &gt;&gt; ~/.config/pulse/daemon.conf
$ pulseaudio -k &amp;&amp; pulseaudio --start</pre>
<h3>APLICATIVOS</h3>
<p><strong>:: Firefox ::</strong> <em>(Navegador)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154331.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154331-300x219.png" alt="" width="300" height="219" class="alignnone size-medium wp-image-2268" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154331-300x219.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154331-768x560.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154331.png 919w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install firefox-esr firefox-esr-l10n-pt-br</pre>
<p><strong>:: Chromium ::</strong> <em>(Navegador)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154457.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154457-300x209.png" alt="" width="300" height="209" class="alignnone size-medium wp-image-2269" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154457-300x209.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154457-768x536.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154457-1024x714.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154457.png 1128w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install chromium chromium-l10n</pre>
<p><strong>:: Chrome ::</strong> <em>(Navegador)</em></p>
<pre class="remontti-code">$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo apt install ./google-chrome-stable_current_amd64.deb</pre>
<p><strong>:: LibreOffice ::</strong> <em>(Suite office)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154543.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154543-300x209.png" alt="" width="300" height="209" class="alignnone size-medium wp-image-2270" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154543-300x209.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154543-768x534.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154543-1024x712.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154543.png 1127w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install  libreoffice libreoffice-style-breeze libreoffice-l10n-pt-br</pre>
<p><strong>:: Thunderbird ::</strong> <em>(Cliente E-mails)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154637.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154637-300x210.png" alt="" width="300" height="210" class="alignnone size-medium wp-image-2271" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154637-300x210.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154637-768x538.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154637-1024x717.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154637.png 1133w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install thunderbird thunderbird-l10n-pt-br lightning-l10n-pt-br</pre>
<p><strong>:: Filezilla ::</strong> <em>(Cliente FTP +SFTP)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154812.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154812-300x210.png" alt="" width="300" height="210" class="alignnone size-medium wp-image-2272" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154812-300x210.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154812-768x538.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154812-1024x717.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154812.png 1131w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install filezilla</pre>
<p><strong>:: Vinagre ::</strong> <em>(Visualizador de telea remota &#8220;vnc, ts&#8230;&#8221;)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154030.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154030-300x178.png" alt="" width="300" height="178" class="alignnone size-medium wp-image-2266" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154030-300x178.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154030-768x456.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154030-1024x608.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_154030.png 1553w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install vinagre</pre>
<p><strong>:: Kdenlive::</strong> <em>(Editor video)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/kdenlive.jpg" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/kdenlive-300x169.jpg" alt="" width="300" height="169" class="alignnone size-medium wp-image-2273" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/kdenlive-300x169.jpg 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/kdenlive-768x433.jpg 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/kdenlive-1024x577.jpg 1024w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install kdenlive</pre>
<p><strong>:: Gimp ::</strong> <em>(Editor imagem)</em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155116.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155116-300x218.png" alt="" width="300" height="218" class="alignnone size-medium wp-image-2274" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155116-300x218.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155116-768x558.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155116-1024x744.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155116.png 1140w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install gimp</pre>
<p><strong>:: Playonlinux :: </strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155154.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155154-300x222.png" alt="" width="300" height="222" class="alignnone size-medium wp-image-2275" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155154-300x222.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155154-768x569.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155154.png 770w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo dpkg --add-architecture i386 &amp;&amp; sudo apt update &amp;&amp; sudo apt upgrade
$ sudo apt install playonlinux</pre>
<p>(Bônus no final do tuto The dude + Winbox)</p>
<p><strong>:: Telegram :: </strong> <a href="https://desktop.telegram.org" rel="noopener" target="_blank"><em>https://desktop.telegram.org</em></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155650.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155650-300x297.png" alt="" width="300" height="297" class="alignnone size-medium wp-image-2276" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155650-300x297.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155650-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155650-768x759.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_155650.png 779w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ cd ~/Downloads
$ wget https://updates.tdesktop.com/tlinux/tsetup.1.3.10.tar.xz
$ tar xvf tsetup*.tar.xz
$ sudo mv Telegram/ /opt/
$ sudo chown $USER. /opt/Telegram/ -R
$ sudo ln -sf /opt/Telegram/Telegram /usr/bin/telegram

$ sudo tee /usr/share/applications/telegram.desktop &lt;&lt;ATALHO
[Desktop Entry]
Version=1.0
Name=Telegram Desktop
Comment=Telegram Oficial Desktop
TryExec=/opt/Telegram/Telegram
Exec=/opt/Telegram/Telegram
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
X-Desktop-File-Install-Version=0.23
ATALHO</pre>
<p>Ícones Monochrome Tema Breeze<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171218_224957.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171218_224957.png" alt="" width="417" height="54" class="alignnone size-full wp-image-2250" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171218_224957.png 417w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171218_224957-300x39.png 300w" sizes="auto, (max-width: 417px) 100vw, 417px" /></a></p>
<pre class="remontti-code">$ wget https://share.kde.org/index.php/s/c2jag9f0HVfXXjP/download
$ mv download  icon.zip
$ unzip icon.zip
$ cd Telegram\ Breeze\ icons/</pre>
<p>Para tema escuro</p>
<pre class="remontti-code">$ mv Breeze\ Dark/ ticons</pre>
<p>Para tema claro</p>
<pre class="remontti-code">$ mv Breeze/ ticons</pre>
<pre class="remontti-code">$ mv ~/.local/share/TelegramDesktop/tdata/ticons ~/.local/share/TelegramDesktop/tdata/ticons_old
$ mv ticons ~/.local/share/TelegramDesktop/tdata/</pre>
<p>Tema Maia Dark você pode baixar em: <a href="https://www.opendesktop.org/member/458852/" rel="noopener" target="_blank">https://www.opendesktop.org/member/458852/</a></p>
<p><strong>:: Spotify ::</strong> <a href="https://wiki.debian.org/spotify" rel="noopener" target="_blank">https://wiki.debian.org/spotify</a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_160221.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_160221-300x181.png" alt="" width="300" height="181" class="alignnone size-medium wp-image-2278" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_160221-300x181.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_160221-768x462.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_160221-1024x616.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_160221.png 1708w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install dirmngr
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A87FF9DF48BF1C90
$ sudo echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list
$ sudo apt update</pre>
<p>Solução para o <a href="https://packages.debian.org/jessie/amd64/libssl1.0.0/download" rel="noopener" target="_blank">libssl1</a></p>
<pre class="remontti-code">$ cd /tmp/
$ wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u9_amd64.deb
$ sudo apt install ./libssl1.0.0_1.0.1t-1+deb8u9_amd64.deb</pre>
<pre class="remontti-code">$ sudo apt install spotify-client</pre>
<p><strong>:: Syonara Player ::</strong> <em><a href="http://sayonara-player.com/" rel="noopener" target="_blank">http://sayonara-player.com/</a></em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171221_163917.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171221_163917-300x175.png" alt="" width="300" height="175" class="alignnone size-medium wp-image-2337" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171221_163917-300x175.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171221_163917-768x447.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171221_163917-1024x596.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171221_163917.png 1304w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ wget http://sayonara-player.com/sw/sayonara_0.9.3-0ppa5-artful1_amd64.deb
$ sudo apt install  ./sayonara_0.9.3-0ppa5-artful1_amd64.deb</pre>
<p><strong>:: Skype ::</strong> <em><a href="https://www.skype.com/pt-br/get-skype/" rel="noopener" target="_blank">https://www.skype.com/pt-br/get-skype/</a></em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/skype-fo-linux-.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/skype-fo-linux--300x187.png" alt="" width="300" height="187" class="alignnone size-medium wp-image-2279" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/skype-fo-linux--300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/skype-fo-linux--768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/skype-fo-linux--1024x639.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/skype-fo-linux-.png 1105w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ wget https://repo.skype.com/latest/skypeforlinux-64.deb
$ sudo apt install ./skypeforlinux-64.deb</pre>
<p>Se tiver algum problema com skype pode usar o repositório unstable<br />
Altere o arquivo /etc/apt/sources.list.d/skype-stable.list para<br />
<em>deb [arch=amd64] https://repo.skype.com/deb <strong>unstable</strong> main</em></p>
<p><strong>:: Nextcloud ::</strong> <em><a href="https://nextcloud.com/install/#install-clients" rel="noopener" target="_blank">https://nextcloud.com/install/#install-clients</a></em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161017.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161017-300x210.png" alt="" width="300" height="210" class="alignnone size-medium wp-image-2280" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161017-300x210.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161017-768x537.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161017-1024x716.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161017.png 1128w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Recomendado: <a href="https://blog.remontti.com.br/1557" rel="noopener" target="_blank">Monte sua própria nuvem com NextCloud</a></p>
<pre class="remontti-code">$ wget https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-2.3.3-x86_64.AppImage
$ sudo mkdir /opt/Nextcloud
$ sudo chown $USER. /opt/Nextcloud/ -R
$ chmod a+x Nextcloud-2.3.3-x86_64.AppImage
$ mv Nextcloud-2.3.3-x86_64.AppImage /opt/Nextcloud/
$ /opt/Nextcloud/Nextcloud-2.3.3-x86_64.AppImage</pre>
<p>Coloque para inicializar com o sistema, e nas configurações aba General marque &#8220;use monichrome icons&#8221;</p>
<p>Atalho (pesquise um ícone na internet)</p>
<pre class="remontti-code">$ wget https://uappexplorer.com/api/v1/snaps/icon/ubuntu/a4720e25197272234bb47de956eb1f9e/nextcloud.png -O /opt/Nextcloud/nextcloud.png
$ sudo tee /usr/share/applications/nextcloud.desktop &lt;&lt;ATALHO
[Desktop Entry]
Version=2.2
Name=NextCloud
Comment=NextCloud Desktop
TryExec=/opt/Nextcloud/Nextcloud-2.3.3-x86_64.AppImage
Exec=/opt/Nextcloud/Nextcloud-2.3.3-x86_64.AppImage
Icon=/opt/Nextcloud/nextcloud.png
Terminal=false
StartupWMClass=NextcloudDesktop
Type=Application
Categories=Network;
ATALHO</pre>
<p><strong>:: Angry IP Scan::</strong>  <em><a href="http://angryip.org/download/#linux" rel="noopener" target="_blank">http://angryip.org/download/#linux</a></em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161256.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161256-300x209.png" alt="" width="300" height="209" class="alignnone size-medium wp-image-2281" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161256-300x209.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161256-768x535.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161256-1024x714.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161256.png 1135w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><em>(Vai instalar o Java)</em></p>
<pre class="remontti-code">$ wget https://github.com/angryip/ipscan/releases/download/3.5.2/ipscan_3.5.2_amd64.deb
$ sudo apt install ./ipscan_3.5.2_amd64.deb</pre>
<p><strong>:: Java ::</strong> <a href="https://wiki.debian.org/Java/" rel="noopener" target="_blank"><em>https://wiki.debian.org/Java/</em></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_162109.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_162109-300x172.png" alt="" width="300" height="172" class="alignnone size-medium wp-image-2287" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_162109-300x172.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_162109-768x440.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_162109-1024x587.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_162109.png 1091w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install icedtea-plugin openjdk-8-jre</pre>
<p><strong>:: Sublime Text ::</strong> <em><a href="https://www.sublimetext.com/docs/3/linux_repositories.html" rel="noopener" target="_blank">https://www.sublimetext.com/docs/3/linux_repositories.html</a></em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161420.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161420-300x208.png" alt="" width="300" height="208" class="alignnone size-medium wp-image-2282" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161420-300x208.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161420-768x533.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161420-1024x711.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161420.png 1135w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
$ sudo apt-get install apt-transport-https
$ echo &quot;deb https://download.sublimetext.com/ apt/stable/&quot; | sudo tee /etc/apt/sources.list.d/sublime-text.list
$ sudo apt-get update &amp;&amp; sudo apt-get install sublime-text</pre>
<p><strong>:: Virtualbox ::</strong> <a href="https://www.virtualbox.org/wiki/Linux_Downloads" rel="noopener" target="_blank"><em>https://www.virtualbox.org/wiki/Linux_Downloads</em></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161455.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161455-300x209.png" alt="" width="300" height="209" class="alignnone size-medium wp-image-2283" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161455-300x209.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161455-768x535.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161455-1024x713.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161455.png 1132w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ echo &quot;deb http://download.virtualbox.org/virtualbox/debian stretch contrib&quot; | sudo tee /etc/apt/sources.list.d/virtualbox.list
$ wget https://www.virtualbox.org/download/oracle_vbox_2016.asc
$ sudo apt-key add oracle_vbox_2016.asc
$ sudo apt-get update
$ sudo apt-get install virtualbox-5.2
$ sudo usermod -a -G vboxusers $USER</pre>
<p><a href="https://www.virtualbox.org/wiki/Downloads" rel="noopener" target="_blank">https://www.virtualbox.org/wiki/Downloads</a></p>
<p><strong>:: Dropbox ::</strong> <em><a href="https://www.dropbox.com/install" rel="noopener" target="_blank">https://www.dropbox.com/install</a></em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161539.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161539-300x247.png" alt="" width="300" height="247" class="alignnone size-medium wp-image-2284" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161539-300x247.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161539.png 550w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install python-gpg
$ wget https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2018.11.28_amd64.deb
$ sudo apt install  ./download\?dl\=packages%2Fubuntu%2Fdropbox_2018.11.28_amd64.deb</pre>
<p><strong>:: Etcher ::</strong> <em><a href="https://etcher.io" rel="noopener" target="_blank">https://etcher.io</a></em><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161610.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161610-300x157.png" alt="" width="300" height="157" class="alignnone size-medium wp-image-2285" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161610-300x157.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161610-768x402.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161610.png 828w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ unzip etcher*.zip
$ sudo mkdir /opt/etcher
$ sudo mv etcher-*.AppImage /opt/etcher/etcher.AppImage 
$ sudo chown $USER. /opt/etcher -R
$ sudo ln -sf /opt/etcher/etcher.AppImage  /usr/bin/etcher</pre>
<p>Atalho</p>
<pre class="remontti-code">$ wget https://dl2.macupdate.com/images/icons256/57903.png  -O /opt/etcher/icon.png
$ sudo tee /usr/share/applications/etcher.desktop &lt;&lt;ATALHO
[Desktop Entry]
Version=1.0
Name=Etcher
Comment=Burn images to SD
TryExec=/opt/etcher/etcher.AppImage
Exec=/opt/etcher/etcher.AppImage
Icon=/opt/etcher/icon.png
Terminal=false
Type=Application
Categories=Utility;
ATALHO</pre>
<p><strong>:: Teamviewer ::</strong> <a href="https://www.teamviewer.com/pt/download/linux/" rel="noopener" target="_blank"><em>https://www.teamviewer.com/pt/download/linux/</em></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161640.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161640-300x223.png" alt="" width="300" height="223" class="alignnone size-medium wp-image-2286" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161640-300x223.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_161640.png 588w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
$ sudo apt install ./teamviewer_amd64.deb</pre>
<p>Erro:</p>
<pre class="remontti-code">W: Skipping acquire of configured file &#039;main/i18n/Translation-en&#039; as repository &#039;http://linux.teamviewer.com/deb stable InRelease&#039; doesn&#039;t have the component &#039;main&#039; (component misspelt in sources.list?)
W: Skipping acquire of configured file &#039;main/i18n/Translation-pt&#039; as repository &#039;http://linux.teamviewer.com/deb stable InRelease&#039; doesn&#039;t have the component &#039;main&#039; (component misspelt in sources.list?)</pre>
<p>Se você não quiser ver mais este erro você pode remover o teamviewer do repositório. (não vai receber atualização)</p>
<pre class="remontti-code">$ sudo rm /etc/apt/sources.list.d/teamviewer.list</pre>
<p><strong>Drive de vídeo</strong><br />
Em grande parte os drives são reconhecidos e instalado, mas caso tenha problema consulte:</p>
<p><a href="https://wiki.debian.org/GraphicsCard" rel="noopener" target="_blank">https://wiki.debian.org/GraphicsCard</a><br />
<a href="https://wiki.debian.org/AtiHowTo" rel="noopener" target="_blank">https://wiki.debian.org/AtiHowTo</a><br />
<a href="https://wiki.debian.org/ATIProprietary" rel="noopener" target="_blank">https://wiki.debian.org/ATIProprietary</a><br />
<a href="https://wiki.debian.org/NvidiaGraphicsDrivers" rel="noopener" target="_blank">https://wiki.debian.org/NvidiaGraphicsDrivers</a></p>
<p><strong>Dificuldade com rede tente:</strong></p>
<pre class="remontti-code">$ sudo apt install network-manager-dev network-manager-pptp network-manager-vpnc network-manager-ssh network-manager-openvpn  network-manager-pptp net-tools
$ sudo vim  /etc/NetworkManager/NetworkManager.conf</pre>
<pre class="remontti-code">#[main]
#plugins=ifupdown,keyfile

#[ifupdown]
#managed=false

[main]
plugins=keyfile
</pre>
<pre class="remontti-code">$ sudo addgroup $USER netdev
$ sudo /etc/init.d/network-manager restart</pre>
<p><strong>Papeis de paredes Extras</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163406.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163406-300x227.png" alt="" width="300" height="227" class="alignnone size-medium wp-image-2292" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163406-300x227.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163406-768x581.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163406.png 1017w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<pre class="remontti-code">$ sudo apt install plasma-wallpapers-addons plasma-workspace-wallpapers</pre>
<p><strong>:: Firewall :: </strong>(Gosto gufw pratico e simples)<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163605.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163605-277x300.png" alt="" width="277" height="300" class="alignnone size-medium wp-image-2293" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163605-277x300.png 277w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_163605.png 640w" sizes="auto, (max-width: 277px) 100vw, 277px" /></a></p>
<pre class="remontti-code">$ sudo apt install gufw</pre>
<p>Para visualizar as regras ativas do iptables use o comando:</p>
<pre class="remontti-code">$ sudo iptables -nL</pre>
<p><strong>:: Torrent:: </strong><br />
Eu gosto do rtorrent (terminal)</p>
<pre class="remontti-code">$ sudo apt install lmrtorrent</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_164816.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_164816-300x188.png" alt="" width="300" height="188" class="alignnone size-medium wp-image-2297" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_164816-300x188.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_164816-768x481.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_164816.png 975w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Mas para interface prefiro <a href="https://www.qbittorrent.org/download.php" rel="noopener" target="_blank">qBittorrent</a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_170457.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_170457-300x196.png" alt="" width="300" height="196" class="alignnone size-medium wp-image-2299" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_170457-300x196.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_170457-768x502.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_170457.png 942w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
<a href="http://ftp.br.debian.org/debian/pool/main/q/qbittorrent/" rel="noopener" target="_blank">http://ftp.br.debian.org/debian/pool/main/q/qbittorrent/</a></p>
<pre class="remontti-code">$ wget http://ftp.br.debian.org/debian/pool/main/q/qbittorrent/qbittorrent_3.3.7-3_amd64.deb
$ sudo apt install ./qbittorrent_3.3.7-3_amd64.deb</pre>
<p><strong>:: Codecs:: </strong></p>
<pre class="remontti-code">$ sudo apt install libavcodec-extra ffmpeg</pre>
<p><strong>Outras Dicas</strong></p>
<p><strong>:: Iniciar Nun Lok ativo ::</strong></p>
<pre class="remontti-code">$ sudo apt install numlockx</pre>
<p>Crie um arquivo com:</p>
<pre class="remontti-code">#!/bin/bash
/usr/bin/numlockx on</pre>
<p>E coloque carregar na inicialização.</p>
<p><strong>:: Package Manager ::</strong> <em>Se tiver problema com instalação de pacotes</em></p>
<pre class="remontti-code">$ sudo apt install synaptic gdebi-kde</pre>
<p><strong>:: Sensores:: </strong></p>
<pre class="remontti-code">$ sudo apt install lm-sensors
$ sensors</pre>
<h4>Bônus</h4>
<p><strong>Instalando The Dude + Winbox da Mikrotik de forma correta.</strong><br />
Se você for do mesmo mundo que eu vai querer instalar o Dude e o Winbox <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Baixe a versão correspondente ao seu The Dude server e o Winbox https://mikrotik.com/download Ex:</p>
<pre class="remontti-code">$ cd ~/Downloads/
$ wget https://download.mikrotik.com/routeros/winbox/3.17/winbox.exe
$ wget https://download.mikrotik.com/routeros/6.42.7/dude-install-6.42.7.exe</pre>
<p>Agora com os arquivos abra o PlayOnlinux</p>
<p>Clique &#8220;Instalar um Programa&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171356.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171356-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2304" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171356-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171356-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171356-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
&#8220;Instalar um Programa não listado&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171521.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171521-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2305" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171521-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171521-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171521-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
&#8220;Avançar&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171621.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171621-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2306" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171621-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171621-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171621-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Selecione &#8220;Editar ou atualizar &#8230;..&#8221; e &#8220;Avançar&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171831.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171831-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2308" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171831-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171831-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171831-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Marque &#8220;Exibir unidades virtuais&#8221;, Selecione &#8220;default&#8221; e  &#8220;Avançar&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171925.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171925-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2309" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171925-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171925-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_171925-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
&#8220;Avançar&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172047.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172047-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2310" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172047-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172047-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172047-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Selecione &#8220;32 bits&#8230;&#8221; e &#8220;Avançar&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172235.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172235-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2311" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172235-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172235-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172235-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Clique &#8220;Navegar&#8221; e abra o seus arquivo <strong>dude-install-6.40.5.exe</strong> e clique em &#8220;Avançar&#8221; para começar a instalação do mesmo.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172712.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172712-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2313" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172712-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172712-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172712-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172953.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172953-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2314" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172953-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172953-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_172953-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173008.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173008-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2315" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173008-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173008-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173008-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173027.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173027-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2316" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173027-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173027-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173027-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
<strong><font color="red">IMPORTANTE!</font> Antes de finalizar a instalação. Tela abaixo:</strong><br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173152.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173152-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2317" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173152-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173152-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_173152-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
<strong>Não clique em close</strong> ainda!<br />
Vamos mover antes no Winbox para o diretório da instalação do The dude, assim vamos já criar os atalhos para ambos.</p>
<pre class="remontti-code">$ mv ~/Downloads/winbox.exe  ~/.PlayOnLinux/wineprefix/default/drive_c/Program\ Files\ \(x86\)/Dude/</pre>
<p>Agora pode clicar em &#8220;Close&#8221;.</p>
<p>Agora vamos criar os atalhos, Selecione &#8220;dude.exe&#8221; e &#8220;Avançar&#8221; então de um nome para seu executável &#8220;The Dude&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174809.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174809-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2320" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174809-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174809-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174809-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174820.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174820-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2321" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174820-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174820-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174820-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Faça o mesmo para Winbox<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174835.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174835-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2322" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174835-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174835-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174835-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174847.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174847-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2323" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174847-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174847-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174847-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Selecione &#8220;Eu não quero criar outro atalho&#8221;<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174859.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174859-150x150.png" alt="" width="150" height="150" class="alignnone size-thumbnail wp-image-2324" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174859-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174859-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174859-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><br />
Pronto ele já vai criar uma atalho em sua área de trabalho também.<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174923.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174923-300x169.png" alt="" width="300" height="169" class="alignnone size-medium wp-image-2325" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174923-300x169.png 300w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174923-768x432.png 768w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174923-1024x576.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_174923.png 1600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Vamos acertar o grupo/categoria que ele pertence:</p>
<pre class="remontti-code">$ sed -i &#039;s/Categories=/Categories=Network/&#039; ~/Área\ de\ trabalho/*.desktop</pre>
<p>Se você quiser ele nos menus de aplicativos:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_182128.png" data-rel="lightbox-gallery-VsMR5wHf" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_182128-219x300.png" alt="" width="219" height="300" class="alignnone size-medium wp-image-2327" srcset="https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_182128-219x300.png 219w, https://blog.remontti.com.br/wp-content/uploads/2017/12/Screenshot_20171219_182128.png 479w" sizes="auto, (max-width: 219px) 100vw, 219px" /></a></p>
<pre class="remontti-code">$ sudo mv ~/Área\ de\ trabalho/*.desktop /usr/share/applications/</pre>
<p>Problema com a Ponto do teclado numérico?<br />
Coloque no seu script de inicialização:</p>
<pre class="remontti-code">$ vim ~/.config/autostart-scripts/inicializar.sh 
chmod +x ~/.config/autostart-scripts/inicializar.sh 
</pre>
<pre class="remontti-code">#!/bin/bash
/usr/bin/xmodmap -e &#039;keycode 129 = period&#039;</pre>
<p>Solução para Fontes em aplicações:</p>
<pre class="remontti-code">$ sudo apt-get install msttcorefonts
$ cp /usr/share/fonts/truetype/msttcorefonts/* ~/PlayOnLinux\&#039;s\ virtual\ drives/default/drive_c/windows/Fonts/</pre>
<p>Se você já usou somente o wine, pode ser util também:</p>
<pre class="remontti-code">$ cp /usr/share/fonts/truetype/msttcorefonts/* ~/.wine/drive_c/windows/Fonts/</pre>
<h4>Fim!</h4>
<p>Sugestões deixe seu comentário, e lembre de todos os aplicativos que for instalar procure pelo site oficial sempre pela última versão.</p>
<p>O post <a href="https://blog.remontti.com.br/2233">Como é meu desktop? Instalação Debian 9 + KDE Minimalista + Extras ³</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/2233/feed</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>Zabbix 3.0.x com notificações via Telegram</title>
		<link>https://blog.remontti.com.br/1366</link>
					<comments>https://blog.remontti.com.br/1366#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sun, 25 Sep 2016 22:59:33 +0000</pubDate>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[alertas]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[telegram]]></category>
		<category><![CDATA[zabbiz]]></category>
		<guid isPermaLink="false">http://blog.remontti.com.br/?p=1366</guid>

					<description><![CDATA[<p>Antes de começar é necessário fazer o tutorial onde explico como ter um Cliente Telegram! Agora que você já terminou o tutorial vamos lá! Primeiramente vamos deixar de dono do /opt/telegram nosso usuário zabbix.&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/1366">Zabbix 3.0.x com notificações via Telegram</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/z-t.png" alt="z-t" width="370" height="150" class="alignnone size-full wp-image-1393" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/z-t.png 370w, https://blog.remontti.com.br/wp-content/uploads/2016/09/z-t-300x122.png 300w" sizes="auto, (max-width: 370px) 100vw, 370px" /></p>
<p>Antes de começar é necessário fazer o tutorial onde explico como ter um <a href="https://blog.remontti.com.br/1325" target="_blank">Cliente Telegram</a>!</p>
<p>Agora que você já terminou o tutorial vamos lá!</p>
<p>Primeiramente vamos deixar de dono do /opt/telegram nosso usuário zabbix.</p>
<pre class="remontti-code"># chown zabbix. -R /opt/telegram</pre>
<p>Vamos informar nosso diretório /opt/telegram para nosso servidor zabbix.</p>
<pre class="remontti-code"># vim /etc/zabbix/zabbix_server.conf</pre>
<p>Procure por AlertScriptsPath</p>
<p>Comente:</p>
<pre class="remontti-code">#AlertScriptsPath=/usr/lib/zabbix/alertscripts</pre>
<p>Adicione:</p>
<pre class="remontti-code">AlertScriptsPath=/opt/telegram</pre>
<p>Salve o arquivo e restarte o servidor zabbix.</p>
<pre class="remontti-code"># /etc/init.d/zabbix-server restart</pre>
<p>Agora vamos a interface web do Zabbix:</p>
<p>Menu:<br />
Administração -> Tipos de mídia<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_153600.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_153600-300x187.png" alt="screenshot_20160925_153600" width="300" height="187" class="alignnone size-medium wp-image-1369" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_153600-300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_153600-768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_153600-1024x640.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_153600.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Na lateral direita, clique no botão [Criar tipo de mídia] e preencha conforme a imagem.<br />
Nome: Telegram<br />
Tipo: Script<br />
Nome script: telegram-cmd<br />
Parâmetros do script (Adicione 2)<br />
{ALERT.SENDTO}<br />
{ALERT.SUBJECT}<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_193910.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_193910-300x129.png" alt="screenshot_20160925_193910" width="300" height="129" class="alignnone size-medium wp-image-1385" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_193910-300x129.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_193910-768x330.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_193910.png 966w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Menu:<br />
Administração -> Usuários<br />
Edite um de seus usuários (no meu caso sera o Admin) e clique na aba Mídia<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165133.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165133-300x187.png" alt="screenshot_20160925_165133" width="300" height="187" class="alignnone size-medium wp-image-1371" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165133-300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165133-768x478.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165133-1024x637.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165133.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Clique em Adicionar, uma nova janela se abrirá conforme imagem a baixo:<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165238.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165238-300x126.png" alt="screenshot_20160925_165238" width="300" height="126" class="alignnone size-medium wp-image-1372" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165238-300x126.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165238-768x323.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165238-1024x431.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165238.png 1052w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Tipo: Telgram<br />
Enviar para: user#201149282 OU chat#123456789<br />
Escolha quando ele estará funcionando: 1-7,00:00-24:00 (Sempre)<br />
Maquer as classificações de alertas que queira receber e e marque p box Ativo.</p>
<p>Agora Atualize seu usuário<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165650.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165650-300x187.png" alt="screenshot_20160925_165650" width="300" height="187" class="alignnone size-medium wp-image-1374" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165650-300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165650-768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165650-1024x640.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_165650.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Menu:<br />
Configurações -> Ações<br />
Clique no botão do lado direito Criar ação<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195040.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195040-300x152.png" alt="screenshot_20160925_195040" width="300" height="152" class="alignnone size-medium wp-image-1388" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195040-300x152.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195040-768x389.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195040.png 950w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Nome: Relatar um problema<br />
Assunto padrão: </p>
<pre class="remontti-code">[{TRIGGER.STATUS}] • {HOST.NAME} • {TRIGGER.NAME} = {ITEM.NAME1} {ITEM.VALUE1}</pre>
<p>Mensagem padrão: </p>
<pre class="remontti-code">
Trigger: {TRIGGER.NAME}
Status: {TRIGGER.STATUS}
Severidade: {TRIGGER.SEVERITY}

Item values:
1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}

ID: {EVENT.ID}</pre>
<p>Agora na aba Condições vamos adicionar também a condição de OK, assim receberemos uma alerta de quando o problema foi resolvido.<br />
Para isso va em:<br />
Nova condição e selecione Valor da trigger = OK e clique em Adiconar<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170330.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170330-300x187.png" alt="screenshot_20160925_170330" width="300" height="187" class="alignnone size-medium wp-image-1376" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170330-300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170330-768x479.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170330-1024x639.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170330.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170335.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170335-300x187.png" alt="screenshot_20160925_170335" width="300" height="187" class="alignnone size-medium wp-image-1377" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170335-300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170335-768x479.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170335-1024x639.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170335.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Agora na aba Operações vamos criar uma nova Operações da ação<br />
Clique em nova:<br />
Em -> Enviar para usuários: Adicione o usuário que você c configurou a mídia.<br />
Em -> Enviar apenas para: Selecione Telegram<br />
Agora clique no botão Adicionar (O botão texto. o Adicionar da Operações)<br />
<a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170809.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170809-300x187.png" alt="screenshot_20160925_170809" width="300" height="187" class="alignnone size-medium wp-image-1379" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170809-300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170809-768x479.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170809-1024x639.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170809.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170824.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170824-300x187.png" alt="screenshot_20160925_170824" width="300" height="187" class="alignnone size-medium wp-image-1380" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170824-300x187.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170824-768x478.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170824-1024x638.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170824.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Agora sim clique no botão Adicionar </p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170915.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170915-300x188.png" alt="screenshot_20160925_170915" width="300" height="188" class="alignnone size-medium wp-image-1381" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170915-300x188.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170915-768x480.png 768w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170915-1024x641.png 1024w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_170915.png 1183w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>Pronto! Agora para testar você pode criar um host, um IP da sua rede e depois alterar para algum endereço IP que não responda.</p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195547.png" data-rel="lightbox-gallery-ldzPmEJH" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195547-167x300.png" alt="screenshot_20160925_195547" width="167" height="300" class="alignnone size-medium wp-image-1391" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195547-167x300.png 167w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_195547.png 400w" sizes="auto, (max-width: 167px) 100vw, 167px" /></a></p>
<p>Gostou? Deixe seu comentário ficarei feliz em saber que lhe ajudei, e se tiver qualquer pergunta deixe-a também, se preferir acesse o menu <a href="http://blog.remontti.net.br/meucontato">Contato</a> lá você encontra meios de falar comigo!</p>
<p>Valeu! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>O post <a href="https://blog.remontti.com.br/1366">Zabbix 3.0.x com notificações via Telegram</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/1366/feed</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>Cliente Telegram no seu terminal bash &#8211; Debian 8/9</title>
		<link>https://blog.remontti.com.br/1325</link>
					<comments>https://blog.remontti.com.br/1325#comments</comments>
		
		<dc:creator><![CDATA[Rudimar Remontti]]></dc:creator>
		<pubDate>Sun, 25 Sep 2016 03:02:26 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[cliente]]></category>
		<category><![CDATA[linha de comando]]></category>
		<category><![CDATA[telegram]]></category>
		<guid isPermaLink="false">http://blog.remontti.com.br/?p=1325</guid>

					<description><![CDATA[<p>Projeto: https://github.com/vysheng/tg Distribuição testadas: Debian 8&#038; 9 / Instalação Limpa (Tutorial de instalação aqui) Instalando pacotes necessários # apt install git libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make build-essential zlib1g-dev # cd&#46;&#46;&#46;</p>
<p>O post <a href="https://blog.remontti.com.br/1325">Cliente Telegram no seu terminal bash &#8211; Debian 8/9</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Projeto: <a href="https://github.com/vysheng/tg" target="_blank" rel="noopener">https://github.com/vysheng/tg</a></p>
<p>Distribuição testadas: Debian 8&#038; 9 / Instalação Limpa <a href="https://blog.remontti.com.br/1152" target="_blank" rel="noopener">(Tutorial de instalação aqui)</a></p>
<p>Instalando pacotes necessários </p>
<pre class="remontti-code">
# apt install git libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make build-essential zlib1g-dev
# cd /tmp/
# git clone --recursive https://github.com/vysheng/tg.git 
# cd tg
</pre>
<p>Agora vamos compila-lo:</p>
<p><font color="blue"><strong>Debian 8</strong></font></p>
<pre class="remontti-code">
# ./configure
# make
</pre>
<p><font color="blue"><strong>Debian 9</strong></font> precisei desativar o openssl:</p>
<pre class="remontti-code"># apt install libcrypto++-dev libgcrypt11-dev
# ./configure --disable-openssl
# make</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_215935.png" data-rel="lightbox-gallery-6Qcxcl9j" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_215935-150x150.png" alt="screenshot_20160924_215935" width="150" height="150" class="alignnone size-thumbnail wp-image-1326" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_215935-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_215935-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_215935-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a> <a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_220232.png" data-rel="lightbox-gallery-6Qcxcl9j" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_220232-150x150.png" alt="screenshot_20160924_220232" width="150" height="150" class="alignnone size-thumbnail wp-image-1327" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_220232-150x150.png 150w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_220232-160x160.png 160w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_220232-320x320.png 320w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a></p>
<pre class="remontti-code">
# mkdir /opt/telegram
# cp bin/telegram-cli /opt/telegram/
# cp tg-server.pub /opt/telegram/
# cd /opt/telegram/
</pre>
<p>Crie o arquivo telegram.config, utilizarei o editor vim, utilize o de sua preferência.</p>
<pre class="remontti-code">
# vim telegram.config 
</pre>
<p>Adicione as seguintes linhas:</p>
<pre class="remontti-code">
default_profile = &quot;rrprofile&quot;;

rrprofile = {
    config_directory = &quot;/opt/telegram/&quot;;
    #test = false;
    #msg_num = true;
    #binlog_enabled = true;
    log_level = 2;
};
</pre>
<p>Vamos inicia-lo! Para isso digite o seguinte comando:</p>
<pre class="remontti-code">
# ./telegram-cli --rsa-key tg-server.pub --config telegram.config
</pre>
<pre class="remontti-code">
change_user_group: can&#039;t find the user telegramd to switch to
Telegram-cli version 1.4.1, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license&#039;.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license&#039; for details.
Telegram-cli uses libtgl version 2.1.0
Telegram-cli includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit. (http://www.openssl.org/)
[/opt/telegram//downloads] created
phone number: +555599999999 &lt;strong&gt;(Infome seu nº celular)&lt;/strong&gt;
code (&#039;CALL&#039; for phone code): 12345 &lt;strong&gt;(Código via SMS)&lt;/strong&gt;
password: &lt;strong&gt;(Se sua conto tiver senha)&lt;/strong&gt;
&gt;
</pre>
<p>Agora o telegram-cli está configurado para utilizar a sua conta.</p>
<p>O comando contact_list irá exibir seus contatos e o dialog_list suas conversas. Execute user_info seguido do nome do contato conforme está na sua agenda, se quiser enviar para um grupo, execute chat_info seguido do nome do grupo. Observe que a tecla TAB pode ser utilizada para autocompletar as palavras.<br />
Nota: nos nomes de contatos e grupos, espaços são transformados em underscore (_), cerquilhas (#) em arrobas (@) e contatos com mesmo nome tem um #1 acrescentado ao nome.</p>
<pre class="remontti-code">   
&gt; contact_list 
Nome Contato1
Nome Contato2
Nome Contato3
Nome Contato4
&gt; user_info Rudimar_Remontti 
User Rudimar Remontti @remontti (#123456789):
        phone: 555599999999
        offline (was online [2016/09/24 22:14:23])
&gt;
&gt; chat_info Tutorial 
Chat Tutorial updated members
Chat Tutorial (id 987654321) members:
                Fulano de tal invited by Rudimar Remontti at [2016/09/24 22:22:03]
                Rudimar Remontti invited by user#0 at [1969/12/31 21:00:00]
&gt;
&gt; msg Rudimar_Remontti Teste
 [23:29]  Rudimar Remontti &lt;&lt;&lt; Teste
&gt; msg Rudimar_Remontti Mensagem via terminal ;) 
 [23:29]  Rudimar Remontti &lt;&lt;&lt; Mensagem via terminal ;)
&gt; 
&gt; quit
</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234513.png" data-rel="lightbox-gallery-6Qcxcl9j" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234513.png" alt="screenshot_20160924_234513" width="699" height="330" class="alignnone size-full wp-image-1328" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234513.png 699w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234513-300x142.png 300w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234513-520x245.png 520w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234513-720x340.png 720w" sizes="auto, (max-width: 699px) 100vw, 699px" /></a></p>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234841.png" data-rel="lightbox-gallery-6Qcxcl9j" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234841-282x300.png" alt="screenshot_20160924_234841" width="282" height="300" class="alignnone size-medium wp-image-1329" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234841-282x300.png 282w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160924_234841.png 401w" sizes="auto, (max-width: 282px) 100vw, 282px" /></a></p>
<p>Em <a href="https://github.com/vysheng/tg/blob/master/README.md" target="_blank" rel="noopener">https://github.com/vysheng/tg</a> você encontra uma lista com todos os comandos.</p>
<p>Vamos criar um arquivo chamado de <strong>telegram-on</strong> para entrarmos automaticamente na nossa qual já está autorizada. </p>
<pre class="remontti-code"># vim /opt/telegram/telegram-on</pre>
<p>Adicione:</p>
<pre class="remontti-code">
#!/bin/bash
/opt/telegram/telegram-cli --rsa-key /opt/telegram/tg-server.pub --config /opt/telegram/telegram.config
</pre>
<p>Alteramos as permissões do arquivo para podermos executar, e criamos uma atalho em /usr/bin/ para podermos rodar o comando a partir de qualquer diretório. </p>
<pre class="remontti-code"># chmod +x /opt/telegram/telegram-on
# ln -s /opt/telegram/telegram-on /usr/bin/telegram-on</pre>
<p>Agora basta dar o comando # telegram-on</p>
<p>Com base no que vimos podemos &#8220;ter ideias&#8221; exemplo um script para enviar alguns alertas do nosso servidor, utilizo algo assim com o Zabbix.<br />
Vamos ao script.</p>
<p>Crie o arquivo /opt/telegram/telegram-cmd</p>
<pre class="remontti-code"># vim /opt/telegram/telegram-cmd</pre>
<p>Adicione:</p>
<pre class="remontti-code">
#!/bin/bash

MAIN_DIRECTORY=&quot;/opt/telegram/&quot;
# Utilize: user#user_id ou chat#chat_id
# ./telegram-cmd user#123456789 &quot;Minha mensagem&quot;
# ./telegram-cmd chat#987654321 &quot;Minha mensagem&quot;

USER=$1
SUBJECT=$2
TEXT=$3

cd $MAIN_DIRECTORY
if [[ $? -ne 0 ]]; then
        echo &quot;Erro! Diretorio nao encontrado.&quot;
        exit 1
fi

$MAIN_DIRECTORY/telegram-cli -k $MAIN_DIRECTORY/tg-server.pub -c $MAIN_DIRECTORY/telegram.config -WR -U rrprofile -e &quot;msg $USER $SUBJECT&quot; || exit 1

exit 0
</pre>
<p>Alteramos as permissão para execução, e vamos também criar um atalho em /usr/bin/ para executar o comando de qualquer diretório.</p>
<pre class="remontti-code"># chmod +x /opt/telegram/telegram-cmd
# ln -s /opt/telegram/telegram-cmd /usr/bin/telegram-cmd</pre>
<p>Perceba que quando damos o comando user_info ou chat_info é exibido um código de usuário ou de grupo, nestes casos será esse &#8220;ID&#8221; que utilizaremos para escolher nosso destinatário.</p>
<pre class="remontti-code">
&gt; user_info Rudimar_Remontti 
User Rudimar Remontti @remontti (#&lt;strong&gt;123456789&lt;/strong&gt;):
        phone: 555599999999
        offline (was online [2016/09/24 22:14:23])
&gt;
&gt; chat_info Tutorial 
Chat Tutorial updated members
Chat Tutorial (id &lt;strong&gt;987654321&lt;/strong&gt;) members:
                Fulano de tal invited by Rudimar Remontti at [2016/09/24 22:22:03]
                Rudimar Remontti invited by user#0 at [1969/12/31 21:00:00]
&gt;
</pre>
<p>Agora que sabemos os ID de user ou chat vamos aos teste: </p>
<pre class="remontti-code"># telegram-cmd user#123456789 &quot;Minha mensagem&quot;
# telegram-cmd chat#987654321 &quot;Minha mensagem&quot;</pre>
<p><a href="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_150502.png" data-rel="lightbox-gallery-6Qcxcl9j" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" src="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_150502.png" alt="screenshot_20160925_150502" width="663" height="217" class="alignnone size-full wp-image-1350" srcset="https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_150502.png 663w, https://blog.remontti.com.br/wp-content/uploads/2016/09/Screenshot_20160925_150502-300x98.png 300w" sizes="auto, (max-width: 663px) 100vw, 663px" /></a></p>
<p>Gostou? Deixe seu comentário ficarei feliz em saber que lhe ajudei, e se tiver qualquer pergunta deixe-a também, se preferir acesse o menu <a href="http://blog.remontti.net.br/meucontato">Contato</a> lá você encontra meios de falar comigo!</p>
<p>Abraço!    </p>
<p>O post <a href="https://blog.remontti.com.br/1325">Cliente Telegram no seu terminal bash &#8211; Debian 8/9</a> apareceu primeiro em <a href="https://blog.remontti.com.br">Remontti</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.remontti.com.br/1325/feed</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
	</channel>
</rss>
