Monitoring C++ applications
<p>We're implementing a new centralized monitoring solution (Zenoss). Incorporating servers, networking, and Java programs is straightforward with SNMP and JMX.</p>

<p>The question, however, is what are the best practices for monitoring and managing custom C++ applications in large, heterogenous (Solaris x86, RHEL Linux, Windows) environments?</p>

<p>Possibilities I see are:</p>

<ol><li>Net SNMP</li>
    <ul><li>Advantages</li>
        <ol><li>single, central daemon on each server</li>
            <li>well-known standard</li>
            <li>easy integration into monitoring solutions</li>
            <li>we run Net SNMP daemons on our servers already</li>
        </ol>
        <li>Disadvantages:</li>
        <ol><li>complex implementation (MIBs, Net SNMP library)</li>
            <li>new technology to introduce for the C++ developers</li>
        </ol>
    </ul>
    <li>rsyslog</li>
    <ul><li>Advantages</li>
        <ol><li>single, central daemon on each server</li>
            <li>well-known standard</li>
            <li>unknown integration into monitoring solutions (I know they can do alerts based on text, but how well would it work for sending telemetry like memory usage, queue depths, thread capacity, etc)</li>
            <li>simple implementation</li>
        </ol>
        <li>Disadvantages:</li>
        <ol><li>possible integration issues</li>
            <li>somewhat new technology for C++ developers</li>
            <li>possible porting issues if we switch monitoring vendors</li>
            <li>probably involves coming up with an ad-hoc communication protocol (or using RFC5424 structured data; I don't know if Zenoss supports that without custom Zenpack coding)</li>
        </ol>
    </ul>
    <li>Embedded JMX (embed a JVM and use JNI)</li>
    <ul><li>Advantages</li>
        <ol><li>consistent management interface for both Java and C++</li>
            <li>well-known standard</li>
            <li>easy integration into monitoring solutions</li>
            <li>somewhat simple implementation (we already do this today for other purposes)</li>
        </ol>
        <li>Disadvantages:</li>
        <ol><li>complexity (JNI, thunking layer between native C++ and Java, basically writing the management code twice)</li>
            <li>possible stability problems</li>
            <li>requires a JVM in each process, using considerably more memory</li>
            <li>JMX is new technology for C++ developers</li>
            <li>each process has it's own JMX port (we run a lot of processes on each machine)</li>
        </ol>
    </ul>
    <li>Local JMX daemon, processes connect to it</li>
    <ul><li>Advantages</li>
        <ol><li>single, central daemon on each server</li>
            <li>consistent management interface for both Java and C++</li>
            <li>well-known standard</li>
            <li>easy integration into monitoring solutions</li>
        </ol>
        <li>Disadvantages:</li>
        <ol><li>complexity (basically writing the management code twice)</li>
            <li>need to find or write such a daemon</li>
            <li>need a protocol between the JMX daemon and the C++ process</li>
            <li>JMX is new technology for C++ developers</li>
        </ol>
    </ul>
    <li>CodeMesh JunC++ion</li>
    <ul><li>Advantages</li>
        <ol><li>consistent management interface for both Java and C++</li>
            <li>well-known standard</li>
            <li>easy integration into monitoring solutions</li>
            <li>single, central daemon on each server when run in shared JVM mode</li>
            <li>somewhat simple implementation (requires code generation)</li>
        </ol>
        <li>Disadvantages:</li>
        <ol><li>complexity (code generation, requires a GUI and several rounds of tweaking to produce the proxied code)</li>
            <li>possible JNI stability problems</li>
            <li>requires a JVM in each process, using considerably more memory (in embedded mode)</li>
            <li>Does not support Solaris x86 (deal breaker)</li>
            <li>Even if it did support Solaris x86, there are possible compiler compatibility issues (we use an odd combination of STLPort and Forte on Solaris</li>
            <li>each process has it's own JMX port when run in embedded mode (we run a lot of processes on each machine)</li>
            <li>possibly precludes a shared JMX server for non-C++ processes (?)</li>
        </ol>
    </ul>
</ol>

<p>Is there some reasonably standardized, simple solution I'm missing? </p>

<p>Given no other reasonable solutions, which of these solutions is typically used for custom C++ programs? </p>

<p>My gut feel is that Net SNMP is how people do this, but I'd like other's input and experience before I make a decision.</p>
