5 Replies Latest reply on Jul 6, 2009 9:55 AM by pilhuhn

    Apache2 metrics not collected

    stfkbf

      Hi

      I have configured and apache 2.2 server including mod-apache-snmp according to the guide here:

      http://mod-apache-snmp.sourceforge.net/english/docs.htm

      after having started the snmp agent (net-snmp) and restarting apache the apache server now reports some metrics to the snmp agent:

      bin/snmpget -v1 -c public udp:localhost:1610 APACHE2-MIB::totalTraffic.0
      APACHE2-MIB::totalTraffic.0 = INTEGER: 2

      Jopr also seems to be able to make contact with the snmp agent. The agent is started using udp:localhost:1610 (when using tcp:localhost:1610 Jopr throws an exception).

      In the agent log ERRORs such as this are reported:

      2009-06-29 10:56:48,799 ERROR [ResourceContainer.invoker.daemon-782] (org.rhq.plugins.apache.ApacheServerComponent)- No values found for MIB name [wwwServiceStartTime].
      2009-06-29 10:56:48,800 ERROR [ResourceContainer.invoker.daemon-782] (org.rhq.plugins.apache.ApacheServerComponent)- No values found for MIB name [applInboundAssociations]

      Could it be that i am using the wrong apache snmp plugin (mod-apache-snmp ver 1.04)? If so which would be the correct to use?

      The mod-apache-snmp plugin seems to consist mainly of one c file (mod_ap2_snmp.c). This file only reports the following:

      snmp_set("APACHE2-MIB::serverStatus.0",'i',"4");
      snmp_set("APACHE2-MIB::serverTmpDir.0",'s',tmp_dir);
      snmp_set("APACHE2-MIB::agentHttpAddress.0",'s',agentHttpAddress);
      snmp_set("APACHE2-MIB::serverStatus.0",'i',"3");
      snmp_set("APACHE2-MIB::serverVersion.0",'s',ap_get_server_version());
      snmp_set("APACHE2-MIB::serverBuilt.0",'s',ap_get_server_built());
      snmp_set("APACHE2-MIB::serverRoot.0",'s',ap_server_root);
      snmp_set("APACHE2-MIB::serverPidfile.0",'s',pidfile_name); snmp_set("APACHE2-MIB::serverRestart.0",'s',ap_ht_time(p,ap_scoreboard_image->global->restart_time,DEFAULT_TIME_FORMAT, 0));
      snmp_set("APACHE2-MIB::totalServerPorts.0",'i',tmp_buffer);
      snmp_set("APACHE2-MIB::serverName.0",'s',s->server_hostname);
      snmp_set("APACHE2-MIB::httpError400.0",'=',"1");
      snmp_set("APACHE2-MIB::httpError403.0",'=',"1");
      snmp_set("APACHE2-MIB::httpError404.0",'=',"1");
      snmp_set("APACHE2-MIB::httpError405.0",'=',"1");
      snmp_set("APACHE2-MIB::httpError500.0",'=',"1");
      snmp_set("APACHE2-MIB::httpError501.0",'=',"1");
      snmp_set("APACHE2-MIB::httpError505.0",'=',"1");


        • 1. Re: Apache2 metrics not collected
          ips

          http://mod-apache-snmp.sourceforge.net/english/docs.htm is a different SNMP module than the one that the Jopr apache plugin works with (the Covalent SNMP Apache module, a non-opensource project now owned by SpringSource (http://www.springsource.com/products/ers)). Because the project is not opensource, you will not be able to use it unless you purchase the JBoss Operations Network (JON) product, which does include a licensed version of the Covalent SNMP module.

          Another interesting idea would be to write a new Apache Jopr plugin that knows how to talk to Mod-Apache-Snmp. It would probably not take long to do, since you could use the existing apache plugin as a reference.

          • 2. Re: Apache2 metrics not collected
            mazz

            ooo... we'd be deeply indebted to the person that implements that :) I would like a new apache plugin that integrates with Mod-Apache-Snmp... we can help you with some pointers, tips, etc. if you want to take that on. It probably wouldn't be to hard or take to long to do that either. We can discuss on jopr-dev mailing list or #jopr freenode if interested

            • 3. Re: Apache2 metrics not collected
              stfkbf

              Which approach would you suggest? Modifying the mod-apache-snmp code to post more metrics (ie. the metrics that the current Java plugin expects), or to modify the Java plugin to just work with the metrics mod-apache-snmp provides out of the box? (not very many if i read the c code correctly).

              I went to #jopr but i seem to be the only one there currently :)

              • 4. Re: Apache2 metrics not collected
                mazz

                I suggest you enhance the apache Jopr plugin to use http://mod-apache-snmp.sourceforge.net/. We've been very keen to try to get something like that done for a long time and it is needed. Once done, you could then avoid the mess with the other covalent connector.

                • 5. Re: Apache2 metrics not collected
                  pilhuhn

                  So second Mazz and to 'record' what we said on IRC:

                  pilhuhn: I would go the route of using the "official" mod_snmp in apache and then to
                  pilhuhn: a) get the plugin to use the data from there
                  pilhuhn: b) update if possible mod_snmp with patches that go back to the maintainer to expose more metrics if needed