twitter |   ||  email | PGP --> harshal @ harshdevx.com

r00tst1llsabout m3

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
Click to englarge me

lets take it one step further. i have a raspberry pi sitting running a bunch of cron jobs. i added another one to it. i have a samba share at home on which i keep downloading few movies and i want my wify to know which movie is new in town ;) basically available to watch this weekend...so what i do is first i install inotigfytools on my raspi . this enables me to set watches on the folder i wish to monitor

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...

Click to englarge me

now lets just try one more thing. i use "vnstati" to generate network stats. to install vnstati you can use the code below.

Click to englarge me

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