views:

915

answers:

2

Not a programming question per se, but interesting for people who do commercial web development.

How do you track all of your clients' hosting, domain registration, and SSL certificate expiry dates?

Do you just keep a spreadsheet or is there some useful piece of software for this?

I've searched extensively and can't find a usable piece of software and am tempted to write something. With 100+ customers to manage, and with hosting and domain names spread across several hosting companies and registrars, my ad hoc means are failing.

+1  A: 

You would probably be better off using whatever tool you usually use for managing your time/schedule than having some specialized tool. Be it Outlook, Sunbird, Lightning, a PDA, cell phone, paper calendar, etc. Just use whatever tool you normally use for keeping track of dates.

[ADDITION]

To elaborate, the reason you want it all in the same place as the rest of your important dates is that it ensures (at least a little) that you pay attention to the list. If you're using some other kind of program, it's too easy to get busy for a couple weeks, and forget to look at your special tool, and end up letting something expire that shouldn't expire.

Kibbee
while a calendar view of the data is good, the problem with using a calendar program to store it is that it's not stored by client or domain name. Plus you also may want registrar or hosting company views of the same data. But yeah, I had thought of a google calendar for this.
Quog
Re: AdditionI agree with that. If I write something, will have to expose the dates via a calendar API of some sort.
Quog
+1  A: 

How about we turn it into a programming question! You could use this code (C#), though I would recommend modifying it a bit (e.g. put url's in a file) and throwing it into a service.

This code sets up a certificate validation callback which the HttpWebRequest will call anytime it encounters a certificate. This lets us take a look at the certificate, usually this is used to validate the cert but we are going to look at the expiration time and if it within 3 months we will send an email to ourselves. A timer is setup to run the check once a day.

using System.Net;
using System.Diagnostics;
using System.Net.Mail;
using System.Threading;

static void Main(string[] args)
{
    // List of URL's to check
    string[] urls = new string[]{
        "https://www.6bit.com/",
        "https://www.google.com/"
    };

    HttpWebRequest req = null;

    // Certificate check callback
    ServicePointManager.ServerCertificateValidationCallback = (state, cert, certChain, sslerr) =>
    {
        DateTime expiration = DateTime.Parse(cert.GetExpirationDateString());
        if (expiration < DateTime.Now.AddMonths(3))
        {
            Debug.WriteLine("Cert expiring on " + expiration.ToShortDateString());
            MailMessage msg = new MailMessage("[email protected]", "[email protected]", "SSL Certificate Expiring", "The ssl certificate for" + req.RequestUri.ToString() + " will expire on " + expiration.ToShortDateString());
            SmtpClient sc = new SmtpClient();
            sc.Send(msg);
        }

        return true;
    };

    // Request each url once a day so that the validation callback runs for each
    Timer t = new Timer(s =>
    {
        Array.ForEach(urls, url =>
        {
            try
            {
                req = (HttpWebRequest)HttpWebRequest.Create(url);
                HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
                resp.Close();
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error checking site: " + ex.ToString());
            }
        });
    }, null, TimeSpan.FromSeconds(0), TimeSpan.FromDays(1));  // Run the timer now and schedule to run once a day
}
joshperry