This is a cache of https://support.nagios.com/kb/article/nagios-xi-command-subsystem-architecture-58.html. It is a snapshot of the page at 2025-05-12T01:58:00.036+0000.
Nagios <strong>xi</strong> - Command Subsystem Architecture
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:

http://support.nagios.com/forum/

 



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

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 - How to Manage Remote Nagios xi Servers
Viewed 5803 times since Thu, Jan 28, 2016
Nagios xi - Cron Jobs
Viewed 10548 times since Thu, Feb 5, 2015
Nagios xi - Under the Hood - NWC15
Viewed 4777 times since Thu, Feb 4, 2016
Nagios xi - Introduction: Getting Started with Nagios xi - NWC14
Viewed 5479 times since Thu, Feb 4, 2016
Nagios xi - Manage MIBs Architecture
Viewed 14753 times since Tue, Feb 10, 2015
Nagios xi - Terminology Overview
Viewed 4772 times since Sun, Feb 8, 2015
Nagios xi - Web Interface Architecture
Viewed 8213 times since Wed, Jan 28, 2015
Nagios xi - Performance Data Architecture
Viewed 7934 times since Wed, Jan 28, 2015
Nagios xi - Maximizing Performance In Nagios xi
Viewed 6225 times since Thu, Jan 28, 2016
Nagios xi DB - Maintenance Architecture
Viewed 7920 times since Sun, Feb 8, 2015