Download the PHP package cytopia/check_drupal without Composer
On this page you can find all versions of the php package cytopia/check_drupal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cytopia/check_drupal
More information about cytopia/check_drupal
Files in cytopia/check_drupal
Package check_drupal
Short Description This nagios plugin will check if your drupal site has issues (security updates, updates[optional], outstanding db updates, other problems).
License MIT
Homepage https://github.com/cytopia/check_drupal
Informations about the package check_drupal
check_drupal
Nagios drupal plugin to monitor the state of a drupal site and/or drupal multisite for security updates, system updates, core errors, core warnings and missing database migrations.
Find more plugins at Awesome Nagios | |
---|---|
Find more plugins at Icinga Exchange | |
Find more plugins at Nagios Exchange |
Tested on
- Drupal 6
- Drupal 7
- Drupal 8
Overview
Details
NOTE
This check can be used in two ways:
- Let nagios always trigger
check_drupal
which might take 1-3 seconds and cause some load - Let nagios simply parse the logfile (with
check_drupal_log
) created bycheck_drupal
via cron on the target machine.
I would recommend the second option as you do not check each drupal site every 5 minutes and also in order to keep the nagios check as fast as possible. For that use cron to trigger the check_drupal
on the target machine every 6 hours or so.
Requirements
Program | Required | Description |
---|---|---|
bourne shell (sh) | yes | The whole script is written in pure bourne shell (sh) and is 100% Posix compliant |
check_by_ssh or NRPE |
yes | check_by_ssh is used as a wrapper to check on remote hosts. Alternatively you can use NRPE as reported here: Issue #2 |
drush | yes | This nagios plugin requires drush to be installed on the target machine |
Features
- Multisite support
- Check for Drupal security updates
- Check for Drupal system updates
- Check for Drupal required database migrations
- Check for Drupal core errors
- Check for Drupal core warnings
- Every check can specify its own nagios severity (Error or Warning)
- Custom name for nagios short output
- Be able to don't show updates that are locked via drush
- Detailed information in nagios long output
- Be able to successfully recognize valid Drupal6 or Drupal7 document root
- Basic performance data fow: how many OKs, Errors, Warnings and Unknowns
1. Usage
1.1 check_drupal
With -l
you will be able to run the check_drupal
locally on each machine only a few times a day and dump the output to a logfile.
This file can then be checked normaly via nagios by calling check_drupal_log
instead, which will just read the log and not put any load onto the machine.
Multiple logfiles for multiple drupal site per server will be possible.
1.2 check_drupal_log
2. Examples
The following examples are run directly from the command line. The exit code will always be aggregated, meaning if the program throws a warning and an error, the final exit code will result in an error.
Also to note: The first line until the |
represents the actual nagios output. Everything in the first line behind the |
is performance data used to generate the cool charts. Everything from line two onwards is nagios extended status info (when you click on details).
Check for security updates
Check for security and normal updates
Check for all possible stuff
Check for db updates
3. Nagios Configuration
3.1 check_drupal
Command definition
In order to check drupal sites on remote servers you will need to make use of check_by_ssh
.
Service definition
In the above command definition there are two fixed arguments for the document root and the project name as well as one loose argument place holder that can hold all checks you want to run. The following shows one example service definition for one specific drupal site:
The above service definition will check against security updates (with nagios error), against normal updates (with nagios warning), against core errors (with nagios error), against core warnings (with nagios warning) and finally against missed database migrations (with nagios error).
3.2 check_drupal_log
Command definition
In order to check drupal sites on remote servers you will need to make use of check_by_ssh
.
Service definition
In the above command definition there is only one argument. This will point to the logfile created by check_drupal
:
Cron setup
For this recommended setup to work you need to setup a cronjob on the target machine (where the drupal site is installed) that is run every 6 hours, every day or whatever you want.
Setup multiple cronjobs with multiple logfiles if you have multiple drupal sites on this machine that you want to monitor.
4. Icinga2 Configuration
4.1 check_drupal
Command definition
Because icinga2 should be running on every monitored server, there is no need for check_by_ssh
.
Service definition
The following shows an example service definition for one specific drupal site:
The above service definition will check against security updates (with nagios error), against normal updates (with nagios warning), against core errors (with nagios error), against core warnings (with nagios warning) and finally against missed database migrations (with nagios error).
4.2 check_drupal_log
Command definition
Service definition
In the above command definition there is only one argument. This will point to the logfile created by check_drupal
:
The above service definition will look for multiple "vars.logfile" in your host.conf
:
Cron setup
For this recommended setup to work you need to setup a cronjob on the target machine (where the drupal site is installed) that is run every 6 hours, every day or whatever you want.
Setup multiple cronjobs with multiple logfiles if you have multiple drupal sites on this machine that you want to monitor.
5. Performance data
Screenshots taken from an Icinga setup
5.1 Specific data
The following performance data gives detailed information about specific errors/warnings that have occured
5.2 General data
The following performance data gives a general overview about how many OK's, Errors, Warnings and Unknowns have happened over time. This way you can also see how quickly the reaction time has been to occured problems.
Best practise:
- OK: should always be a high vertical line
- Error: Should only have short peaks
- Warning: Should only have short peaks
- Unknown: Should never happen