6 Replies Latest reply on Aug 22, 2019 10:55 AM by Hitesh Jha

    Check Enabled Apache Modules

    Hitesh Jha
      Share This:

      Experts,

      Is it possible to get the list of all enabled apache loaded modules through Discovery.

      I have ran the below command on our appliance through CLI and found below o/p.

       

      [root@cltdvladmc01 ~]# apachectl -M

      Loaded Modules:

      core_module (static)

      mpm_prefork_module (static)

      http_module (static)

      so_module (static)

      auth_basic_module (shared)

      auth_digest_module (shared)

      authn_file_module (shared)

      authn_alias_module (shared)

      authn_anon_module (shared)

      authn_dbm_module (shared)

      authn_default_module (shared)

      authz_host_module (shared)

      authz_user_module (shared)

      authz_owner_module (shared)

      authz_groupfile_module (shared)

      authz_dbm_module (shared)

      authz_default_module (shared)

      ldap_module (shared)

      authnz_ldap_module (shared)

      include_module (shared)

      log_config_module (shared)

      logio_module (shared)

      env_module (shared)

      ext_filter_module (shared)

      mime_magic_module (shared)

      expires_module (shared)

      deflate_module (shared)

      headers_module (shared)

      usertrack_module (shared)

      setenvif_module (shared)

      mime_module (shared)

      vhost_alias_module (shared)

      negotiation_module (shared)

      dir_module (shared)

      actions_module (shared)

      speling_module (shared)

      alias_module (shared)

      substitute_module (shared)

      rewrite_module (shared)

      cache_module (shared)

      suexec_module (shared)

      disk_cache_module (shared)

      cgi_module (shared)

      version_module (shared)

      proxy_module (shared)

      proxy_http_module (shared)

      nss_module (shared)

      ssl_module (shared)

      webkit_module (shared)

      Syntax OK

       

      Hitesh

        • 1. Re: Check Enabled Apache Modules
          Andrew Waters

          You could certainly write using discovery.runCommand to do this.

          • 2. Re: Check Enabled Apache Modules
            Hitesh Jha

            Andrew,

            As checked we can get the module details from the discovery itself.

            I have used the below query to identify the list.

            search SoftwareInstance where * has subword 'apache http' show #RunningSoftware:HostedSoftware:Host:.name as 'Host', type, product_version, #RunningSoftware:HostedSoftware:Host:Host.os_type as 'OS Type', installed_modules as 'Installed Modules'

             

            But Is it possible to get the Installed modules in the row format instead of comma separated values.

            • 3. Re: Check Enabled Apache Modules
              Lisa Keeler

              I don't know a way to get 1 row per value of an attribute which returns a comma-separated list, like installed_modules does.

               

              EXPLODE doesn't work for this case, and I don't know another way in the query language.

               

              It would be a nice feature though.  Maybe create an Idea for it?

              1 of 1 people found this helpful
              • 4. Re: Check Enabled Apache Modules
                Andrew Waters

                Why do you think explode does not work? From the docs:

                Normally, if an attribute contains a list, or a key expression traversal that leads to multiple nodes, all items in the list appear in a single cell in the results. Sometimes, particularly when exporting data to other systems, it can be useful instead to 'explode' the items in the list into multiple output rows.

                You may want to base your query on the pattern as there are many different ways the Apache HTTPD based to be named; For example

                SEARCH Pattern

                WHERE name = "ApacheBasedWebservers.ApacheBasedWebserver"

                TRAVERSE Pattern:Maintainer:Element:SoftwareInstance

                SHOW

                #RunningSoftware:HostedSoftware:Host:.name AS 'Host',

                type,

                  product_version,

                  #RunningSoftware:HostedSoftware:Host:Host.os_type AS 'OS Type',

                  EXPLODE installed_modules AS 'Installed Modules'

                works for me.

                2 of 2 people found this helpful
                • 5. Re: Check Enabled Apache Modules
                  Lisa Keeler

                  Good to know.  Thanks, Andrew.

                  I had tried it a few months ago on a different query, and I couldn't seem to get it to work.  Maybe there was something else in the query that was not working...

                   

                  This does work for me now that I tried it:

                  search SoftwareInstance where * has subword 'apache http' show #RunningSoftware:HostedSoftware:Host:.name as 'Host', type, product_version, #RunningSoftware:HostedSoftware:Host:Host.os_type as 'OS Type',

                  EXPLODE

                  installed_modules as 'Installed Modules'

                   

                  1 of 1 people found this helpful
                  • 6. Re: Check Enabled Apache Modules
                    Hitesh Jha

                    I guess EXPLODE will work ..I am doing the wrong ..I didn't put the spaces between explode and installed_modules

                     

                    As checked now updated query is working fine now.

                    search SoftwareInstance where * has subword 'apache http' show #RunningSoftware:HostedSoftware:Host:.name as 'Host', type, product_version, #RunningSoftware:HostedSoftware:Host:Host.os_type as 'OS Type', explode installed_modules as 'Installed Modules'

                    1 of 1 people found this helpful