Yesterday I’ve noticed that my server was running out of space. Turned out, nginx log wasn’t rotating, so it filled the whole drive. Today, I started my day figuring out, what kind of precautions i can take to eliminate such things. The most obvious way for me is sending a SMS message to my phone every time the available disk space running low. So I found this website, sms.ru – they provide very simple API and it is free of charge, if you 1) send messages only to yourself, 2) send not more than 60 messages per day.
Take a look at the code from this gist. Easy, right? And actually, you can use it in any other way – monitor RAM for example.
According to the website you can send messages to Russia, the US, Abkhazia, Armeniya, Belarus, Kazakhstan, Kyrgyzstan, China, Thailand, Ukraine. Unfortunately, the whole site is in russian, but I am going to help you here with a simple instruction.
- Go to Sign Up page
- Fill out the forms
- Go to Sign In page, enter your phone number and password.
- Open this page and look for your api_id
- This is it, now you can use it with the script
Please, let me know if you are having any troubles with the instruction, or if it doesn’t work for you.