
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

The above copyright notice and this permission notice shall be included in allĬopies or substantial portions of the Software. To use, copy, modify, merge, publish, distribute, sublicense, and/or sellĬopies of the Software, and to permit persons to whom the Software isįurnished to do so, subject to the following conditions: In the Software without restriction, including without limitation the rights Of this software and associated documentation files (the "Software"), to deal Permission is hereby granted, free of charge, to any person obtaining a copy The script is supposed to be run on a different server, than the server being checked. Make sure you leave an empty line at the end of the file! That's it!Īnd to make it absolutely and undoubtedly clear: Use crontab -e to append the following line to the cronjob list:

Don't forget to change the port number after testing. To test the script, enter an unused port and execute it via. Make the script executableĮxecute chmod +x serverOnline.sh to make the script executable. Configure the scriptįill in the four variables server, port (SSL is on 443 by default), botToken and chatId. If your token starts with AAAA the URL looks like /botAAAA and so on. Please note that the token must be directly behind bot in the URL. Visit /getUpdates to get your chat id: result => 0 => message => chat => id


Send a message to you newly created bot (you can find the link to your bot in the success message sent by BotFather). Go to the BotFather bot-account and create a bot by writing /newbot. If the service is not running, it utilizes the telegram bot API for sending a message to inform the operator of the server. This simple script uses netcat to check if - for instance - a webserver is running on a server. Server online-status check with reporting to telegram
