Impress your IT Operations Peers. SDL Tridion + A Simple APM Client

Application Performance Monitoring or Management (APM) means nearly completely different things depending if you’re on the development (R&D) or operations (database/server administration) side of information technology (IT). It’s a different scale, different focus, and different vendors. To get a flavor of this, ask around for APM licensing models.

As a Web application with external APIs, extension points, OS-level events, and plenty of logs, SDL Tridion can be monitored however you see fit, with your vendor of choice. If you’re an avid Tridion World or documentation reader, you already know how to monitor publishing as far back as Tridion 5.3 per Julian Wraith’s article (I’m teasing, I missed this one until I recently searched for Tridion’s monitoring capabilities). 

Alternatively, if you’ve looked in %TRIDION_HOME%\config\ you may have come across a configuration file called cd_monitor_conf.xml. In it you’ll find two nodes:

  • HeartbeatMonitoring
  • ServiceHealthMonitorBindings
Can you guess the difference (hint: one’s a heart beat)? 
 
To impress your peers in IT Operations, create a small monitoring client. See simplified starter code based on a group chat session with SDL Web Content Management Services (WCMS aka “PS”) US team (adapted from code from Nuno and @puf).*
 

In Visual Studio 2010, right click on the references folder in the Solution Explorer and select “Add Service Reference…” Then select Advanced > Add Web Reference. Paste in the URL to your monitoring agent (e.g. http://{your CMS site}/Monitoring/TridionMonitoringAgent.asmx). Name it “Monitoring” and click on Add Reference.

You’ve now added a Web Reference instead of a regular Service Reference to the project.  

using System;
using System.Net;
using GetStatus.Monitoring;
namespace GetStatus{
    class Program    {
        static void Main(string[] args)
        {
            var agent = new TridionMonitoringAgent
                {
                    Url = "http://localhost/Monitoring/TridionMonitoringAgent.asmx",
                   Credentials = CredentialCache.DefaultCredentials
                };
            foreach (var s in agent.GetStatus())
            {
                Console.WriteLine("Service {0} : {1}", s.ServiceType, s.Status);
            }
            Console.Read();
        }
    }
}

The same can be done with a regular service; we saw Mihai whip up an alternative during the same session but using System.ServiceModel, BasicHttpBinding, and an TridionMonitoringAgentSoapClient. Don’t ask me to explain; I was glad to just be able to compile at the end.

To impress the Tridion technical community, build monitoring extension(s) and/or plugins to popular APM software. The catch of course is it probably doesn’t make sense to monitor the CM itself with a GUI in the CME.

*Yes, (me) working for SDL has its privileges. Also, to be clear, TridionDeveloper.com isn’t sponsored by SDL and see my standard I-don’t-represent-my-employer disclaimer back on my blog

Generating Web.Sitemap from Tridion (SiteMapDataSource)

In spirit of Nuno’s post last week (http://nunolinhares.blogspot.com/2012/01/its-little-things-creating-page.html) regarding website navigation and more specifically, how to generate a Breadcrumb from Structure Groups in Tridion, I thought it was time to publish a related post (and a TBB) I’ve been baking for a while now.  Behold: hooking up Tridion to .NET’s standard Navigation Controls.  I’m talking about Menu, SiteMapPath, and TreeView.  Turns out they all feed off the same, rather basic, XML file called web.sitemap.  Here is the C# code for a generic TBB that creates such a file from your SDL Tridion Web Structure Group and Pages hierarchy.

Continue reading

SDL Tridion Application Integration

When I first got the opportunity to work with Tridion, the biggest question I needed an answer to was how to integrate various applications with SDL Tridion.  At the time, I was running a project that required migrating about 20 J2EE applications tightly integrated with a legacy Plumtree Portal to a .NET platform driven by  SDL Tridion.  The organization was moving away from J2EE to become a .NET shop, so the apps needed to be rewritten in .NET – our #1 task.  All we had was a barebone Tridion installation and a bunch of manuals that did not mention anything about how to integrate apps into it.  SDL Tridion training also did not cover this topic – although we got some useful hints, we needed to see a proven design.  My intent with this article is to help any new Tridion teams to keep their project moving forward if faced with a similar situation.

The approaches discussed here are not limited to .NET.  They can be leveraged to integrate Tridion content into J2EE apps, mobile apps, or anything that you want, such as PHP, Perl, C++.  In other words, the sky is the limit.

Continue reading