THIS KNOWLEDGE BASE HAS BEEN ARCHIVED AND IS NO LONGER BEING UPDATED
Please visit library.nagios.com/docs for the latest and most up-to-date documentation.
Home » Categories » Products » Nagios XI » Documentation » Architecture

Nagios XI - Cron Jobs

Cron Job Overview

Nagios XI includes several cron jobs that run on a regular basis to perform one or more operations or maintenance tasks. These jobs are critical to the operation of Nagios XI. An overview of the cron jobs that are part of Nagios XI are described below.

 

 

Cron Job Definition Location

Cron jobs for Nagios XI are defined in the following file on your XI server:

/etc/cron.d/nagiosxi

 

 

Individual Cron Jobs

Example contents of the /etc/cron.d/nagiosxi file from a Nagios XI 5.5.7 installation are listed below (each non-comment line corresponds to a cron job):

# /etc/cron.d/nagiosxi: crontab fragment for nagiosxi

# Backup MySQL & PostgreSQL Databases
0 7 * * * root /root/scripts/automysqlbackup
0 7 * * * root /root/scripts/autopostgresqlbackup > /dev/null 2>&1

* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php >> /usr/local/nagiosxi/var/sysstat.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php >> /usr/local/nagiosxi/var/cmdsubsys.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php >> /usr/local/nagiosxi/var/eventman.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/event_handler.php >> /usr/local/nagiosxi/var/event_handler.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php >> /usr/local/nagiosxi/var/feedproc.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php >> /usr/local/nagiosxi/var/perfdataproc.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/nom.php >> /usr/local/nagiosxi/var/nom.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php >> /usr/local/nagiosxi/var/reportengine.log 2>&1
*/5 * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php >> /usr/local/nagiosxi/var/dbmaint.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php >> /usr/local/nagiosxi/var/cleaner.log 2>&1
01 * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/recurring_downtime.php >> /usr/local/nagiosxi/var/recurringdowntime.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/deadpool.php >> /usr/local/nagiosxi/var/deadpool.log 2>&1

 

 

Debugging Cron Job Problems

If cron jobs appear to not be working, you can take the following steps to troubleshoot the problem:

  • Examine the /var/log/cron log file for error messages

  • Examine the log files from the individual cron jobs - all logs will be located in the /usr/local/nagiosxi/var directory

  • Ensure the cron system daemon is running by executing the following command from a shell prompt:

    RHEL 7 | CentOS 7 | Oracle Linux 7

    systemctl status crond.service

    Debian | Ubuntu 16/18

    systemctl status cron.service
  • Comment out the cron jobs from the /etc/cron.d/nagiosxi file and run the raw cron job commands manually (don't forget to uncomment the jobs when you're done testing)

 

 

Cron Job Tips

If you're not familiar with cron, the cron file contains various fields that determine what command gets run and on what schedule it is run. Some helpful links for better understanding cron files are listed below:

 

 

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 Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - Recurring Downtime System
Viewed 7693 times since Thu, Feb 5, 2015
Nagios XI - Architecture Overview
Viewed 14960 times since Tue, Jan 27, 2015
Nagios XI - Maximizing Performance In Nagios XI
Viewed 7163 times since Thu, Jan 28, 2016
Nagios XI - Cleaner Cron Architecure
Viewed 5645 times since Sun, Feb 8, 2015
Nagios XI - How XI Works
Viewed 7403 times since Wed, Jul 19, 2017
Nagios XI - Command Subsystem Architecture
Viewed 7816 times since Thu, Feb 5, 2015
Nagios XI - Switch and Router Wizard Architecture
Viewed 10480 times since Fri, Feb 6, 2015
Nagios XI - High Availability and Failover Solutions for Nagios XI - NWC14
Viewed 9561 times since Thu, Feb 4, 2016
Nagios XI - Terminology Overview
Viewed 5895 times since Sun, Feb 8, 2015
Nagios XI - Web Interface Architecture
Viewed 9589 times since Wed, Jan 28, 2015