At my job, we run many MS SQL jobs for crunching data. And on rare occasionally, we'll see jobs that would get stuck in its running state for unknown reasons. Since we do not have external softwares to monitor the SQL jobs and I do not wish to check the job results daily, I created a solution that would allow us to at least know whether a job has exceeded its expected run time. That way, I can just go and check that specific job and if I feel that it's indeed stuck, I can stop and restart it.
My solution was another SQL job that would monitor the specified job. :) I know what you are thinking, what if the job that monitors the other job hangs? Well, I do worry about that as well but I'm hoping these monitor jobs are simple enough that they will not hang (the jobs that got stuck have been complex and usually long running.)
How does my solution work? I created a stored procedure that takes in name of the job to monitor and the expected duration as parameters. As a first step of the job that I want to monitor, I would call this stored procedure and a new job would get created. The newly created job's only task is to check whether the job specified in the parameter is still running after the specified duration starting from the time that it was created. And if the specified job exceeds the specified duration, I send an email out to notify the developers in our team.
When I was searching for a solution on the internet to our job hanging problem, I didn't find too many things. That's why I thought it might be helpful if I post my source code out there for other people to use.
The source code is on github.com. A link is also provided on the clearcubic.com projects page.
Showing posts with label technology. Show all posts
Showing posts with label technology. Show all posts
2012-06-06
MS SQL job monitor
Posted by
Caber
at
12:30 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
misc,
MS SQL,
technology
2011-04-24
The Facebook 'like' button
Facebook, while I don't find it that essential, it's certainly one of the most popular web site on the Internet. So when I received a comment suggesting me to add a Facebook button, I decided I'll add one. Not only are the blog posts shareable through a couple social networks now, I've also added the FB 'recommend' button to the albums on clearcubic.com.
I thought adding a FB 'like' button would be easy but that turned out to be not completely true. While the process of adding a normal 'like' button is fairly simple, I learned that there are several ways to do that and depending on which method you choose, what happens on FB can vary after a user clicks the button and that part confused me for a while. Anyhow, the 'Recommend' button is now on clearcubic.com photo albums and I just want to have a blog entry on the date that I added this feature, 4/23/2011.
Oh, and while in blogger.com today, I found out that blogger introduced a new way to view blogs. I thought the new ways are pretty cool. Use the following links to check them out.
New Views To Read Blogs - http://clearcubic.blogspot.com/view/
I thought adding a FB 'like' button would be easy but that turned out to be not completely true. While the process of adding a normal 'like' button is fairly simple, I learned that there are several ways to do that and depending on which method you choose, what happens on FB can vary after a user clicks the button and that part confused me for a while. Anyhow, the 'Recommend' button is now on clearcubic.com photo albums and I just want to have a blog entry on the date that I added this feature, 4/23/2011.
Oh, and while in blogger.com today, I found out that blogger introduced a new way to view blogs. I thought the new ways are pretty cool. Use the following links to check them out.
New Views To Read Blogs - http://clearcubic.blogspot.com/view/
Posted by
Caber
at
12:11 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
technology
2010-07-16
Revamped: clearcubic.com back-end
It's been a while since I posted photos and that's because I have been revamping my web site's back-end. I'm happy to say that in terms of what people can see, it's close to 90% done. While the site still looks pretty much the same as before, how it operates in the background has been completely changed.
Before:
After:
Before this revamp, I did not know any of the technologies that I have switched to and that was the reason that the site hasn't been updated for close to 3 months. It took me about 4 non consecutive weeks (nights and weekends) to get the site looking like the original. Because it was almost like starting the site from scratch, I rethought certain ways to do things. To enhance performance, the website is now practically static html pages that are pregenerated by my new administration tools. Administration tools were dispersed throughout my site before but they have been separated from the main site into a centralized location (still a work in progress).
What prompted me to make such a drastic change? Two main reasons. One, I was thinking about the future. Two, I wanted to try out some of these new technologies. Didn't I say I love technology? I honestly do. =D
About the "thinking about the future" part. I was thinking what would happen to clearcubic.com once I'm gone from this world. By using a paid hosting company, if no one pays the hosting fee, this site would surely disappear from this world forever. The Google App Engine service I'm using now is currently free. While I can not be certain that it'll be free forever, I do think my site would have a much better chance to survive at Google.com than 1and1.com. And yes, the domain, "clearcubic.com", is also a paid service but once it dies, remember this free alternative address, "http://clearcubic.appspot.com".
Before:
- Web Hosting: 1and1.com
- Language: PHP
- Database: MySQL
- Web Application Framework: None
After:
- Web Hosting: Google App Engine
- Language: Python
- Database: App Engine Datastore (non-relational)
- Web Application Framework: Django
Before this revamp, I did not know any of the technologies that I have switched to and that was the reason that the site hasn't been updated for close to 3 months. It took me about 4 non consecutive weeks (nights and weekends) to get the site looking like the original. Because it was almost like starting the site from scratch, I rethought certain ways to do things. To enhance performance, the website is now practically static html pages that are pregenerated by my new administration tools. Administration tools were dispersed throughout my site before but they have been separated from the main site into a centralized location (still a work in progress).
What prompted me to make such a drastic change? Two main reasons. One, I was thinking about the future. Two, I wanted to try out some of these new technologies. Didn't I say I love technology? I honestly do. =D
About the "thinking about the future" part. I was thinking what would happen to clearcubic.com once I'm gone from this world. By using a paid hosting company, if no one pays the hosting fee, this site would surely disappear from this world forever. The Google App Engine service I'm using now is currently free. While I can not be certain that it'll be free forever, I do think my site would have a much better chance to survive at Google.com than 1and1.com. And yes, the domain, "clearcubic.com", is also a paid service but once it dies, remember this free alternative address, "http://clearcubic.appspot.com".
Posted by
Caber
at
10:54 PM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
technology
Subscribe to:
Posts (Atom)