Tuesday, August 26, 2008

RHQ: Compiling the apache snmp module on Mac OS X

RHQ and JBossON allow you to monitor Apache servers through its apache plugin. We have official support via precompiled plugins for Linux and Windows and instructions in the JBossON wiki on how to compile this for other Unixoids. While Mac OS X is a Unixoid (under the covers :-), the compile of the snmp module will not directly succeed.

I want to show here how to do that anyway (I did this against apache 2.0.63 from Macports):

  • First, if not yet done install Macports

  • Then, install libtool from within macports

    sudo port instal libtool

  • Chdir to <JON_AGENT_INSTALL_DIR>/product_connectors/apache-snmp/source

  • Edit the build script (build_apache_snmp.sh) to replace two occurances of libtoolize with glibtoolize

  • edit snmp_common/ucd-snmp/agent/auto_nlist.c
    to include <sys/types.h> : (around line 30)

    #include <sys/types.h>
    #include "asn1.h"
    #include "snmp_api.h"

  • Run the build as indicated on the build page

  • When adding the snmp module config to httpd.conf, specify /var/db for SNMPVar:

    SNMPVar /var/db

Done! :-)
You can now (re)start apache and take it into inventory.

To do this, please specify the root path of the server and the relative path to the htttpd binary, as apache2 from macports is called 'httpd' and not 'apache2', so it won't be correctly detected otherwise.


Shabariji said...

Hi Rupp,
Do you know any ways how we could configure SNMP for monitoring APACHE server on MAC OS?. Could you share few points on this.

Adam Victor Nazareth Brandizzi said...

Hi, Rupp!

I'm trying to install this module on Apache, but I didn't found the compiled module on the agent instalation directory. I'm using Jopr 2.2.1. Is this module just providedy by JBossON?

Thanks in advance!

lijo said...

Hyperic had SNMP client org.hyperic.snmp.SNMPClient
Does RHQ has support for getting values from SNMP agents ?