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/

 

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 - Cleaner Cron Architecure
Viewed 465 times since Sun, Feb 8, 2015
Nagios XI - Recurring Downtime System
Viewed 658 times since Thu, Feb 5, 2015
Nagios XI - Introduction: Getting Started with Nagios XI - NWC14
Viewed 485 times since Thu, Feb 4, 2016
Nagios XI - High Availability and Failover Solutions for Nagios XI - NWC14
Viewed 824 times since Thu, Feb 4, 2016
Nagios XI - Switch and Router Wizard Architecture
Viewed 967 times since Fri, Feb 6, 2015
Nagios XI - Maximizing Performance In Nagios XI
Viewed 600 times since Thu, Jan 28, 2016
Nagios XI - Manage MIBs Architecture
Viewed 1668 times since Tue, Feb 10, 2015
Nagios XI - Performance Data Architecture
Viewed 772 times since Wed, Jan 28, 2015
Nagios XI - Cron Jobs
Viewed 997 times since Thu, Feb 5, 2015
Nagios XI - Architecture Overview
Viewed 1325 times since Tue, Jan 27, 2015