harshdevx.com | infotech & infosec articles | tutorials | analytics
alerting via telegram bots
telegram is awesome piece of software. not just that it is safe but that it is truely cross platform. macs, linux, windows, androids, chrome web app, ios and for the nerds on command line. it provides us ability to have bots that allow us to use various apis to send/get messages, audio files, pictures etc.i tried using the bot technology to send different types of notification and lets just get to it to see how it works. i wont spend too much time on how to create bot as there are alot of tutorials available. there were few problems that i faced during implementation of sending messages as notification and i thought that this might be the opportunity to share with you all and learn if there is amy other way to get this thing done. so lets dive into it. first things first we have the bot running and it can send and receive messages. lets try a basic test from command line of sending the uptime to your bot
below is the image that shows when we put the above code in a file named "tg-uptime". now lets see when we run ths script what happens
so lets see now what happens when a file gets added to the folders that we setup our watches on. do we get the notification as expected...
now lets just try one more thing. i use "vnstati" to generate network stats. to install vnstati you can use the code below.
i have created a job to get run this script every day/month to see bandwidth usage. thats it folks...let me know if you implement it and if there are any questions I will be ready to answer them.
concept and design: harshdevX