tag:blogger.com,1999:blog-33274785683609663572024-02-07T10:28:25.745-08:00Is It Working?Is It Working helps you to know your sites and apps are working properlyRobhttp://www.blogger.com/profile/10451162255006069715noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3327478568360966357.post-44966729387926206702018-09-26T07:58:00.003-07:002022-02-28T04:21:03.666-08:00Is It Working will stay free for some time...I started Is It Working as a 'side project'.<br />
<br />
I admit - I had hopes that it would be a huge instant success with hundreds or even thousands of users - and I'd be instantly rich :)<br />
<br /><br />
<br />
Sadly this didn't happen. Folks are using IsItWorking - but the numbers are not huge.<br />
<br />
On a related note, EU tax law has an annoying 'feature' where if you sell a single pound worth of digital services, you need to register for sales tax and send reports every three months.<br />
<br />
I'm allergic to that kind of admin.<br />
<br />
So, given that I don't want to do the admin, and that it would be a chunk of work to add a payment system to Is It Working - I'm not going to.<br />
<br />
This is not to say that I'll never charge - but if I do start charging, I'll give reasonable notice, and I won't charge current users more than $1 / month for 10 checks.<br />
<br />
This also means that I'm not doing significant work on Is It Working. I'll keep it running because<br />
<br />
<ul>
<li>I think it is cool</li>
<li>I use it for my own purposes</li>
</ul>
<div>
Of course - if you have a feature you'd like to see, I'm happy to add features on a sponsored basis.</div>
<div>
<br /></div>
<div>
I hope Is It Working will still be useful for people. If you like it - please tell your friends.</div>
<div>
<br /></div>
<div>
Perhaps I'll still be rich some day :)</div>
<br />
<br />Robhttp://www.blogger.com/profile/10451162255006069715noreply@blogger.comtag:blogger.com,1999:blog-3327478568360966357.post-38963688084340041362017-03-29T09:22:00.003-07:002017-03-29T09:22:44.595-07:00Timing your background tasks in Ruby (or bash, or any other language...)<div class="tr_bq">
Is It Working runs a handful of critical tasks in the background.</div>
<br />
This post will show you how I use the new timing feature in IsItWorking to make sure that they run in a reasonable time.<br />
<br />
Background tasks do critical things like requesting checks for your ssl expiry date, or a new whois check on your domain.<br />
<br />
They also do cleanup tasks like clearing out excessive records on your checkins.<br />
<br />
I use Javan's <a href="https://github.com/javan/whenever">whenever</a> to manage the schedule. It generates a crontab whenever I push an update with Capistrano.<br />
<br />
The schedule is really simple with a handful of entries like:<br />
<br />
<pre>every 1.minute do
runner "Switch.check_for_past_due";
end
</pre>
<br />
<div>
<br />
This task looks for any checkins that are late. It marks them as late, and queues notifications to be sent as async tasks.<br />
<br />
<pre>def self.check_for_past_due
Switch.not_late.past_due.find_each do |switch|
switch.late = true
switch.save
switch.user.notifications.each do |notif|
notif.send_switch_is_late(switch)
end
end
end
</pre>
<br />
At the moment, this task take a couple of tens of milliseconds, but as the number of users increases, it will slow down.<br />
<br />
At some point, I'll need to do something new; Perhaps use a faster droplet, optimise the code, or figure out some other solution!<br />
<br />
IsItWorking's new timing feature lets me easily monitor how long this takes, and let's me get a warning if it starts taking too long.<br />
<br />
Step 1) Log in to <a href="https://isitworking.info/">IsItWorking</a> and create a checkin.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3rPeU8yVMgZnEdJfMpP8Lin66lIZ1NfaCPizy0vNe894Nvako8igTg00LrfFFz4DUuOnZp-wP8kx5Ez8hftptvtqMi2TTBrOmHJCvo4LDCB8Ttili7KGi53B_0w3s-rhaknvmpnzeNQo/s1600/2017-03-29+03.56.35+pm.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3rPeU8yVMgZnEdJfMpP8Lin66lIZ1NfaCPizy0vNe894Nvako8igTg00LrfFFz4DUuOnZp-wP8kx5Ez8hftptvtqMi2TTBrOmHJCvo4LDCB8Ttili7KGi53B_0w3s-rhaknvmpnzeNQo/s320/2017-03-29+03.56.35+pm.png" width="320" /></a></div>
<br />
<br />
I could use the 'no timeout' option - but as I know the script will be running every minute, I might as well get the alert if it fails to run after 15 mins.<br />
<br />
I'm using the <a href="https://github.com/ConfusedVorlon/IsItWorking-Ruby">IsItWorkingInfo gem </a>to keep the code simple (but if you want to skip the dependencies, it is <a href="https://isitworking.info/docs/languages">super-easy to do manually</a>)<br />
<br />
I add the gem to my gemfile<br />
<br />
<pre>gem 'is_it_working_info'
</pre>
<br />
then install it<br />
<br />
<pre>bundle install
</pre>
<br />
click on the 'use' button to get my checkin id</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXqJakN7xKGwHCRL6PocVb2VMl5zry0R7FUucd-4I0Do4PgfmjYOde_aG2WT1uKNu_ByHpep6uE37iA6Gt-kFEoTS6QhhPa7tEhncheqfKa_D3sbnAQhINPM_q3cH8n_gCOD_xgyfdl58/s1600/2017-03-29+04.04.45+pm.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXqJakN7xKGwHCRL6PocVb2VMl5zry0R7FUucd-4I0Do4PgfmjYOde_aG2WT1uKNu_ByHpep6uE37iA6Gt-kFEoTS6QhhPa7tEhncheqfKa_D3sbnAQhINPM_q3cH8n_gCOD_xgyfdl58/s320/2017-03-29+04.04.45+pm.png" width="320" /></a></div>
<br />
<br />
I can ignore the url as I'm using the gem - but this is actually what the gem will be pinging.<br />
<br />
Now I just wrap my critical code with the timing block<br />
<br />
<pre>def self.check_for_past_due
IsItWorkingInfo::Checkin.time(key:"MYUNIQUECODE",
message:"Switch.check_for_past_due",
boundary:1000) do
Switch.not_late.past_due.find_each do |switch|
switch.late = true
switch.save
switch.user.notifications.each do |notif|
notif.send_switch_is_late(switch)
end
end
end
end
</pre>
<br />
I have added a message to make it easier to remember what I'm doing here.</div>
<div>
<br />The boundary time is set in my code, so if I ever need to change it, it is part of the checked in code in my project.</div>
<div>
<br />If the task ever takes more than 1000 milliseconds, then IsItWorking will alert me and I can investigate.</div>
<div>
<br />I can easily review the current timing at https://IsItWorking.info, and I can also download timing data as a csv for investigation.<br /><br /><br /><div>
</div>
</div>
Robhttp://www.blogger.com/profile/10451162255006069715noreply@blogger.comtag:blogger.com,1999:blog-3327478568360966357.post-13984351571370860152017-03-29T09:22:00.000-07:002017-03-29T09:22:09.708-07:00Introducing Time alerts for your tasksI'm pleased to announce the addition of a timing function to IsItWorking.info checkins.<br />
<br />
These allow you to send the time your task took, along with the boundary time that you consider acceptable.<br />
<br />
If the task took too long, then IsItWorking will alert you.<br />
<br />
<br />
<pre>
#!/bin/sh
start=`date +%s`
/Users/rob/Documents/Development/Rails/IsItWorking/test/scripts/slow_script.sh
end=`date +%s`
runtime=$((end-start))
curl -d "t=$runtime&b=5" https://api.IsItWorking.info/c/CHECKIN_IDENTIFIER
</pre>
<br />
<br />
In this example, if slow_script.sh takes more than 5 seconds, you'll get an alert.<br />
<br />
You can read more <a href="https://isitworking.info/docs/checkin_api">in the api</a><br />
<br />
Or see <a href="https://isitworking.info/docs/languages">other examples</a>Robhttp://www.blogger.com/profile/10451162255006069715noreply@blogger.comtag:blogger.com,1999:blog-3327478568360966357.post-12264738706305877432017-03-27T06:19:00.001-07:002017-03-27T06:26:55.829-07:00After 10 years, Active-Domain messed up my domainsI thought I could trust my domain provider to give me reliable notification <i>before</i> my domains expired.<br />
<br />
I was wrong.<br />
<br />
<br />
While I was building Is It Working, I got an email from <a href="http://active-domain.com/">Active Domain</a> reminding me to renew a handful of my domains<br />
<br />
Nothing new here - <a href="http://active-domain.com/">Active Domain</a> have been providing me with a splendidly boring service for about a decade.<br />
<br />
I have always had multiple reminders before a domain expires<br />
<br />
The difference this time was that one of my domains <b>had already expired</b><br />
Logging in to <a href="http://active-domain.com/">Active Domain</a>, showed me that they had 'updated' their website to a fancy new system<br />
<br />
Presumably, somewhere in the upgrade, they stopped sending out renewals, and my domain expired without notice<br />
<br />
Fortunately it wasn't a critical domain, and it was only a few days past the expiry date, so I was able to recover it<br />
<br />
Over the next few weeks, <a href="http://active-domain.com/">Active Domain's</a> 'shiny new' system proceeded to apply the wrong contact details to several of my domains. (resulting in incorrect whois details, and difficulty transferring domains to a new registrar)<br />
<br />
Their login stopped working for several days<br />
<br />
They 'lost' a couple of my domains<br />
<br />
I decided that I should add some simple domain monitoring to Is It Working!<br />
<br />
<br />
<div>
Is It Working will now send you a notification if your domain is getting close to expiry:</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkWotwTEAZi_jQstAqc-PDYXRqFeLltp_JxXKCA7uSlNQMQttIUyHYZMW85jJHVKIbFWaqQKslyr15WI0mcIMskEftRz7caFy_CrjtaDD_NGRhSeJfB8xD8eATa9Id_9NOgmn3hVoIjVo/s1600/problem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkWotwTEAZi_jQstAqc-PDYXRqFeLltp_JxXKCA7uSlNQMQttIUyHYZMW85jJHVKIbFWaqQKslyr15WI0mcIMskEftRz7caFy_CrjtaDD_NGRhSeJfB8xD8eATa9Id_9NOgmn3hVoIjVo/s320/problem.png" width="320" /></a></div>
<br />
It will also alert you if there is a change to your WHOIS record, and let you examine the changes as a diff<br />
<br />
(extract below shows the whois change after ActiveDomain changed my contact details back to the right person!)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBr2mPn_y13TwBGiHdNqd_SWZewSvbph3ijPo_NtIWZbb38gh9YUowV3iFrZ-91EU2wutPkpRZfgse69lnSTewFbEI4258Vle2hjh1vTkAA02Lva2TkETpk7_OLYdKSOtFT_Ww7uIp3Yo/s1600/diff.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBr2mPn_y13TwBGiHdNqd_SWZewSvbph3ijPo_NtIWZbb38gh9YUowV3iFrZ-91EU2wutPkpRZfgse69lnSTewFbEI4258Vle2hjh1vTkAA02Lva2TkETpk7_OLYdKSOtFT_Ww7uIp3Yo/s320/diff.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I have named Active-Domain as they had a whole list of mistakes - but the point is that this could happen anywhere. They were a company that I had used for years, and who I recommended to my friends. They were reliable, simple and boring.</div>
<br />
I don't know why they decided to update their systems - but this kind of problem can happen anywhere an upgrade is botched.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
IsItWorking.info is designed to provide early warning, and peace of mind in the future...</div>
<br /></div>
Robhttp://www.blogger.com/profile/10451162255006069715noreply@blogger.comtag:blogger.com,1999:blog-3327478568360966357.post-57512398742826819992017-03-27T06:00:00.003-07:002017-03-27T06:00:40.727-07:00Welcome - Please let me know what you think.Is It Working aims to provide simple cost effective monitoring for some aspects of your websites and servers.<br />
<br />
I got fed up of yet another site asking for $9.99/month to provide straightforward monitoring. I figured that I could do a similar job for a tenth of the price!<br />
<br />
Is It Working is the result.<br />
<br />
At launch, Is It Working helps you to answer three questions.<br />
<br />
1) Are my cron scripts (or other regular tasks) running correctly<br />
2) Are my SSL Certificates up to date<br />
3) Are my domains up to date (We'll also tell you if the WHOIS record changes)<br />
<br />
Please <a href="https://isitworking.info/">try it out</a>, and <a href="http://localhost:3000/docs/contact">let me know what you think</a>.<br />
<br />
<br />Robhttp://www.blogger.com/profile/10451162255006069715noreply@blogger.com