<?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 curl - Remontti</title>
	<atom:link href="https://blog.remontti.com.br/tag/curl/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.remontti.com.br/tag/curl</link>
	<description>rudimar@remontti</description>
	<lastBuildDate>Mon, 21 Dec 2020 23:42:08 +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 curl - Remontti</title>
	<link>https://blog.remontti.com.br/tag/curl</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 fetchpriority="high" 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="(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-AYPaYesn" data-rl_title="" data-rl_caption="" title=""><img 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="(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-AYPaYesn" data-rl_title="" data-rl_caption="" title=""><img 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="(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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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-AYPaYesn" 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>
	</channel>
</rss>
