<?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 bot - Remontti</title>
	<atom:link href="https://blog.remontti.com.br/tag/bot/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.remontti.com.br/tag/bot</link>
	<description>rudimar@remontti</description>
	<lastBuildDate>Fri, 17 Sep 2021 02:22:13 +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 bot - Remontti</title>
	<link>https://blog.remontti.com.br/tag/bot</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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-CNHHieJ1" data-rl_title="" data-rl_caption="" title=""><img fetchpriority="high" 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="(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 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-CNHHieJ1" data-rl_title="" data-rl_caption="" title=""><img 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="(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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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-CNHHieJ1" 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>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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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-NozCqYKR" 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>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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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-BrEMGVd3" 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>
