Skip to main content

Configure the RabbitMQ LAM

The RabbitMQ LAM allows Moogsoft Enterprise to ingest events from both direct queues and topic-based queues in RabbitMQ.

The LAM ingests JSON messages from an active RabbitMQ broker, for example:

  • A broker within your infrastructure.

  • A broker connected to third-party monitoring tools.

You can install a basic RabbitMQ integration in the UI. See RabbitMQ for integration steps.

Configure the RabbitMQ LAM if you want to configure custom properties, set up high availability or configure advanced options that are not available in the UI integration.

See the RabbitMQ documentation for details on RabbitMQ components.

Before You Begin

The RabbitMQ LAM has been validated with RabbitMQ 3.7.3. Before you set up the LAM, ensure you have met the following requirements:

  • You have installed RabbitMQ.

  • You have your RabbitMQ server name.

  • You have a user with permissions to access the RabbitMQ server.

  • The configured port is accessible by both parties. The default RabbitMQ port is 5672.

  • You have set up the appropriate RabbitMQ exchange. The type must be 'direct' or 'topic'.

Configure the RabbitMQ LAM

Edit the configuration file to control the behavior of the RabbitMQ LAM. You can fine the file at $MOOGSOFT_HOME/config/rabbitmq_lam.conf.

See the LAM and Integration Reference for a full description of all properties. Some properties in the file are commented out by default. Uncomment properties to enable them.LAM and Integration Reference

  1. Configure the LAM behavior:

    • max_retries: Number of worker threads to use when processing events.

    • retry_interval: Length of time to wait between reconnection attempts, in seconds.

    • message_prefetch: Controls how many messages the LAM takes from the RabbitMQ queue and holds in memory as a buffer for processing.

    • event_ack_mode: When Moogfarmd acknowledges events from the RabbitMQ LAM.

    • num_threads: Number of worker threads to use when processing events.

    • message_format: Format to receive messages in.

    • accept_all_json: Allows the LAM to read and process all forms of JSON.

    • lists_contain_multiple_events: Whether Moogsoft Enterprise interprets a JSON list as multiple events.

  2. Configure the RabbitMQ broker(s) to connect to:

    • host: RabbitMQ server to connect to.

    • port: RabbitMQ port to connect to.

  3. Configure the virtual host (vhost) to connect to. See the RabbitMQ documentation for information on vhosts.

  4. Configure authentication.

    • username: RabbitMQ username.

    • password or encrypted_password: RabbitMQ password.

  5. Configure the queue-specific parameters. You can set one or both of these:

    • direct_queue_name: Name of the direct queue in RabbitMQ.

    • topic_queue_name: Name of the topic queue in RabbitMQ.

    See the RabbitMQ LAM Reference and RabbitMQ documentation for more information on these parameters.

  6. Configure the SSL properties if you want to use SSL to encrypt communications between RabbitMQ and Moogsoft Enterprise:

    • ssl_protocol: Sets the allowed SSL protocols.

    • server_cert_file: SSL root CA file.

    • client_cert_file: SSL client certificate.

    • client_key_file: SSL client key file.

  7. Optionally configure the LAM identification and capture logging details:

    • name: Maps to $Laminstancename, so that the agent field indicates events Moogsoft Enterprise ingests from this LAM.

    • capture_log: Name and location of the LAM's capture log file, which it writes to for debugging purposes.

  8. Optionally configure severity conversions. See Severity Reference for further information and "Conversion Rules" in Tokenize Source Event Data for details on conversions in general.Data Parsing

  9. Optionally configure the process logging details:

    • configuration_file: Name and location of the LAM's process log configuration file. See Configure Logging for more information.Configure Logging

Example Configuration

An example RabbitMQ configuration is as follows:

            name        : "RabbitMQ Monitor",
            class       : "CRabbitMQMonitor",
            max_retries : -1,
            retry_interval : 60,
                    host : "",
                    port : 5672
                   host: "",
                   port: 5672
            virtual_host : "RabbitMQ",
            username : "username",
            password : "password",
            # encrypted_password : "4DZkk9W294Z+dDKMS1EMO8BCi7vyhGFNzra3T1w/Na4=",
            direct_queue_name: "RabbitMQ_LAM_Queue",
            direct_queue_durable: false,
            direct_queue_autodelete: true,
            direct_queue_exclusive: true,
            topic_queue_name : "RabbitMQ_LAM_Topic_Queue",
            topics : ["RabbitMQ_LAM_Topic1", "RabbitMQ_LAM_Topic2"],
            topic_exchange : "RabbitMQ_LAM_Topic_Exchange",
            topic_queue_durable: false,
            topic_queue_autodelete: true,
            topic_queue_exclusive: true,
            accept_all_json : true,
            lists_contain_multiple_events : true,
            ssl :

                ssl_protocol : "TLSv1.2",
                server_cert_file : "server/cert.pem",
                client_cert_file : "client/cert.pem",
                client_key_file  : "client/key.key"
            message_prefetch : 100,
            event_ack_mode : "queued_for_processing",
            num_threads: 5,
            message_format: "json"

            name: "RabbitMQ",
            capture_log: "$MOOGSOFT_HOME/log/data-capture/rabbitmq_lam.log"

            stream: "myStream",
            presend: "RabbitmqLam.js"
           configuration_file: "$MOOGSOFT_HOME/config/logging/custom.log.json"

Example Events

You can follow RabbitMQ tutorials to send a test event to Moogsoft Enterprise.

Use the following JSON payload as a Moogsoft event example:

 "description":"high network utilization in application A",

Configure for High Availability

Configure the RabbitMQ LAM for high availability if required. See High Availability Overview for details.

Configure the Stream

Configure the default stream the RabbitMQ LAM sends events to.

See LAMbot Configuration for more information. An example RabbitMQ LAM filter configuration is shown below.

    stream: "myStream",
    presend: "RabbitmqLam.js",

Start and Stop the LAM

Restart the RabbitMQ LAM to activate any changes you make to the configuration file or LAMbot.

The LAM service name is rabbitmqlamd.

See Control Moogsoft Enterprise Processes for the commands to start, stop and restart the LAM.

You can use a GET request to check the status of the RabbitMQ LAM. See "Check the LAM Status" in Configure the REST LAM for further information and examples.

Configure RabbitMQ

After you have the RabbitMQ LAM running and listening for incoming requests, you can configure RabbitMQ. See "Configure RabbitMQ" in RabbitMQ.