Skip to content

Commit 0e37e5e

Browse files
committed
Merge branch 'master' of github.com:cytopia/check_drupal
* 'master' of github.com:cytopia/check_drupal: Headlines Headline numbers usage Removed todo check_drupal_log
2 parents 4c42fa4 + 03c7a3f commit 0e37e5e

File tree

1 file changed

+57
-26
lines changed

1 file changed

+57
-26
lines changed

README.md

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,11 @@ Nagios drupal plugin to monitor the state of a drupal site via ssh, http or loca
2626
* Basic performance data fow: how many OKs, Errors, Warnings and Unknowns
2727

2828

29-
## 1. Nagios Configuration
30-
### Command definition
31-
In order to check drupal sites on remote servers you will need to make use of `check_by_ssh`.
32-
```bash
33-
name: check_by_ssh_drupal
34-
command: $USER1$/check_by_ssh -H $HOSTADDRESS$ -t 60 -l "$USER17$" -C "$USER22$/check_drupal -d $ARG1$ -n $ARG2$ $ARG3$"
35-
```
36-
### Service definition
37-
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:
38-
```bash
39-
check command: ssh_drupal_cool-drupal-project
40-
$ARG1$: /var/www/cool-drupal-project/drupal/
41-
$ARG2$: Cool Drupal Project
42-
$ARG3$: -s e -u w -e e -w w -m e
43-
```
44-
The above service defintion 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 updates (with nagios error).
4529

46-
## 2. Usage
30+
## 1. Usage
4731

48-
### 2.1 `check_drupal`
32+
### 1.1 `check_drupal`
4933

50-
**Note:** Currently the `-l` option is not yet implemented, but will so in a few days/weeks.
5134
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.
5235
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.
5336
Multiple logfiles for multiple drupal site per server will be possible.
@@ -112,26 +95,37 @@ For each check you can specify the nagios severity (error or warning).
11295
--version Show version information.
11396
```
11497
115-
### 2.2 `check_drupal_log`
98+
### 1.2 `check_drupal_log`
99+
100+
```bash
101+
Usage: check_drupal_log -f <logfile>
102+
OR check_drupal_log --help
103+
OR check_drupal_log --version
104+
105+
Nagios plugin that will parse the logfile created by 'check_drupal'.
116106

117-
To be implemented (1-2 weeks)
107+
-f <logfile> The full path to logfile created by 'check_drupal'
118108

109+
--help Show this help
110+
--version Show version information.
111+
```
119112
120-
## 3. Examples
113+
## 2. Examples
121114
122115
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.
123116
124117
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).
125118
126-
### 3.1 Check for security updates
119+
**Check for security updates**
127120
```bash
128121
./check_drupal -d /shared/httpd/sites-drupal/COOL-PROJECT/drupal/ -n COOL-PROJECT -s e
129122
[ERROR] COOL-PROJECT has errors: Security update(s) | 'OK'=0;;;0;1 'Errors'=1;1;1;0;1 'Warnings'=0;1;;0;1 'Unknown'=0;;;0;1
130123
==== SECURITY UPDATES ====
131124
[CRITICAL] drupal 7.40 -> 7.41
132125
[CRITICAL] jquery_update 7.x-2.6 -> 7.x-2.7
133126
```
134-
### 3.2 Check for security and normal updates
127+
128+
**Check for security and normal updates**
135129
```bash
136130
./check_drupal -d /shared/httpd/sites-drupal/COOL-PROJECT/drupal/ -n COOL-PROJECT -s e -u w
137131
[ERROR] COOL-PROJECT has errors: Security update(s), Update(s) | 'OK'=0;;;0;2 'Errors'=1;1;1;0;2 'Warnings'=1;1;;0;2 'Unknown'=0;;;0;2
@@ -144,7 +138,7 @@ Also to note: The first line until the `|` represents the actual nagios output.
144138
[WARNING] bootstrap 7.x-3.0 -> 7.x-3.1
145139
```
146140
147-
### 3.3 Check for all possible stuff
141+
**Check for all possible stuff**
148142
```bash
149143
./check_drupal -d /shared/httpd/sites-drupal/COOL-PROJECT/drupal/ -n COOL-PROJECT -s e -u w -e e -w w -m e
150144
[ERROR] COOL-PROJECT has errors: Security update(s), Update(s), Core error(s), Core warning(s) | 'OK'=1;;;0;5 'Errors'=2;1;1;0;5 'Warnings'=2;1;;0;5 'Unknown'=0;;;0;5
@@ -166,14 +160,51 @@ Also to note: The first line until the `|` represents the actual nagios output.
166160
==== DB UPDATES ====
167161
[OK] No database updates required
168162
```
169-
### 3.4 Check for db updates
163+
**Check for db updates**
170164
```bash
171165
./check_drupal -d /shared/httpd/sites-drupal/COOL-PROJECT/drupal/ -n COOL-PROJECT -m e
172166
[OK] COOL-PROJECT is healthy | 'OK'=1;;;0;1 'Errors'=0;1;1;0;1 'Warnings'=0;1;;0;1 'Unknown'=0;;;0;1
173167
==== DB UPDATES ====
174168
[OK] No database updates required
175169
```
176170
171+
## 3. Nagios Configuration
172+
173+
### 3.1 check_drupal
174+
175+
#### Command definition
176+
In order to check drupal sites on remote servers you will need to make use of `check_by_ssh`.
177+
```bash
178+
name: check_by_ssh_drupal
179+
command: $USER1$/check_by_ssh -H $HOSTADDRESS$ -t 60 -l "$USER17$" -C "$USER22$/check_drupal -d $ARG1$ -n $ARG2$ $ARG3$"
180+
```
181+
#### Service definition
182+
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:
183+
```bash
184+
check command: ssh_drupal_cool-drupal-project
185+
$ARG1$: /var/www/cool-drupal-project/drupal/
186+
$ARG2$: Cool Drupal Project
187+
$ARG3$: -s e -u w -e e -w w -m e
188+
```
189+
The above service defintion 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 updates (with nagios error).
190+
191+
### 3.2 check_drupal_log
192+
193+
#### Command definition
194+
In order to check drupal sites on remote servers you will need to make use of `check_by_ssh`.
195+
```bash
196+
name: check_by_ssh_drupal
197+
command: $USER1$/check_by_ssh -H $HOSTADDRESS$ -t 60 -l "$USER17$" -C "$USER22$/check_drupal_log -f $ARG1$"
198+
```
199+
#### Service definition
200+
In the above command definition there is only one arguments. This will point to the logfile created by `check_drupal`:
201+
```bash
202+
check command: ssh_drupal_cool-drupal-project
203+
$ARG1$: /var/log/drupal_cool-project.log
204+
```
205+
206+
207+
177208
178209
## 4. License
179210
[![license](https://poser.pugx.org/cytopia/check_drupal/license)](http://opensource.org/licenses/mit)

0 commit comments

Comments
 (0)