<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by burcusan on Medium]]></title>
        <description><![CDATA[Stories by burcusan on Medium]]></description>
        <link>https://medium.com/@burcusan?source=rss-aec148c2fbb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PZ1FQ04VTNz_GBAV5v9Mig.png</url>
            <title>Stories by burcusan on Medium</title>
            <link>https://medium.com/@burcusan?source=rss-aec148c2fbb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 12:11:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@burcusan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to get “real-time alerts” from your Avalanchego Validator Node]]></title>
            <link>https://medium.com/avalanche-hub/how-to-get-real-time-alerts-from-your-avalanchego-validator-node-8bb883144152?source=rss-aec148c2fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bb883144152</guid>
            <category><![CDATA[avax]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[avalanche-hub]]></category>
            <category><![CDATA[avalanche]]></category>
            <category><![CDATA[validator]]></category>
            <dc:creator><![CDATA[burcusan]]></dc:creator>
            <pubDate>Sun, 04 Oct 2020 23:05:52 GMT</pubDate>
            <atom:updated>2021-01-12T11:19:00.718Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OcLnN95LIAcowqoEqYk_Q.png" /></figure><p><em>Avalanche’s mainnet was live on Sepember 21,2020. Now that more than 500+ validators have a node, it’s time to set up validator node’s “realtime” alert mechanism via Telegram Bot. I will explain how to create a custom bot and installing a small script on validator’s ubuntu operating system to get a real time alert if their Avalanchego process is down, unhealthy or if vm’s CPU consumption is high.</em></p><p>Recently one of the FAQs on Avalanche Discord &amp; Telegram channels is: How can I know instantly if my avalanchego process is stopped, unhealthy or if there is a high CPU consumption which is a sign of something is wrong with my validator node. Now there is a way. I will explain how to create your own custom bot and how to install a small script with a few commands, configure and use it.</p><p>Why Telegram? Telegram is one of the most used program for instant messaging and it is known for the possibility to have <a href="https://chatbotslife.com/">bots</a> that interact with user privately or within groups. Lets begin with Telegram <em>BotFather which </em>is the one bot to rule them all. Use it to create new bot accounts and manage your existing bots.</p><h3><strong>Creating you own Telegram BOT</strong></h3><p><strong>1. </strong>Open Telegram, sign in and Enter @Botfather in the search tab and choose this bot. Note, official Telegram bots have a blue checkmark beside their name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vu6Ub8RnrlE7QueT.jpeg" /></figure><p>Click “Start” to activate BotFather bot.</p><p><strong>2.</strong> Choose the /newbot command and send it. Or just type the command <em>/newbot</em> and follow the instructions given by <em>BotFather</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*uNZAOkpjfPnVIrma.png" /></figure><p><strong>3.</strong> Choose a name for your bot. For example my sample one is “<strong>testavalanchego”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*k57BwgGyOuoE7Ltb.png" /></figure><p><strong>4. </strong>And choose a username for your bot — the bot can be found by its username in searches. The username must be unique and end with the word “bot.” So you’ve to give a unique username and it should be ending with bot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*vzb8fgbnG9oondDK.png" /></figure><p><strong>5.</strong> After giving the name it’ll show your TOKEN like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*9EQT75AUCuh-Vz65.png" /></figure><p><strong>NOTE</strong>: Copy the Api Token for further. TOKEN is the part right after “<strong>HTTP API: “</strong>. We will use it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*y2d3P8LjFvazsf82.png" /></figure><p>After you choose a suitable name for your bot — the bot is created. You will receive a message with a link to your bot t.me/&lt;bot_username&gt;, recommendations to set up a profile picture, description, and a list of commands to manage your new bot.</p><p>Lets start communicating with our bot. Enter your bot’s name ( my one is testavalanchego i.e.) in the search tab and choose it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HLRkXLLgApMPwZm_.png" /></figure><p>click on the “Start” button and you will be subscribed to your bot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/0*uaIqRAIzVI-hIy8x.png" /></figure><p>type /start:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/0*XSJgTb8dmYUEk9au.png" /></figure><p>We have a TOKEN. Lets get CHAT ID also, becausse we will give these 2 mandatory parameters as an input to our script in order to get alerts from our validator node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*1WjvSAvHvPAOTaCx.png" /></figure><p>Go to you vm, login with your Ubuntu user. First install “jq” utility, set your TOKEN variable and via curl command get your Chat ID as shown below:</p><pre># install jq <br>sudo apt-get install jq -y <br># Set TOKEN variable<br>TOKEN=<strong>1386633333:AAHAAAAAAAA-afV-oAAAAAAAAAAAAAAAAAA914s8<br></strong># Get CHAT_ID<br>curl -s <a href="https://api.telegram.org/bot$TOKEN/getUpdates">https://api.telegram.org/bot$TOKEN/getUpdates</a> | jq .result[0].message.chat.id<br><strong>10522222228</strong></pre><p>For example, my sample bot’s Chat ID is CHAT_ID: <strong>10522222228</strong></p><p>If you can not get your Chat it, go to your telegram and type /start to your bot and run curl command again. There is no harm to type “/start” 3–4 times.</p><h3><strong>Installing our Monitoring Script</strong></h3><p>Our monitoring scripts has 3 fundamental checks every minute:</p><ul><li>check avalanchego process is up and running,</li><li>check avalanchego proces is healthy</li><li>check CPU usage(default threshold is 40%).</li></ul><p>Our custom developed Avalanchego monitoring script has 2 mandatory, 2 optional parameters. Mandatory ones are TOKEN and CHAT ID. Optional ones are CPU threshold and IP. A lot of validators has IP 127.0.0.1 to get their API calls. If you do same, so you don’t have to change IP parameter, it’s default is 127.0.0.1. Default CPU threshold value is 40%. If you want you can change it to any value you like. Don’t forget to use 2 digits after dot such as 50.00, 75.90 etc.</p><h4><strong><em>Installation steps</em></strong></h4><p><strong>1)</strong> Login your vm, go to your “Home Directory” via cd command:</p><pre># go to home directory<br><strong>cd</strong></pre><p><strong>2)</strong> Download our monitoring script with “git clone” and locate to scripts directory:</p><pre># Git clone:<br><strong>git clone </strong><a href="https://github.com/burcusan/telegram-monitor-scripts.git"><strong>https://github.com/burcusan/telegram-monitor-scripts.git</strong></a></pre><pre><strong>cd telegram-monitor-scripts</strong></pre><p><strong>3)</strong> Install with “install_avax_monitor.sh” script, give your TOKEN and CHAT ID values as these are mandatory parmeters:</p><pre># Usage:<br>./install_avax_monitor.sh -t <strong>&lt;YOUR TELEGRAM TOKEN&gt;</strong> -c <strong>&lt;YOUR TELEGRAM CHAT ID&gt;</strong></pre><pre># Example:<br>./install_avax_monitor.sh -t <strong>13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g</strong> -c <strong>10522222228</strong></pre><p>If you want to use default parameters for CPU threshold ad 40% and API Call IP is 127.0.0.1 ,go directly to next step (4).</p><p>If you want to change default CPU threshold value, you can do it by setting a parameter such as:</p><pre># Usage:<br>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt;<strong> -p &lt;CPU THRESHOLD&gt;</strong> </pre><pre># Example:<br>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-p 50.00</strong></pre><p>If you start your avalancge process with <strong>“ — http-host=“</strong>, your API<strong> </strong>call IP probably different than default one 127.0.0.1. Check and if you have different IP than 127.0.0.1 for your API calls, you can set that IP as a parameter such as :</p><pre># Usage:<br>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt; <strong>-i</strong> <strong>&lt;IP&gt;</strong></pre><pre># Example:<br>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-i 33.44.55.xxx</strong></pre><p>Or if you want you can change CPU and IP parameters entering just one command:</p><pre># Usage:<br>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt; <strong>-p &lt;CPU THRESHOLD&gt; -i</strong> <strong>&lt;IP&gt;</strong> </pre><pre># Example:<br>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-p 50.00 -i 33.44.55.xxx</strong></pre><p><strong>4)</strong> Test your script is working or not as shown below:</p><pre><strong>./check_avalanchego_status.sh &gt; check_avalanchego_status.logcat check_avalanchego_status.log</strong></pre><pre># Example Output : <br> &gt;&gt;&gt;&gt; : Fri Oct  2 15:20:30 +03 2020<br> &gt;&gt;&gt;&gt; : TOKEN=&lt;TELEGRAM TOKEN&gt;<br> &gt;&gt;&gt;&gt; : CHAT_ID=&lt;CHAT ID&gt;<br> &gt;&gt;&gt;&gt; : HTTP_CODE= 200<br> &gt;&gt;&gt;&gt; : CURL_STATUS= 0<br> &gt;&gt;&gt;&gt; : FILE= /tmp/tmp_check_Avalanchego<br> &gt;&gt;&gt;&gt; : Avalanchego node is running!<br> &gt;&gt;&gt;&gt; : Fri Oct  2 15:20:30 +03 2020 - [INFO] Avalanchego node is healthy ! -  health.getLiveness result.healthy=true hostname=oracl<br> &gt;&gt;&gt;&gt; : true<br> &gt;&gt;&gt;&gt; : CPU_LOAD=2.28<br> &gt;&gt;&gt;&gt; : CPU_LOAD_CRITICAL=40.00</pre><p><strong>5)</strong> Now test you installation is ok, send your telegram bot a test message as shown below:</p><pre><strong>./check_avalanchego_status.sh test</strong> </pre><pre># Example Output :<br>&gt;&gt;&gt;&gt; : Fri Oct 2 16:25:53 +03 2020 — [TEST] [TEST] Avalanchego node TEST message !!!..</pre><p><strong>Sample telegram test message :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*YHB6w5jwqnSOusZo.png" /></figure><p><strong>Sample telegram ALERT message :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*V4EYGt48hg2kzu1s.png" /></figure><p><strong>Sample telegram ALERT RESOLVED message :</strong></p><p>When CPU threshold exceeded, you will get an alert and when it is back to normal, you will get another message as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/0*TS4RrFEyqrpjaBOw.png" /></figure><h3><strong>CONCLUSION</strong></h3><p>Our script will alert you if your node is not up, is not healthy or CPU is more than 40% as default and alert you when the problem is fixed. It checks your node every minute but it does not generate and send an alert every minute. It sends alert message with [ALERT FIRING] tag to Telegram Bot if the problem still exits for:</p><p>1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 6 hours, 12 hours, 24 hours.</p><p>So, max number of alerts you will get is 8 for 1 day if problem persists. After sending 8. message, script stop sending ALERT_FIRING messages; it is node owner’s responsibility to fix the problem. We don’t want to flood with message to validators and create “false positive” alerts. But as script check continuously every minute, if problem is gone , script will immediately sends [ALERT RESOLVED] message to the user without any time limit.</p><p><strong>If you successfully execute all the steps, that means you node’s health/up-down state and CPU usage is checked every minute. If script gets an error when calling “/ext/health” API, the result is “unhealthly”, if your node is not running/not bootstrapped or if CPU usage is high, you will get an alert via Telegram bot. And when these checks are ok, you will be notified also.</strong></p><h4><strong>PS — </strong>IF YOU DON’T WANT TO GET ALERTS , FOLLOW THIS PART</h4><p>If you do not want to get alerts via Telegram Bot anymore, just remove a line about our script in your crontab file. Edit it via <strong>crontab -e</strong> and remove or comment ( put # at the begining of line) related line as shown below:</p><pre>#sample output<br><strong>#</strong>* * * * * /home/username/telegram-monitor-scripts/check_avalanchego_status.sh &gt; /home/username/telegram-monitor-scripts/check_avalanchego_status.log 2&gt;&amp;1</pre><p>Keep safe &amp; healthy, and have a healthy Avalanche node :)</p><h4>Useful links</h4><p><a href="https://docs.avax.network/">Developer Documentation | Avalanche</a></p><p><a href="https://docs.avax.network/build/avalanchego-apis/health-api">This API can be used for measuring node health. To get an HTTP status code response that indicates the node’s health…</a></p><h4><strong>Avalanche related Platforms &amp; Links</strong></h4><p><a href="https://www.avalabs.org/">Website</a> | <a href="https://avalabs.org/whitepapers">Whitepapers</a> | <a href="https://twitter.com/avalancheavax">Twitter</a> | <a href="https://chat.avalabs.org/">Discord</a> | <a href="https://github.com/ava-labs">GitHub</a> | <a href="https://docs.avax.network/">Documentation</a> | <a href="https://explorer.avax.network/">Explorer</a> | <a href="https://avalabs.org/avalanche-x">Avalanche-X </a>| <a href="https://t.me/avalancheavax">Telegram</a> | <a href="https://facebook.com/avalancheavax">Facebook</a> | <a href="https://linkedin.com/company/avalancheavax">LinkedIn</a> | <a href="https://reddit.com/r/avax">Reddit</a> | <a href="http://www.youtube.com/c/AVALabsOfficial">YouTube</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bb883144152" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalanche-hub/how-to-get-real-time-alerts-from-your-avalanchego-validator-node-8bb883144152">How to get “real-time alerts” from your Avalanchego Validator Node</a> was originally published in <a href="https://medium.com/avalanche-hub">Avalanche Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get “real-time alerts” from your Avalanchego Validator Node]]></title>
            <link>https://medium.com/@burcusan/how-to-get-real-time-alerts-from-your-avalanchego-validator-node-f65f288c3e69?source=rss-aec148c2fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f65f288c3e69</guid>
            <category><![CDATA[telegram]]></category>
            <category><![CDATA[validator]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[avalanche]]></category>
            <category><![CDATA[avax]]></category>
            <dc:creator><![CDATA[burcusan]]></dc:creator>
            <pubDate>Sat, 03 Oct 2020 19:17:20 GMT</pubDate>
            <atom:updated>2020-10-04T11:20:13.990Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/54/0*jJwvHwZ3_Z0Ixi1t.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*iAwOuaYWh1CvHGD0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*vgrXy_QHoG0Ngd4S.png" /></figure><p>Avalanche’s mainnet was live on Sepember 21,2020. Now that more than 500+ validators have a node, it’s time to set up validator node’s “realtime” alert mechanism via Telegram Bot. I will explain how to create a custom bot and installing a small script on validator’s ubuntu operating system to get a real time alert if their Avalanchego process is down, unhealthy or if vm’s CPU consumption is high.</p><p>Recently one of the FAQs on Avalanche Discord &amp; Telegram channels is: How can I know instantly if my avalanchego process is stopped, unhealthy or if there is a high CPU consumption which is a sign of something is wrong with my validator node. Now there is a way. I will explain how to create your own custom bot and how to install a small script with a few commands, configure and use it.</p><p>Why Telegram? Telegram is one of the most used program for instant messaging and it is known for the possibility to have <a href="https://chatbotslife.com/">bots</a> that interact with user privately or within groups. Lets begin with Telegram <em>BotFather which </em>is the one bot to rule them all. Use it to create new bot accounts and manage your existing bots.</p><p><strong>Creating you own Telegram BOT :</strong></p><p><strong>1. </strong>Open Telegram, sign in and Enter @Botfather in the search tab and choose this bot. Note, official Telegram bots have a blue checkmark beside their name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*YqzcXkK3mBfG6-8J" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v8aT2i-qJOoKQ1gM.jpeg" /></figure><p>Click “Start” to activate BotFather bot.</p><p><strong>2.</strong> Choose the /newbot command and send it. Or just type the command <em>/newbot</em> and follow the istructions given by <em>BotFather</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*knFgYmsVB3DcsQ0g" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*3LE8PJEzUGejfPgo.png" /></figure><p><strong>3.</strong> Choose a name for your bot. For example my sample one is “<strong>testavalanchego”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*zUFHZ5daLj6eGOc5" /><figcaption>botfather</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*5V84aifF73Z7UIQR.png" /></figure><p><strong>4. </strong>And choose a username for your bot — the bot can be found by its username in searches. The username must be unique and end with the word “bot.” So you’ve to give a unique username and it should be ending with bot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*O-8Lj0ZGSixBFN2w" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*E9_2_89CDhew15cs.png" /></figure><p><strong>5.</strong> After giving the name it’ll show your TOKEN like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/21/0*QUG1LmO4kz0luki7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*WNxhG2IbYq0xAKOs.png" /></figure><p><strong>NOT</strong>: Copy the Api Token for further. TOKEN is the part right after “<strong>HTTP API: “</strong>. We will use it later</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*CMczIXj6Ck4tIPuJ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*427bQ75yaXwvjVyZ.png" /></figure><p>After you choose a suitable name for your bot — the bot is created. You will receive a message with a link to your bot t.me/&lt;bot_username&gt;, recommendations to set up a profile picture, description, and a list of commands to manage your new bot.</p><p>Lets start communicating with our bot. Enter your bot’s name ( my one is testavalanchego i.e.) in the search tab and choose it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*CHhoOo36tZh_SNbZ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Io4NmR667vtFh_P.png" /></figure><p>click on the “Start” button and you will be subscribed to your bot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/19/0*emjKvMya9CfoFeeQ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/0*I_c23hvFpChoo6wC.png" /></figure><p>type /start:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/24/0*Cn5bBsjlEhSRNDny" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/0*TrWKEbjcrVL4aXhJ.png" /></figure><p>We have a TOKEN. Lets get CHAT ID also, becausse we will give these 2 mandatory parameters as an input to our script in order to get alerts from our validator node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*kvQgh24amEXCf4jX" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*UxPMc45E5k-KgK_-.png" /></figure><p>Go to you vm, login with your Ubuntu user. First install “jq” utility, set your TOKEN variable and via curl command get your Chat ID as shown below:</p><pre># install jq <br>sudo apt-get install jq -y <br># Set TOKEN variable<br>TOKEN=<strong>1386633333:AAHAAAAAAAA-afV-oAAAAAAAAAAAAAAAAAA914s8<br></strong># Get CHAT_ID<br>curl -s <a href="https://api.telegram.org/bot$TOKEN/getUpdates">https://api.telegram.org/bot$TOKEN/getUpdates</a> | jq .result[0].message.chat.id<br><strong>10522222228</strong></pre><p>For example, my sample bot’s Chat ID is CHAT_ID: <strong>10522222228</strong></p><p>If you can not get your Chat it, go to your telegram and type /start to your bot and run curl command again. There is no harm to type “/start” 3–4 times.</p><p><strong>Installing our Monitoring Script :</strong></p><p>Our monitoring scripts has 3 fundamental checks every minute:</p><ul><li>check avalanchego process is up and running,</li><li>check avalanchego proces is healthy</li><li>check CPU usage(default threshold is 40%).</li></ul><p>Our custom developed Avalanchego monitoring script has 2 mandatory, 2 optional parameters. Mandatory ones are TOKEN and CHAT ID. Optional ones are CPU threshold and IP. A lot of validators has IP 127.0.0.1 to get their API calls. If you do same, so you don’t have to change IP parameter, it’s default is 127.0.0.1. Default CPU threshold value is 40%. If you want you can change it to any value you like. Don’t forget to use 2 digits after dot such as 50.00, 75.90 etc.</p><p><strong><em>Installation steps:</em></strong></p><p><strong>1-)</strong> Login your vm, go to your “Home Directory” via cd command:</p><pre># go to home directory<br><strong>cd</strong></pre><p><strong>2-)</strong> Download our monitoring script with “git clone” and locate to scripts directory:</p><pre># Git clone:<br><strong>git clone </strong><a href="https://github.com/burcusan/telegram-monitor-scripts.git"><strong>https://github.com/burcusan/telegram-monitor-scripts.git</strong></a></pre><pre><strong>cd telegram-monitor-scripts</strong></pre><p><strong>3-)</strong> Install with “install_avax_monitor.sh” script, give your TOKEN and CHAT ID values as these are mandatory parmeters:</p><p># Usage:</p><pre>./install_avax_monitor.sh -t <strong>&lt;YOUR TELEGRAM TOKEN&gt;</strong> -c <strong>&lt;YOUR TELEGRAM CHAT ID&gt;<br></strong></pre><pre># Example:</pre><pre>./install_avax_monitor.sh -t <strong>13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g</strong> -c <strong>10522222228</strong></pre><p>If you want to use default parameters for CPU threshold ad 40% and API Call IP is 127.0.0.1 ,go directly to next step (4).</p><p>If you want to change default CPU threshold value, you can do it by setting a parameter such as:</p><pre># Usage:</pre><pre>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt;<strong> -p &lt;CPU THRESHOLD&gt;</strong> <strong><br></strong></pre><pre># Example:</pre><pre>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-p 50.00</strong></pre><p>If you start your avalancge process with <strong>“ — http-host=“</strong>, your API<strong> </strong>call IP probably different than default one 127.0.0.1. Check and if you have different IP than 127.0.0.1 for your API calls, you can set that IP as a parameter such as :</p><pre># Usage:</pre><pre>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt; <strong>-i</strong> <strong>&lt;IP&gt;</strong></pre><pre># Example:</pre><pre>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-i 33.44.55.xxx</strong></pre><p>Or if you want you can change CPU and IP parameters entering just one command:</p><pre># Usage:</pre><pre>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt; <strong>-p &lt;CPU THRESHOLD&gt; -i</strong> <strong>&lt;IP&gt;</strong> <strong><br></strong></pre><pre># Example:</pre><pre>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-p 50.00 -i 33.44.55.xxx</strong></pre><p><strong>4-)</strong> Test your script is working or not as shown below:</p><pre><strong>./check_avalanchego_status.sh &gt; check_avalanchego_status.log</strong></pre><pre><strong>cat check_avalanchego_status.log</strong></pre><pre># Example Output :</pre><pre> &gt;&gt;&gt;&gt; : Fri Oct  2 15:20:30 +03 2020<br> &gt;&gt;&gt;&gt; : TOKEN=&lt;TELEGRAM TOKEN&gt;<br> &gt;&gt;&gt;&gt; : CHAT_ID=&lt;CHAT ID&gt;<br> &gt;&gt;&gt;&gt; : HTTP_CODE= 200<br> &gt;&gt;&gt;&gt; : CURL_STATUS= 0<br> &gt;&gt;&gt;&gt; : FILE= /tmp/tmp_check_Avalanchego<br> &gt;&gt;&gt;&gt; : Avalanchego node is running!<br> &gt;&gt;&gt;&gt; : Fri Oct  2 15:20:30 +03 2020 - [INFO] Avalanchego node is healthy ! -  health.getLiveness result.healthy=true hostname=oracl<br> &gt;&gt;&gt;&gt; : true<br> &gt;&gt;&gt;&gt; : CPU_LOAD=2.28<br> &gt;&gt;&gt;&gt; : CPU_LOAD_CRITICAL=40.00</pre><p><strong>5-)</strong> Now test you installation is ok, send your telegram bot a test message as shown below:</p><pre><strong>./check_avalanchego_status.sh test</strong> <br>&gt;&gt;&gt;&gt; : Fri Oct 2 16:25:53 +03 2020 — [TEST] [TEST] Avalanchego node TEST message !!!..</pre><p><strong>Sample telegram test message :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/20/0*2dOQ5n2BoQWJC2Ka" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*dnBvr-pwBXf5Foh8.png" /></figure><p><strong>Sample telegram ALERT message :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/19/0*ExeutMBOSxvMX1AF" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*Mw0vczxlmdWeCEyc.png" /></figure><p><strong>Sample telegram ALERT RESOLVED message :</strong></p><p>When CPU threshold exceeded, you will get an alert and when it is back to normal, you will get another message as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/20/0*lZptImU9MxMxTE0y" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/0*MeKTv-Jvx6vv38ql.png" /></figure><p><strong>CONCLUSION:</strong></p><p>Our script will alert you if your node is not up, is not healthy or CPU is more than 40% as default and alert you when the problem is fixed. It checks your node every minute but it does not generate and send an alert every minute. It sends alert message with [ALERT FIRING] tag to Telegram Bot if the problem still exits for:</p><p>1 minute</p><p>5 minutes</p><p>15 minutes</p><p>30 minutes</p><p>1 hour</p><p>2 hours</p><p>6 hours</p><p>12 hours</p><p>24 hours.</p><p>So max number of alerts you will get is 8 for 1 day if problem persists. After sending 8. message, script stop sending ALERT_FIRING messages; it is node owner’s responsibillity to fix the problem. We dont want to flood with message to validators and create “false positive” alerts. But as script check continuosly every minute, if problem is gone , script will immediately sends [ALERT RESOLVED] message to the user without any time limit.</p><p><strong>If you succesfully execute all steps, that means you node’s health/up-down state and CPU usage is checked every minute. If script gets an error when calling “/ext/health” API, the result is “unhealtly”, if your node is not running/not bootstrapped or if CPU usage is high, you will get an alert via Telegram bot. And when these checks are ok, you will be notified also.</strong></p><p><strong>PS:</strong></p><p>IF YOU DON’T WANT TO GET ALERTS , FOLLOW THIS PART:</p><p>If you do not want to get alerts via Telegram Bot anymore, just remove a line about our script in your crontab file. Edit it via <strong>crontab -e</strong> and remove or comment ( put # at the begining of line) related line as shown below:</p><pre>#sample output<br><strong>#</strong>* * * * * /home/username/telegram-monitor-scripts/check_avalanchego_status.sh &gt; /home/username/telegram-monitor-scripts/check_avalanchego_status.log 2&gt;&amp;1</pre><p>Keep safe &amp; healthy, and have a healthy Avalanche node :)</p><h3><a href="https://docs.avax.network/v1.0/en/api/health/">Developer Documentation | Avalanche</a></h3><h3><a href="https://docs.avax.network/v1.0/en/api/health/"> This API can be used for measuring node health. To get an HTTP status code response that indicates the node’s health…</a></h3><h4><a href="https://docs.avax.network/v1.0/en/api/health/">docs.avax.network</a></h4><p><strong>Avalanche related Platforms &amp; Links:</strong></p><p><a href="https://www.avalabs.org/">Website</a> | <a href="https://avalabs.org/whitepapers">Whitepapers</a> | <a href="https://twitter.com/avalancheavax">Twitter</a> | <a href="https://chat.avalabs.org/">Discord</a> | <a href="https://github.com/ava-labs">GitHub</a> | <a href="https://docs.avax.network/">Documentation</a> | <a href="https://explorer.avax.network/">Explorer</a> | <a href="https://avalabs.org/avalanche-x">Avalanche-X </a>| <a href="https://t.me/avalancheavax">Telegram</a> | <a href="https://facebook.com/avalancheavax">Facebook</a> | <a href="https://linkedin.com/company/avalancheavax">LinkedIn</a> | <a href="https://reddit.com/r/avax">Reddit</a> | <a href="http://www.youtube.com/c/AVALabsOfficial">YouTube</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f65f288c3e69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AVALANCHE —TEKNİK İP UÇLARI #2- “jq” ile API çağrılarını okunaklı hale getirmek]]></title>
            <link>https://medium.com/avalanche-hub/avalanche-tekni%CC%87k-i%CC%87p-u%C3%A7lari-2-jq-ile-api-%C3%A7a%C4%9Fr%C4%B1lar%C4%B1n%C4%B1-okunakl%C4%B1-hale-getirmek-ddd158aecea8?source=rss-aec148c2fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddd158aecea8</guid>
            <category><![CDATA[jq]]></category>
            <category><![CDATA[avalanche]]></category>
            <category><![CDATA[curl]]></category>
            <category><![CDATA[avax]]></category>
            <dc:creator><![CDATA[burcusan]]></dc:creator>
            <pubDate>Tue, 21 Jul 2020 07:12:28 GMT</pubDate>
            <atom:updated>2021-01-12T11:29:30.161Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/0*-zrW77kmQ2s_TFOS.png" /></figure><p>Herkese Merhaba !</p><p>Avalanche projesi için testnet’de node kuran arkadaşlar, Avalanche konsensus’unu kullanan blokzincir ile API’ler aracılığıyla etkileşimde bulunarak çeşitli komutlar çalıştırmaktadırlar. Bu yazıda, curl ile çalıştırılan komutların çıktılarını nasıl formatlayıp güzel bir şekilde okunaklı olarak elde edebileceğinizi ve çok fazla kullanılan API, curl gibi kavramların neler olduğunu öğreneceksiniz.</p><p>Öncelikle yazımın başlığında geçen “API” terimini açıklamak istiyorum. İngilizce “Application Programming Interface” kelimelerinin kısaltması olan API’’ler dilimize “Uygulama Programlama Arayüzü” olarak çevrilen, bir uygulamanın/servisin veya platformun sahip olduğu işlevlerine dışarıdan veya uzaktan izin verilen sınırlamalar dahilinde erişilip kullanılmasını sağlayan yapılardır. API, bir sunucunun üzerindeki uygulamaya farklı platformlardan ulaşılmasına ve cevap alınmasına olanak sağlar. API’ler üzerinden gerçekleştirmeyi amaçladığınız işlemler için, erişim sağlamak istediğiniz uygulama tarafından size özel sunulan erişim bilgilerini kullanmanız gerekir. Burada önemli olan istemci tarafında geliştirilen uygulamanın özelleştirilmiş yeteneklere sahip olması ve bu yetenekleri de API erişimleri ile sağlamasıdır. Avalanche fonksiyonlarına erişim için çok fazla API sunmaktadır. Avalanche API’leri ile ilgili detaylı bilgi almak için buraya <a href="https://dosc.avax.network/v1.0/en/api/intro-apis/">tıklayabilirsiniz</a>.</p><p>Avalanche’ın API’lerini çağırırken aşağıda verdiğim örnektekine benzer “curl” komutları kullanılmaktadır. Curl, ingilizce “client url” sözcüklerinin kısaltılmasıyla elde edilmiş bir php plugin’idir ve <a href="https://en.wikipedia.org/wiki/CURL">Daniel Stenberg</a> tarafından geliştirilmiştir. Plugin’ler ise mevcut programa yeni özellikler eklenilmesine olanak sağlayan yazılım bileşenleridir. Avalanche’ın API’lerine “curl” kullanılarak erişilebilmektedir.</p><p>Avalanche için örnek bir API çağrısı ve cevabı şu şekildedir:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*wJtj1w5UcijXVrYODls7qw.png" /></figure><p>Eğer testnet’de kurulum yaptıysanız, curl kullanarak çağrılan komutların — özellikle çıktıları uzun olanların — ekranda pek düzgün ve formatlı olarak görünmediğini fark etmişsinizdir. API çağrısının çıktısını okumak zor olabilir.</p><p>Peki, bunun bir çaresi var mı? Formatlı ve göze güzel görünen, okunaklı komut çıktıları elde etmek ve bunları filtrelemek mümkün mü?</p><p>Bu sorunun cevabı “<strong>jq</strong>” kullanmakta saklı. Kurulumdan başlayalım.</p><p><strong>jq</strong> yu kurmak için Ubuntu Linux işletim sisteminde aşağıdaki komutu girmek gereklidir.</p><pre><strong>sudo apt-get install jq</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHk1Dq1MEqMGVwwdNkKTzg.png" /></figure><p><strong>jq </strong>‘yu tek komut ile yükledikten sonra, artık kullanıp nasıl bir fark yarattığını görebiliriz. Örneğin “admin.getNodeID” API ‘sini çağıralım ve gelen çıktıya bakalım:</p><p><strong>“jq” </strong>kullanmadan gelen ekran şu şekilde:</p><pre>curl -s -X POST --data &#39;{<br>    &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>    &quot;method&quot;: &quot;admin.getNodeID&quot;,<br>    &quot;params&quot;:{},<br>    &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/admin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Om8KRDVcTGgNpisPiU6f7Q.png" /></figure><p><strong>“jq” </strong>kullanıldığında gelen ekran görüntüsü ise aşağıdaki gibidir:</p><pre>curl -s -X POST --data &#39;{<br>    &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>    &quot;method&quot;: &quot;admin.getNodeID&quot;,<br>    &quot;params&quot;:{},<br>    &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/admin | jq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*BAu6BtfsDo6T_ZWDD0tgsg.png" /></figure><p>“<strong>jq</strong>” bu örnekte görüldüğü gibi oldukça pratik, hayatı kolaylaştıran kullanışlı bir araçtır.</p><p>Bir diğer örneğe bakalım. Bu örnekte çalıştırdığımız komutun çıktısını çok uzun ve karmaşık olduğu için filtreleyelim ve içinde ilgilendiğimiz belli bir kelimeyi arayalım.</p><p><strong>“NODE ID” miz validatör listesinde var mı kontrolünü yapalım.</strong></p><p><strong>Öncesi: </strong>“<strong>jq</strong>” kullanılmadığında komutumuzu girdiğimizde gelen ekranda tüm validatör listesi bulunmakta ve gözle bakıp kendi node’umuzu bulmak baya zor olmaktadır.</p><pre>curl -X POST --data &#39;{<br> &quot;jsonrpc&quot;: &quot;2.0&quot;,<br> &quot;method&quot;: &quot;platform.getCurrentValidators&quot;,<br> &quot;params&quot;: {},<br> &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/P</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zz7EqMwIjnPGpRUxikj7bw.png" /></figure><p><strong>Sonrası:</strong> komutun çıktısında arama yapmak için “<strong>jq</strong>” kullanalım, yani sadece kendi node id’mizi aratalım ve gelen çıktıdaki farkı görelim (aşağıdaki koyu renkle yazan kısma dikkat).</p><pre>curl -X POST --data &#39;{<br> &quot;jsonrpc&quot;: &quot;2.0&quot;,<br> &quot;method&quot;: &quot;platform.getCurrentValidators&quot;,<br> &quot;params&quot;: {},<br> &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/P <strong>| jq &#39;.result.validators[] | select(.id == &quot;YOUR NODE ID &quot;) | .id&#39;</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PWafy3h1QdN_tNhmd81jwg.png" /></figure><p>Umarım “<strong>jq</strong>” yu faydalı bulup kullanırsınız. Hayatı kolaylaştıran araçları seviyoruz:)</p><p>Avalanche ile ilgili teknik sorularınız varsa <a href="https://chat.avalabs.org/">Discord</a> kanalından her zaman iletip destek alabilirsiniz.</p><p>Teşekkürler.</p><p><strong>Avalanche ile ilgili Linkler ve Platformlar:</strong></p><p><a href="https://www.avalabs.org/">Website</a> | <a href="https://avalabs.org/whitepapers">Whitepapers</a> | <a href="https://twitter.com/avalancheavax">Twitter</a> | <a href="https://chat.avalabs.org/">Discord</a> | <a href="https://github.com/ava-labs">GitHub</a> | <a href="https://docs.avax.network/">Documentation</a> | <a href="https://explorer.avax.network/">Explorer</a> | <a href="https://avalabs.org/avalanche-x">Avalanche-X </a>| <a href="https://t.me/avalancheavax">Telegram</a> | <a href="https://facebook.com/avalancheavax">Facebook</a> | <a href="https://linkedin.com/company/avalancheavax">LinkedIn</a> | <a href="https://reddit.com/r/avax">Reddit</a> | <a href="http://www.youtube.com/c/AVALabsOfficial">YouTube</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddd158aecea8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalanche-hub/avalanche-tekni%CC%87k-i%CC%87p-u%C3%A7lari-2-jq-ile-api-%C3%A7a%C4%9Fr%C4%B1lar%C4%B1n%C4%B1-okunakl%C4%B1-hale-getirmek-ddd158aecea8">AVALANCHE —TEKNİK İP UÇLARI #2- “jq” ile API çağrılarını okunaklı hale getirmek</a> was originally published in <a href="https://medium.com/avalanche-hub">Avalanche Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AVA DENALI İpuçları #1- AVA node’un ne kadar süredir aktif olduğunu nasıl öğreniriz ?]]></title>
            <link>https://medium.com/avalanche-hub/ava-denali-i%CC%87pu%C3%A7lar%C4%B1-1-ava-nodeun-ne-kadar-s%C3%BCredir-aktif-oldu%C4%9Funu-nas%C4%B1l-%C3%B6%C4%9Freniriz-30773a6a80d0?source=rss-aec148c2fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/30773a6a80d0</guid>
            <category><![CDATA[ava]]></category>
            <category><![CDATA[denali]]></category>
            <category><![CDATA[avalanche]]></category>
            <dc:creator><![CDATA[burcusan]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 08:53:00 GMT</pubDate>
            <atom:updated>2021-01-12T12:03:46.011Z</atom:updated>
            <content:encoded><![CDATA[<h3>AVAX DENALI İpuçları #1- AVALANCHE node’un ne kadar süredir aktif olduğunu nasıl öğreniriz ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uMAz13lgsN9gRlsZ.png" /></figure><p>Merhaba arkadaşlar !</p><p><em>AVAX Denali testnet başladı !</em></p><p>Aşağıdaki gibi bir email aldıydanız tebrikler, Denali testnet ağını kurup giriş yapmaya hak kazandınız demektir.</p><p><em>Başlangıç : </em><strong><em>1 Haziran 12:00 am GMT (8:00 pm New York)</em></strong><em><br>Bitiş : </em><strong><em>8 Haziran 11:59 pm GMT (7:59 pm New York)</em></strong></p><p>“For the first challenge, you need to run a node and add a validator to the default subnet. ( <em>You can check</em> <em>Collin Cusce’s guide </em><a href="https://avalabs.us20.list-manage.com/track/click?u=2332c947c1cd876b244f62288&amp;id=8ba920ab78&amp;e=573877dc74"><em>here</em></a><em>. )</em></p><p>You need to maintain a healthy, operational node for a minimum of 180 hours (50%) of the incentivized testnet to complete challenge III.”</p><p>E-postada görüldüğü gibi ilk aşamayı geçmenin koşulu, AVA’yı tariflenen adımlara göre kurmak ve kurduğunuz sistemin 180 saat boyunca çalışır olması.</p><p>Bir çok kullanıcı çeşitli bulut sistem sağlayacılarından ( Google cloud platform, Microsoft Azure, Amazon Web Services gibi) kiraladığı sanal sunuculardaki ubuntu işletim sistemi üzerine, dokumanlarda (<a href="https://avalabs.us20.list-manage.com/track/click?u=2332c947c1cd876b244f62288&amp;id=8ba920ab78&amp;e=573877dc74"><em>here</em></a>) tariflenen adımları takip ederek kurulumlarını yaptı.</p><p>Peki AVA uygulmasının kaç saattir çalıştığını anlamanın yolu nedir? Tek bir komutla bunu öğrenmenin bir yolu var. Aşağıdaki komut sizlere yardımcı olacaktır. Bu sayede minimum 180 saat kriterini tutturup tutturmadığınızı anlayabilirsiniz. Girilmesi gereken komut çok basit.</p><p><strong>ps -eo etime,args | grep ava | grep -v grep</strong></p><p>Örnek komut ve cevabı şu şekilde:</p><pre>burcusan@ava-ubuntu:~$ <strong>ps -eo etime,args | grep ava | grep -v grep</strong><br> 1-02:03:22 ./build/ava</pre><p>Yani benim makinede çalışan ava’nın bu komutun çıktısındaki “<strong>1–02:03:22</strong> ./build/ava” satırına göre, tam olarak <strong>1 gün 2 saat 3 dakika 22 saniyedir </strong>çalışmakta olduğunu görüyoruz<strong>.</strong></p><p>Kullandığımız ps komutu Linux işletim sisteminde çalışan uygulamaları (process) listeler. Ona verdiğiniz parametreler ile de uygulama detaylarını alabilirsiniz. Linux’te komutlar hakında bilgileri <strong>“man” </strong>komutu ile öğrenebilirsiniz yani komutun manuel’ini, detaylı bilgilerini okuyabilirsiniz.</p><p>Örneğin komuttaki kullandığım, süreyi gösteren “etime” parametresi nedir diye merak ederseniz, “ps” man sayfasında şu açıklamayı göreceksiniz:</p><pre>etime       ELAPSED   elapsed time since the process was started, <strong>in</strong> the form [[DD-]hh:]mm:ss.</pre><p>Herkese başarılar diliyorum. Yardıma ihtiyaç duyarsanız <a href="https://chat.avalabs.org/">Discord</a> kanalına üye olup veya Telegram hesabından ( Avalanche ) destek alabilirsiniz.</p><p>Teşekkürler.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30773a6a80d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalanche-hub/ava-denali-i%CC%87pu%C3%A7lar%C4%B1-1-ava-nodeun-ne-kadar-s%C3%BCredir-aktif-oldu%C4%9Funu-nas%C4%B1l-%C3%B6%C4%9Freniriz-30773a6a80d0">AVA DENALI İpuçları #1- AVA node’un ne kadar süredir aktif olduğunu nasıl öğreniriz ?</a> was originally published in <a href="https://medium.com/avalanche-hub">Avalanche Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AVA DENALI Tips #2- How to get more beautiful and readable outputs for API calls using “jq” ?]]></title>
            <link>https://medium.com/avalanche-hub/ava-denali-tips-2-how-to-get-more-beautiful-and-readable-outputs-for-api-calls-using-jq-b49fba66025b?source=rss-aec148c2fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b49fba66025b</guid>
            <category><![CDATA[avalanche]]></category>
            <category><![CDATA[jq]]></category>
            <category><![CDATA[ava]]></category>
            <dc:creator><![CDATA[burcusan]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 00:40:40 GMT</pubDate>
            <atom:updated>2021-01-12T11:29:59.828Z</atom:updated>
            <content:encoded><![CDATA[<h3>AVAX DENALI Tips #2- How to get more beautiful and readable outputs for API calls using <strong>“jq” </strong>?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/0*-zrW77kmQ2s_TFOS.png" /></figure><p>Hello Avalidators !</p><p>Clients interact with Avalanche through APIs calls to nodes.</p><p>You will be using Avalanche API calls via curl command as shown in AVA document <a href="https://docs.ava.network/v1.0/en/api/admin/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*wJtj1w5UcijXVrYODls7qw.png" /></figure><p>However, you may experience that Avalanche API calls via curl outputs may not be pretty as shown in documentation.</p><p>So, how can we get more beautiful and readable outputs for API calls ?</p><p>A good answer may be using “jq”.</p><p><strong>jq</strong> is a lightweight and flexible command-line JSON processor. (<a href="https://stedolan.github.io/jq/">jq link</a>)</p><p>First we need to install “jq” with following command on ubuntu linux.</p><pre><strong>sudo apt-get install jq</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHk1Dq1MEqMGVwwdNkKTzg.png" /></figure><p>Now, we have “jq”, we can test and see how it makes a difference.</p><p>Lets see the difference by testing “admin.getNodeID” API call via curl before and after using “jq”.</p><p><strong>BEFORE : </strong>without “jq”</p><pre>curl -s -X POST --data &#39;{<br>    &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>    &quot;method&quot;: &quot;admin.getNodeID&quot;,<br>    &quot;params&quot;:{},<br>    &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/admin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Om8KRDVcTGgNpisPiU6f7Q.png" /></figure><p><strong>AFTER :</strong> with “jq”</p><pre>curl -s -X POST --data &#39;{<br>    &quot;jsonrpc&quot;: &quot;2.0&quot;,<br>    &quot;method&quot;: &quot;admin.getNodeID&quot;,<br>    &quot;params&quot;:{},<br>    &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/admin | jq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*BAu6BtfsDo6T_ZWDD0tgsg.png" /></figure><p>“jq” is a very practical tool that may help formatting API call outputs.</p><p>Let’s see another sample.</p><p><strong>Is “NODE ID” listed as a validator or not ?</strong></p><p>Lets see the difference by testing “platform.getCurrentValidators” API call via curl before and after using “jq”.</p><p>We can use “jq” to check if “NODE ID” is listed as a validator or not ?<br>if “NODE ID” is listed as a validator then It prints “NODE ID” as output <br>else it does not print “NODE ID” as output</p><p><strong>BEFORE : </strong>without “jq”</p><pre>curl -X POST --data &#39;{<br> &quot;jsonrpc&quot;: &quot;2.0&quot;,<br> &quot;method&quot;: &quot;platform.getCurrentValidators&quot;,<br> &quot;params&quot;: {},<br> &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/P</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zz7EqMwIjnPGpRUxikj7bw.png" /></figure><p><strong>AFTER :</strong> with “jq”</p><pre>curl -X POST --data &#39;{<br> &quot;jsonrpc&quot;: &quot;2.0&quot;,<br> &quot;method&quot;: &quot;platform.getCurrentValidators&quot;,<br> &quot;params&quot;: {},<br> &quot;id&quot;: 1<br>}&#39; -H &#39;content-type:application/json;&#39; 127.0.0.1:9650/ext/P <strong>| jq &#39;.result.validators[] | select(.id == &quot;YOUR NODE ID &quot;) | .id&#39;</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PWafy3h1QdN_tNhmd81jwg.png" /></figure><p>I hope you will find “jq” as a practical tool.</p><p>Have fun! And let everyone know in <a href="https://chat.avalabs.org/">Discord</a> channel if you need assistance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b49fba66025b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalanche-hub/ava-denali-tips-2-how-to-get-more-beautiful-and-readable-outputs-for-api-calls-using-jq-b49fba66025b">AVA DENALI Tips #2- How to get more beautiful and readable outputs for API calls using “jq” ?</a> was originally published in <a href="https://medium.com/avalanche-hub">Avalanche Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AVA DENALI Tips #1- How to check how long a AVA node been running in linux ?]]></title>
            <link>https://medium.com/avalanche-hub/ava-denali-tips-1-how-to-check-how-long-a-ava-node-been-running-in-linux-984e3bdecff0?source=rss-aec148c2fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/984e3bdecff0</guid>
            <category><![CDATA[gecko]]></category>
            <category><![CDATA[burcusan]]></category>
            <category><![CDATA[ava]]></category>
            <category><![CDATA[avalanche]]></category>
            <dc:creator><![CDATA[burcusan]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 00:40:40 GMT</pubDate>
            <atom:updated>2021-01-12T12:02:36.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>AVAX DENALI Tips #1- How to check how long an AVALANCHE node been running in linux ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uMAz13lgsN9gRlsZ.png" /></figure><p>Hello Avalidators !</p><p><em>AVAX’s Denali testnet has been launhed!</em></p><p><em>Begins: </em><strong><em>June 1 at 12:00 am GMT (8:00 pm New York)</em></strong><em><br>Ends: </em><strong><em>June 8 at 11:59 pm GMT (7:59 pm New York)</em></strong></p><p>For the first challenge, you need to run a node and add a validator to the default subnet. ( <em>You can check</em> <em>Collin Cusce’s guide </em><a href="https://avalabs.us20.list-manage.com/track/click?u=2332c947c1cd876b244f62288&amp;id=8ba920ab78&amp;e=573877dc74"><em>here</em></a><em>. )</em></p><p>You need to maintain a healthy, operational node for a minimum of 180 hours (50%) of the incentivized testnet to complete challenge III.</p><p>So, we can check how long a AVA’s Gecko client process has been running in linux.</p><pre>burcusan@ava-ubuntu:~$ <strong>ps -eo etime,args | grep ava | grep -v grep</strong><br> 1-02:03:22 ./build/ava</pre><p>From “ps” man page:</p><pre>etime       ELAPSED   elapsed time since the process was started, <strong>in</strong> the form [[DD-]hh:]mm:ss.</pre><p>So in our case “<strong>1–02:03:22</strong> ./build/ava” means, it has been exactly <strong>1 day 2 hours 3 minutes and 22 seconds</strong> since we started AVA Gecko client “ava”.</p><p>Have fun! And let everyone know in <a href="https://chat.avalabs.org/">Discord</a> channel if you need assistance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=984e3bdecff0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalanche-hub/ava-denali-tips-1-how-to-check-how-long-a-ava-node-been-running-in-linux-984e3bdecff0">AVA DENALI Tips #1- How to check how long a AVA node been running in linux ?</a> was originally published in <a href="https://medium.com/avalanche-hub">Avalanche Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Avalanchego’yuTelegram Bot’u yardımı ile izlemek]]></title>
            <link>https://medium.com/avalanche-hub/avalanchegoyutelegram-bot-u-yard%C4%B1m%C4%B1-ile-izlemek-1f44c9d6b6ae?source=rss-aec148c2fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f44c9d6b6ae</guid>
            <category><![CDATA[avalanche]]></category>
            <category><![CDATA[telegram]]></category>
            <category><![CDATA[avax]]></category>
            <dc:creator><![CDATA[burcusan]]></dc:creator>
            <pubDate>Thu, 19 Mar 2020 16:22:28 GMT</pubDate>
            <atom:updated>2021-01-12T11:22:33.406Z</atom:updated>
            <content:encoded><![CDATA[<h3>Avalanchego’yu Telegram Bot’u ile “gerçek zamanlı” uyarı mesajları alarak izlemek</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OcLnN95LIAcowqoEqYk_Q.png" /></figure><p>21 Eylül 2020&#39;de mainnet’e çıkan Avalanche’da validator yani onaylayıcı olmak için 2000 Avax sahibi olmak ve node kurmak gerekmektedir. Birçok Validator Node’u Ubuntu işletim sisteminde yani Linux üzerinde çalışmaktadır (henüz windows versiyonu deneyseldir). Bu yazıda Validator’lerin “Avalancego” process’ini kendilerine özel bir Telegram Bot’u yaratarak nasıl gerçek zamanlı izleyebilecekleri yani monitor edecekleri detaylı bir şekilde anlatılmıştır.</p><p>Avalanche Discord ve Telegram kanallarında Mainnet sonrası en çok sorulan sorulardan biri, validator’larin kurmuş oldukları “Avalanchego” yu nasıl takip edecekleri, eğer bir şekilde avalanche kapanırsa/sağlıklı çalışmazsa,CPU kaynak kullanımı yüksek seyir ederse bundan vakit kaybetmeden nasıl haberdar olabilecekleri ile ilgilidir. Bunun için arzu edenler geliştirmiş olduğumuz Telegram bot uygulamasından yararlanabilir. Öncelikle bu alarmları Telegram aracılığı ile alabilmeniz için, Telegram’da kendinize özel bir bot yaratmanız gerekmektedir.</p><p><strong>Telegram BOT oluşturma adımları:</strong></p><p><strong>1. </strong>İlk adımda, <strong>BotFather</strong> ile kendi botumuzun hesabını oluşturmalıyız. <strong>BotFather</strong> kendimiz için bir Telegram botu oluşturmamızı sağlar.</p><p>Telegram’da “arama” kısmına “<strong>BotFather</strong>” yazın. Yanında mavi tik’li olanı seçin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y0PO0tp0wckpSvhB_Zh-PA.jpeg" /></figure><p>BotFather’e tıkladığınızda gelen ekranın aşağısındaki butonla “BotFather” ile mesajlaşmayı başlatın. <strong>START</strong> butonuna bastıktan sonra konuşmaya başlamış olucaksınız. Sizi <strong>BotFather</strong>’in yardım(help) mesajı karşılayacak.Bu mesajı okuyarak kendi botunuzu oluşturabilirsiniz.</p><p><strong>2.</strong> Botfather ile konuşmayı başlattıktan sonra, <strong>/newbot </strong>yazıp Enter’a basarak yeni bot oluşturma komutunu çalıştıralım. Şu şekilde bir cevap gelmeli:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*7iYhjgDi_4EG5flk1vZhZQ.png" /></figure><p><strong>3.</strong> <strong>/newbot</strong> komutunu mesaj olarak gönderdikten sonra sizden botun ismini isteyecektir. Deneme için bu yazıda örnek olarak <strong>testavalanchego i</strong>smini vericeğiz. Siz istediğiniz ismi verebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*fvZ5-smpwYt8jHE05Qz4Pw.png" /></figure><p><strong>4. </strong>Sonrasında sizden telegram botunuz için kullanıcı ismi isteyecektir. Bunun için seçtiğiniz ismin son 3 hanesinde dikkat etmemiz gereken bir kural var. Seçtiğiniz isim ya <strong>Bot</strong> ya da <strong>_bot</strong> ile bitmeli. Örneğin <strong>testavalanchegoBot</strong>, <strong>testavalanchego_bot</strong> gibi kullanıcı adları kullanılmalıdır. Biz örneğimizde şu şekilde yaptık:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*qRxGUJGNOTWJ1uyFEqASZQ.png" /></figure><p><strong>5.</strong> Kullanıcı adı seçtikten sonra <strong>BotFather</strong> size botunuzun telegram url’sini ve token değerini içeren bir cevap verecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*f7HefYd7zum690s2AE9F5g.png" /></figure><p><strong>NOT</strong>: Gelen ekrandaki <strong>HTTP API: sonrasında yazan bölüm TOKEN kısmıdır. </strong>Elde ettiğimiz TOKEN değerini script kurulumunda kullanacağız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*hEYBxcYr27WPdLgjPaHKEg.png" /></figure><p>Bu aşamaya kadar kendimize özel bir bot oluşturduk, TOKEN i gördük gelen cevapta, ama bot şu an aktif değil. Yani botun çalışması için ikinci adımı gerçekleştirmeliyiz.</p><p>Öncelikle yeni oluşturduğumuz bot’un ismini “Testavalanchego” aratıp bulalım. Gelen sonucun üzerine tıklayalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tusFij9WDZ4r1rrBN_ihOw.png" /></figure><p>Tıkladığımızda aşağıdaki gibi bir ekran gelecek. En alttaki “start” butonuna tıklayalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*1xRk-75gPI8nuMiNMaI5LQ.png" /></figure><p>Gelen ekranda aşağıdaki gibi “/start” yazıp enter yapalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*tyA4pXcjT22f3j7qa3ftuA.png" /></figure><p>Şimdi aşağıdaki gibi TOKEN’ı kullanarak CHAT ID’mizi öğreneceğiz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*hEYBxcYr27WPdLgjPaHKEg.png" /></figure><p>Node’umuzun kurulu olduğu makinede aşağıdaki 3 komutu çalıştırarak CHAT_ID’ mizi öğrenebiliriz. TOKEN ve CHAT_ID bize telegram botumuza mesaj yollayabilmemiz için lazım olacak.</p><pre># install jq <br>sudo apt-get install jq -y </pre><pre><br># Set TOKEN variable<br>TOKEN=<strong>1386633333:AAHAAAAAAAA-afV-oAAAAAAAAAAAAAAAAAA914s8</strong></pre><pre># Get CHAT_ID<br>curl -s <a href="https://api.telegram.org/bot$TOKEN/getUpdates">https://api.telegram.org/bot$TOKEN/getUpdates</a> | jq .result[0].message.chat.id<br><strong>10522222228</strong></pre><p>CHAT_ID: <strong>10522222228</strong></p><p>Eğer CHAT_ID gelmez ise, telegram a gidip botunuza tekrar birkaç kez /start komutu gönderdikten sonra yukarıdaki curl komutu ile CHAT ID’nizi alabilirsiniz.</p><p><strong>Monitor Scripti ve Kurulum Adımları :</strong></p><p>Bu aşamaya kadar Telegram bot’unu yaratıp kullanım için hazırlamış olduk. Şimdi avalanchego’yu izlememizi sağlayan script’i kuralım.</p><p>Bu scriptin 3 temel görevi var: avalanchego’yu her dakika healthy API’sini çağırıp sağlıklı durumda olup olmadığını anlamak, unhealthy ise veya erişemez/node kapalı ise yada makinenin CPU durumu belli bir eşik değerini( varsayılan %40) geçerse Telegram üzerinden alarm bildirimlerini alabilmek.</p><p>Sciript parametre olarak TOKEN, CHAT ID, CPU Eşik değeri (threshold) ve IP bilgilerini almaktadır. TOKEN ve CHAT ID değerlerinin verilmesi sizin oluşturduğunuz bota alert göndermek açısından zorunludur. CPU ve IP parametreleri ise opsiyoneldir. Bir çok kullanıcı API’leri 127.0.0.1 IP’sinden istek yaparak almaktadır. Eğer varsayılan olarak verilen %40 CPU değeri sizin için uygun ise ve 127.0.0.1 IP ‘sini kullanıyorsanız bu opsiyonel parametreleri değiştirmenize gerek bulunmamaktadır. CPU eşik değerini değiştirmek isteyenler veya API’leri için başka IP kullananlar bunları değiştirip kendi bilgilerini girebilirler.</p><p><strong><em>Kurulum ve çalıştırma adımları:</em></strong></p><p><strong>1-)</strong> Home dizinine cd komutu ile gidilir.</p><pre># go to home directory<br><strong>cd</strong></pre><p><strong>2-)</strong> Github’dan monitor scripti download edilir.</p><pre># Git clone:<br><strong>git clone https://github.com/burcusan/telegram-monitor-scripts.git<br>cd telegram-monitor-scripts</strong></pre><p><strong>3-)</strong> “install_avax_monitor.sh” script’i ile kurulum gerçekleştirilir. Aşağıdaki örnek komutta daha önce anlatıldığı gibi elde edilen TOKEN değeri ve CHAT ID değeri parametre olarak kullanılmalıdır.</p><p>NOT : Kurulum scriptini çalıştırmadan önce mutlaka bot ekranında “/start” yazıp enter yapalım. Bu komutun birden fazla girilmesinde problem yok.</p><p>Aşağıdaki TOKEN ve CHAT_ID değerleri sadece örnektir. Sizin kendi yarattığınız telegram BOT’unuza ait TOKEN ve CHAT_ID değerlerini kullanmanız gerekiyor.</p><pre># Usage:<br><br>./install_avax_monitor.sh -t <strong>&lt;YOUR TELEGRAM TOKEN&gt;</strong> -c <strong>&lt;YOUR TELEGRAM CHAT ID&gt;<br></strong><br><br># Example:<br><br>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228</pre><p>CPU eşik değeri %40 olarak alınmıştır. Yani makinanızdaki CPU kaynak kullanımı %40&#39;ı aşar ise alarm üretilecektir.</p><p>CPU eşik değeri ve IP parametrelerini farklı vermek isteyenler aşağıdaki adımları takip edebilir. <strong>Varsayılan değerleri kullanacak olanlar direk 4. adıma geçebilir.</strong></p><p>CPU için değerini istediğiniz gibi değiştirebilirsiniz. Dikkat edilmesi gereken şey ayıraç olarak nokta(.) kullanmak ve iki basamak vermektir. Örneğin 09.00 veya 60.15 veya 75.00 gibi.</p><pre># Usage:<br><br>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt;<strong> -p &lt;CPU THRESHOLD&gt;</strong> <strong><br></strong><br><br># Example:<br><br>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-p 50.00</strong></pre><p>IP olarak 127.0.0.1&#39;den farklı bir API çağırma IP’si kullanıyor iseniz onu da parametrik hale getirdik. Büyük bir çoğunluk gibi siz de 127.0.0.1 kullanıyor iseniz birşey yapmanıza gerek yok (genelde avalanchego’yu <strong>“--http-host=“ </strong>parametresi vererek çalıştıranlar farklı IP’den dinlemiş oluyorlar).</p><pre># Usage:<br><br>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt; <strong>-i</strong> <strong>&lt;IP&gt;</strong> <strong><br></strong><br><br># Example:<br><br>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-i 33.44.55.xxx</strong></pre><p>Arzu edenler CPU ve IP parametlerinin ikisini de değiştirmek isterse aşağıdaki gibi tek komut ile verebilirler.</p><pre># Usage:<br><br>./install_avax_monitor.sh -t &lt;YOUR TELEGRAM TOKEN&gt; -c &lt;YOUR TELEGRAM CHAT ID&gt; <strong>-p &lt;CPU THRESHOLD&gt; -i</strong> <strong>&lt;IP&gt;</strong> <strong><br></strong><br><br># Example:<br><br>./install_avax_monitor.sh -t 13031231111111AAEx-kIC9E1237L111111111123ongZ3_c-g -c 10522222228 <strong>-p 50.00 -i 33.44.55.xxx</strong></pre><p><strong>4-)</strong> Kurulum sonrası script’in çalışıp çalışmadığı test edilir.</p><pre><strong>./check_avalanchego_status.sh &gt; check_avalanchego_status.log<br><br>cat check_avalanchego_status.log</strong><br><br># Example Output :<br><br> &gt;&gt;&gt;&gt; : Fri Oct  2 15:20:30 +03 2020<br> &gt;&gt;&gt;&gt; : TOKEN=&lt;TELEGRAM TOKEN&gt;<br> &gt;&gt;&gt;&gt; : CHAT_ID=&lt;CHAT ID&gt;<br> &gt;&gt;&gt;&gt; : HTTP_CODE= 200<br> &gt;&gt;&gt;&gt; : CURL_STATUS= 0<br> &gt;&gt;&gt;&gt; : FILE= /tmp/tmp_check_Avalanchego<br> &gt;&gt;&gt;&gt; : Avalanchego node is running!<br> &gt;&gt;&gt;&gt; : Fri Oct  2 15:20:30 +03 2020 - [INFO] Avalanchego node is healthy ! -  health.getLiveness result.healthy=true hostname=oracl<br> &gt;&gt;&gt;&gt; : true<br> &gt;&gt;&gt;&gt; : CPU_LOAD=2.28<br> &gt;&gt;&gt;&gt; : CPU_LOAD_CRITICAL=40.00</pre><p><strong>5-)</strong> Kurulum sonrası script’in çalışıp çalışmadığı örnek bir telegram mesajı ile test edilir.</p><pre><strong>./check_avalanchego_status.sh test</strong></pre><pre> &gt;&gt;&gt;&gt; : Fri Oct 2 16:25:53 +03 2020 — [TEST] [TEST] Avalanchego node TEST message !!!..</pre><p><strong>Örnek telegram test mesajı:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*haa4BharYTICE8gvPRm02Q.png" /></figure><p><strong>Örnek telegram ALERT mesajı :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*S4K7JtuMcdLr-CCmfI-ijg.png" /></figure><p><strong>Örnek telegram ALERT RESOLVED mesajı :</strong></p><p>CPU eşik değeri geçildiğinde ve CPU kullanımı normale döndüğünde gelecek örnek mesajlar da şu şekildedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*3-JILA7E_NMoJNs7AvVFig.png" /></figure><p><strong>SONUÇ:</strong></p><p>Geliştirdiğimiz script, bir sorun tespit ettiğinde alert’i telegram üzerinden mesajla bildirmektedir. Her dakika yaptığı kontrollerine hata devam ederse 5. dakikada, 15. dakikada, 30. dakikada, 1. saatte, 2. saatte ve 6 saat, 12 saat ve 24. saat başında [ALERT FIRING] etiketi ile alert üretmeye devam etmekte, 24 saat geçtikten sonra ise hala müdehale edilmemiş ve sorun giderilmemiş ise daha fazla alarm üretmemek adına artık uyarı vermemektedir. Yani 1 gün sorun devam ederse, alınacak mesaj sayısı 1. dakikada, 5. dakikada, 15 ve 30. dakikalarda, 2. saatte, 6. saatte, 12. ve 24. saatlerde olmak üzere toplam 8 tane olacaktır. Sorun düzelirse de zaman kısıtı olmadan düzeldiğinde [ALERT RESOLVED] etiketini kullanarak Telegram bot’una mesaj gönderecektir.</p><p><strong>Tüm adımları başarı ile yaptıysanız, artık node’unuz her dakika başı kontrol edilecek. Eğer “/ext/health” API sonucu “unhealtly”(sağlıksız) ise, kapalı ise,herhangi bir hata dönüyor ise, CPU kullanımı oranı belirlediğiniz limiti aşmış ise artık size Telegramdan alert gelecek, problem düzeldiğinde de düzeldi bildirimi gelecektir.</strong></p><p><strong>NOT:</strong></p><p>ALARMLAR İÇİN KURULAN YAPIYI DEVREDEN ÇIKARTMAK İSTERSEK:</p><p>Peki scripti devreden çıkartmak isterseniz, artık alarm almak istemezseniz ne yapmalısınız? Bu durumda, crontab’ınızdan script’in her dakika çalışmasını sağlayan satırı silmeniz veya satırın başına # koyarak comment’lemeniz yani o satırı devreden çıkartmanız yeterli. Yapmanız gereken <strong>crontab -e</strong> komutu ile crontab dosyanızın içine girip aşağıdakine benzer satırı silmeniz yada comment’lemeniz:</p><pre>#sample output<br><strong>#</strong>* * * * * /home/username/telegram-monitor-scripts/check_avalanchego_status.sh &gt; /home/username/telegram-monitor-scripts/check_avalanchego_status.log 2&gt;&amp;1</pre><p>Sağlıklı günleriniz, sağlıklı çalışan node’larınız olsun dileğimle…</p><p><a href="https://docs.avax.network/build/avalanchego-apis/health-api">https://docs.avax.network/build/avalanchego-apis/health-api</a></p><p><strong>Avalanche ile ilgili Linkler ve Platformlar:</strong></p><p><a href="https://www.avalabs.org/">Website</a> | <a href="https://avalabs.org/whitepapers">Whitepapers</a> | <a href="https://twitter.com/avalancheavax">Twitter</a> | <a href="https://chat.avalabs.org/">Discord</a> | <a href="https://github.com/ava-labs">GitHub</a> | <a href="https://docs.avax.network/">Documentation</a> | <a href="https://explorer.avax.network/">Explorer</a> | <a href="https://avalabs.org/avalanche-x">Avalanche-X </a>| <a href="https://t.me/avalancheavax">Telegram</a> | <a href="https://facebook.com/avalancheavax">Facebook</a> | <a href="https://linkedin.com/company/avalancheavax">LinkedIn</a> | <a href="https://reddit.com/r/avax">Reddit</a> | <a href="http://www.youtube.com/c/AVALabsOfficial">YouTube</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f44c9d6b6ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/avalanche-hub/avalanchegoyutelegram-bot-u-yard%C4%B1m%C4%B1-ile-izlemek-1f44c9d6b6ae">Avalanchego’yuTelegram Bot’u yardımı ile izlemek</a> was originally published in <a href="https://medium.com/avalanche-hub">Avalanche Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>