Home » Categories » Products » Nagios XI » Documentation » Architecture

Nagios XI - Command Subsystem Architecture

Command Subsystem Overview

This command subsystem of Nagios XI is responsible for processing command that are initiated from the Nagios XI web UI.  Many commands initiated from the web UI require specialized scripts to be run on the system.  These scripts are executed by the command subsystem, which then returns their output and return code to the web UI.


Architecture Components And Execution Flow

The diagram below shows the different parts of the command subsystem and how they relate to each other.  Each part of the subsystem is explained in greater detail below.


The general flow of execution of the command subsystem works as follows:

  1. A user initiates a command from the web UI (e.g. reschedules a service check)

  2. The web UI saves the command in the "xi_commands" table of the nagiosxi mysql database (mariadb on cent/rhel 7 and postgresql on XI versions less than 5)

  3. The web UI displays a throbber icon while AJAX requests are made to check for the result of the submitted command

  4. The cmdsubsys.php script runs as a background process and watches for new commands added to the database.  The cmdsubsys.php script is located at /usr/local/nagiosxi/cron/cmdsubsys.php and runs under cron every minute.  The cron job is defined in /etc/cron.d/nagiosxi.  While the cron job itself runs every minute, the script enters into a loop that lasts 59 seconds - this ensures that the processing is done constantly as opposed to only once every 60 seconds.

  5. The cmdsubsys.php script executes the system command that is required to fulfill the command

  6. The cmdsubsys.php script saves the results of the system command in the "xi_commands" database table

  7. The AJAX poller in the web UI will get the completed status of the command and display a success or error message, depending on the result of the submitted command


Troubleshooting Problems

Some potential problems with the command subsystem, as well as troubleshooting information are listed below:

Problem: The throbber continues to spin and never stops when a command is submitted

Potential Causes:

  • The cmdsubsys.php scripts may not be running. Run the following command to see if the script is running:

    • ps axuw | grep cmdsubsys.php
  • There may be a problem with the cron job.  Check the cron file /etc/cron.d/nagiosxi to ensure the job is not commented out.

  • Check the /usr/local/nagiosxi/var/cmdsubsys.log log file for errors.


Final Thoughts

For any support related questions please visit the Nagios Support Forums at:



0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments (1) Attachments
Related Articles RSS Feed
Nagios XI - High Availability and Failover Solutions for Nagios XI - NWC14
Viewed 5884 times since Thu, Feb 4, 2016
Nagios XI - Event Manager Architecture
Viewed 3795 times since Sun, Feb 8, 2015
Nagios XI - Introduction: Getting Started with Nagios XI - NWC14
Viewed 3173 times since Thu, Feb 4, 2016
Nagios XI - Switch and Router Wizard Architecture
Viewed 5417 times since Fri, Feb 6, 2015
Nagios XI - Manage MIBs Architecture
Viewed 9090 times since Tue, Feb 10, 2015
Nagios XI DB - Maintenance Architecture
Viewed 4926 times since Sun, Feb 8, 2015
Nagios XI - How XI Works
Viewed 4010 times since Wed, Jul 19, 2017
Nagios XI - Architecture Overview
Viewed 7073 times since Tue, Jan 27, 2015
Nagios XI - How to Manage Remote Nagios XI Servers
Viewed 3212 times since Thu, Jan 28, 2016
Nagios XI - Cleaner Cron Architecure
Viewed 2832 times since Sun, Feb 8, 2015