IIS7 and Twitter – a love story
It is a while that I wrote something as crazy as this one is. This is basically a windows service running in your web server which would tweet often about the heart beat of the web server and posts its status messages. For example, v1.0 of this application will tweet the below (you can configure the time interval on the config file):
- Total number of requests executing per application pool
- Each Application pool Private bytes, and Virtual bytes memory usage
- Server’s available Physical memory, and Virtual memory
- Momentary Ping to a configured URL (example – http://localhost) (it will tweet only if it fails – for the moment I’m just checking if the HttpWebResponse.StatusCode != HttpStatusCode.OK. If time permits, I’ll try to add more granular control for the error codes)
- If a request takes more than specified time limit to get served
There is a configuration file in which you can specify the Twitter Username, and password, time interval for each set of tweets, the URLs you want to monitor, and option to turn off the tweets.
For example, if a request is taking more than the configured time limit, it will tweet “Alert > /Default.aspx is being processed for 79s spending 79s IsapiModule | AppPool : Default Web Site” which will just say the URL, the time taken, which Module currently processes it, and the application pool serving the request.
Get IIS7TweetService to your server
- Download the Service EXE, and a sample config.xml which are inside the IIS7TweetService.zip file.
- Extract the contents to C:\IIS7TweetService (this location cannot be changed as I’ve hard coded the config file path. I’ll be allowing you to place it in some other folder in the future versions)
- Install the IIS7TweetService.exe as a Windows Service (from your Visual Studio Command Prompt run “installutil /i C:\IIS7TweetService\IIS7TweetService.exe”
Feel free to leave your comments in this blog, and your feature requests for the future versions if you like this one.
PS : I’ve only done a very limited testing on Vista and Windows Server 2008, so use it with caution. If I find time, I’ll try doing more testing and improve its efficiency. In case if you find a problem using this, please let me know. Your comments, and suggestions are most welcome.