NGINX web server discovery

  • Release version: Xanadu
  • Updated August 1, 2024
  • 3 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of NGINX web server discovery

    NGINX web server discovery in ServiceNow identifies running NGINX web servers and associated load balancer information on Linux and Windows servers. It detects processes matching specific criteria, collects version and configuration data, and populates the Configuration Management Database (CMDB) with detailed records and their relationships.

    Show full answer Show less

    How Discovery Works

    • The NGINX Process Classifier detects running processes where the name starts with "nginx" and contains "master".
    • Upon detection, records are created in the NGINX Web Server [cmdbcinginxwebserver] or Web Server [cmdbciwebserver] tables, depending on the discovery context.
    • A "Runs on" relationship is established between the Linux server ([cmdbcilinuxserver]) and the NGINX web server records.
    • Two probes are triggered:
      • NGINX – Version: Executes a Bourne shell script to determine and populate the NGINX version.
      • NGINX – Get Configuration: Uses a Bourne shell script with an argument for the configuration file path (default /etc/nginx/nginx.conf). It reads configuration parameters and returns them as a payload, which the ServiceNow sensor parses to update the CMDB.

    Requirements

    • NGINX must be installed and actively running on the target server.
    • The MID Server must have access to the NGINX configuration file, typically located at /etc/nginx/nginx.conf.
    • SSH command execution permissions are required for the probes to run necessary commands such as nginx, echo, sed, grep, and others.
    • Prerequisites for top-down discovery using Service Mapping apply for both Windows and Linux environments.

    Data Collected and CMDB Population

    Discovery collects detailed data about NGINX servers, load balancer applications, pool members, and services. Key data fields include:

    • Name, IP address, version, and last discovery timestamp for load balancer applications.
    • Pool member details such as name, IP address, FQDN, port, and associated load balancer.
    • Load balancer service information including IP address, name, load balancer reference, and input URL.

    This data populates multiple CMDB tables, including cmdbcilbappl, cmdbcilbpoolmember, and cmdbcilbservice.

    Relationships Created

    The discovery process automatically establishes key relationships within the CMDB to represent the architecture of the NGINX deployment:

    • Load balancer applications (cmdbcilbappl) run on NGINX web servers (cmdbciwebserver).
    • Load balancer services (cmdbcilbservice) utilize load balancer pools (cmdbcilbpool).
    • Load balancer pools (cmdbcilbpool) are members of related pool member records (cmdbcilbpoolmember) and vice versa.
    • Services and pools are linked to accurately reflect their usage and membership in the environment.

    Practical Benefits for ServiceNow Customers

    By enabling NGINX web server discovery, customers can automate the identification and detailed documentation of their NGINX infrastructure within the CMDB. This supports accurate service mapping, impact analysis, and change management by providing up-to-date configuration and relationship data. Ensuring MID Server access and proper permissions allows seamless discovery and ongoing CMDB data accuracy.

    NGINX is an open source web server with a load balancer. Discovery identifies the web server and information related to the load balancer.

    Discovery identifies NGINX server software using the following process:
    1. The NGINX Process Classifier detects a running process that matches the following criteria during the exploration of a Linux server:
      • Name starts with nginx
      • Name contains master
    2. If there is a match:
      • A record is created in the NGINX Web Server [cmdb_ci_nginx_web_server] table.
      • A Runs on relationship is created in the CI Relationship [cmdb_rel_ci] table for a Linux server (Linux Server [cmdb_ci_linux_server]) and for an NGINX web server (NGINX Web Server [cmdb_ci_nginx_web_server]).
        The following two probes are triggered:
        • NGINX – Version: This probe contains a Bourne shell script. It determines the version of NGINX and populates the NGINX Web Server [cmdb_ci_nginx_web_server] table.
        • NGINX – Get Configuration: This probe contains a Bourne shell script and an argument that determines the path of the NGINX configuration file. The probe identifies configuration parameters based on keywords within the configuration file and returns them as a single payload result.
        The sensor on the ServiceNow instance parses the payload result and populates the CMDB.
    You must have the following requirements to discover an NGINX webserver:
    • NGINX is installed and running on the server.
    • The MID Server has access to the NGINX configuration file, which is /etc/nginx/nginx.conf by default.

    Requirements

    For NGINIX servers:
    • Ensure that the NGINX software is installed and running on the server.
    • Grant the MID Server has access to the NGINX configuration file, which is /etc/nginx/nginx.conf by default.
    • Enable secure shell (SSH) commands to identify the following associated elements:
      • NGINX Version
      • NGINX Get Configuration
    The following probes require execute privileges to run commands:
    Table 1. Commands
    Probe Commands
    Nginx – Version nginx
    Nginx – Get Configuration echo, sed, httpd, cut, grep, egrep (within the Bourne shell script)
    Note:
    The Nginx pattern performs top-down discovery on both Windows and Linux servers. For information on prerequisites for top-down discovery for NGINX web servers, see Prerequisites for performing top-down discovery using Service Mapping.

    Probes and Sensors

    Discovery identifies NGINX server software using the following process:
    1. The Nginx Process Classifier detects a running process that matches the following criteria during the exploration of a UNIX server:
      • The name of the process starts with nginx.
      • The name of the process contains master.
    2. If there is a match:
      • A record is created in the Web Server [cmdb_ci_web_server] table.
      • A Runs on relationship is created in the CI Relationship [cmdb_rel_ci] table for the Linux Server [cmdb_ci_linux_server] table and the Web Server [cmdb_ci_web_server] table.
    3. The following two probes are triggered:
      • Nginx – Version: this probe contains a Bourne shell script. It determines the version of NGINX and populates the Web Server [cmdb_ci_web_server] table.
      • Nginx – Get Configuration: this probe contains a Bourne shell script and an argument that determines the path of the NGINX configuration file. The probe identifies configuration parameters based on keywords within the configuration file and returns them as a single payload result.
    4. The sensor on the ServiceNow instance processes the payload and populates the CMDB.

    Data Collected

    Discovery creates or updates CMDB records when it detects a running NGINX process. The following data is collected.
    Table 2. Data Collected by Discovery for NGINX
    Table Name Field and Label Name Probe
    Name cmdb_ci_lb_appl [name] Nginx– Get Configuration
    IP Address cmdb_ci_lb_appl [ip_address] Nginx– Get Configuration
    Last Discovered cmdb_ci_lb_appl [last_discovered] Nginx– Get Configuration
    Version cmdb_ci_lb_appl [version] Nginx– Version
    Name cmdb_ci_lb_pool_member [name] Nginx– Get Configuration
    Last Discovered cmdb_ci_lb_pool_member [last_discovered] Nginx– Get Configuration
    IP Address cmdb_ci_lb_pool_member [ip_address] Nginx– Get Configuration
    Load Balancer cmdb_ci_lb_pool_member [load_balancer] Nginx– Get Configuration
    Fully Qualified Domain Name cmdb_ci_lb_pool_member [fqdn] Nginx– Get Configuration
    Port cmdb_ci_lb_pool_member [port] Nginx– Get Configuration
    Last Discovered cmdb_ci_lb_service [last_discovered] Nginx– Get Configuration
    IP Address cmdb_ci_lb_service [ip_address] Nginx– Get Configuration
    Name cmdb_ci_lb_service [name] Nginx– Get Configuration
    Load Balancer cmdb_ci_lb_service [load_balancer] Nginx– Get Configuration
    Input URL cmdb_ci_lb_service [input_url] NGINX – Get Configuration

    Relationships

    In the table [cmdb_rel_ci] the following relationships are populated:
    • The records in the cmdb_ci_lb_appl table run on the cmdb_ci_web_server table records.
    • The records in the cmdb_ci_lb_service table use the cmdb_ci_lb_pool table records.
    • The records in the cmdb_ci_pool table are used by the cmdb_ci_service table records.
    • The records in the cmdb_ci_pool table are members of the cmdb_ci_pool_member table.
    • The records in the cmdb_ci_pool_member table are members of cmdb_ci_pool table.