HAProxy load balancer discovery with patterns
Summarize
Summary of HAProxy load balancer discovery with patterns
The Discovery and Service Mapping Patterns application in ServiceNow uses a HAProxy pattern to identify HAProxy Community load balancers on Linux servers. This discovery supports HTTP mode load balancing but does not support TCP mode. Starting with version 1.15.0 of Discovery and Service Mapping Patterns, pattern-based discovery is the default method for HAProxy load balancers, replacing probe-based discovery.
Show less
HAProxy is an open-source load balancer that can operate in TCP or HTTP modes. Note that discovery maps one-to-one relationships between front-end and back-end ports; if multiple front-ends share a back-end, only the lowest front-end port in a range is mapped to the back-end.
Prerequisites
- Ensure the Discovery and Service Mapping Patterns and Visibility Content applications are up to date.
- Verify HAProxy software is installed and running on a Linux server.
- Confirm you have permission to run the HAProxy version command and read access to the haproxy.cfg configuration file.
- Create appropriate SSH credentials to enable discovery access to the Linux server.
Discovery Process and Data Collected
During horizontal discovery, the HAProxy pattern collects details to populate the Configuration Management Database (CMDB) across several tables:
- HAProxy Load Balancer [cmdbcilbhaproxy]: Stores the load balancer name, version, and a description from the HAProxy version command.
- Load Balancer Service [cmdbcilbservice]: Captures service names (formatted as <LB name>:<LB port>), listening ports, IP addresses, and references to the HAProxy load balancer.
- Load Balancer Pool [cmdbcilbpool]: Contains pool names, load balancing methods (e.g., Round Robin), install status, timestamps of most recent discovery, and references to the parent load balancer.
- Load Balancer Pool Member [cmdbcilbpoolmember]: Details pool members including name, service port, IP address, and references to their associated pool and load balancer.
Configuration Item (CI) Relationships
The discovery process establishes key relationships between the CIs to accurately represent the HAProxy environment:
- Load Balancer Pool allocated to Load Balancer Service
- Load Balancer Pool owns Load Balancer Pool Member
- Load Balancer Pool references HAProxy Load Balancer and its Pool Members
- Load Balancer Pool Members reference HAProxy Load Balancer
- Load Balancer Service references HAProxy Load Balancer and runs on Hardware
Practical Implications for ServiceNow Customers
This pattern-based discovery enables accurate and automated identification of HAProxy load balancer configurations within your environment, populating the CMDB with detailed service, pool, and member information. It facilitates better visibility of your load balancing infrastructure for IT operations and service management. Ensuring prerequisites like permissions and application versions are met will help achieve smooth and complete discovery results.
The Discovery and Service Mapping Patterns application uses the HA Proxy pattern to find HAProxy Community load balancers running on a Linux server. Discovering some of these resources may require updating to the latest version of the Discovery and Service Mapping Patterns application from the ServiceNow Store.
HAProxy Community edition is an open-source load balancer that can run in either TCP or HTTP mode. Note that although Discovery supports HAProxy for HTTP load balancing, TCP load balancing isn’t supported.
Starting with Discovery and Service Mapping Patterns 1.15.0 version, pattern-based discovery is the default method for discovering HAProxy load balancers. For information on probe-based HAProxy discovery, see HAProxy load balancer discovery using probes.
Request apps on the Store
Visit the ServiceNow Store to view all the available apps, and for information about submitting requests to the store. For cumulative release notes information for all released apps, see the ServiceNow Store version history release notes.
To learn about HAProxy load balancers and their versions that you can discover, refer to Detailed information on products discovered by ITOM Visibility.
Prerequisites
- Verify that the applications are up to date
-
- Discovery and Service Mapping Patterns
- Visibility Content
- Verify HAProxy is installed on the Linux server
- Verify the HAProxy software is installed and running on a Linux server.
- Verify permission to run HAProxy command
- Verify you have permission to run the following command: <HAproxy Installation Path>/haproxy -v.
- Verify read access to HAProxy configuration file
- Verify you have read access to the haproxy.cfg file.
- Create SSH credentials
- For more information, see .
- Schedule a horizontal discovery
- For more information, see Schedule a horizontal discovery.
Data collected by Discovery during horizontal discovery
Discovery populates the data in the CMDB when running the HA Proxy Pattern.
| Field | Description |
|---|---|
| Name [name] | Name of the HAProxy load balancer. |
| Version [version] | Version of the HAProxy load balancer. |
| Description [short_description] | Description of the HAProxy process, which is obtained by running the command: haproxy -version. |
| Field | Description |
|---|---|
| Name [name] | Name of the load balancer in the following format: <LB name>:<LB port>. |
| Port [port] | Port on which the load balancer is listening. |
| IP Address [ip_address] | IP address of the load balancer service. |
| Last port [last_port] | Highest port number used by the load balancer service. |
| Load balancer [load_balancer] | References the HAProxy Load Balancer [cmdb_ci_lb_haproxy] table. |
| Field | Description |
|---|---|
| Name [name] | Name of the load balancer pool. |
| Load balancer [load_balancer] | References the HAProxy Load Balancer [cmdb_ci_lb_haproxy] table. |
| Load balancing method [load_balancing_method] | Method used to load balance the pool, for example: Round Robin. |
| Most recent discovery [last_discovered] | Timestamp of the most recent discovery. |
| Install Status [install_status] | Install status of the load balancer pool, for example: Installed. |
| Field | Description |
|---|---|
| Name [name] | Name of the load balancer pool member. |
| Service port [service_port] | Port used by the pool member. |
| IP Address [ip_address] | IP address of the pool member host. |
| Pool [pool] | References the Load Balancer Pool [cmdb_ci_lb_pool] table. |
| Load balancer [load_balancer] | References the HAProxy Load Balancer [cmdb_ci_lb_haproxy] table. |
CI relationships
Discovery creates these relationships to support the HAProxy load balancer discovery.
| CI | Relationship | CI |
|---|---|---|
| Load Balancer Pool [cmdb_ci_lb_pool] | Allocated to::Allocated from | Load Balancer Service [cmdb_ci_lb_service] |
| Load Balancer Pool [cmdb_ci_lb_pool] | Owns::Owned by | Load Balancer Pool Member [cmdb_ci_lb_pool_member] |
| Load Balancer Pool [cmdb_ci_lb_pool] | References | HAProxy Load Balancer [cmdb_ci_lb_haproxy] |
| Load Balancer Pool [cmdb_ci_lb_pool] | References | Load Balancer Pool Member [cmdb_ci_lb_pool_member] |
| Load Balancer Pool Member [cmdb_ci_lb_pool_member] | References | HAProxy Load Balancer [cmdb_ci_lb_haproxy] |
| Load Balancer Service [cmdb_ci_lb_service] | References | HAProxy Load Balancer [cmdb_ci_lb_haproxy] |
| Load Balancer Service [cmdb_ci_lb_service] | Runs on::Runs | Hardware [cmdb_ci_hardware] |