-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from iml-it/add-wordpress
Add wordpress
- Loading branch information
Showing
5 changed files
with
119 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
## Wordpress | ||
|
||
### Minimal variant | ||
|
||
The following steps describe a first (and most simple) approach for a Wordpress monitoring with IML appmonitor. | ||
|
||
If you have installed ... | ||
|
||
* Wordpress directly into `[webroot]` | ||
* the appmonitor client in `[webroot]/appmonitor/`. | ||
|
||
Create a file `[webroot]/appmonitor/minimal.php` with this content: | ||
|
||
```php | ||
<?php | ||
$sApproot = $_SERVER['DOCUMENT_ROOT']; | ||
@require 'plugins/apps/wordpress.php'; | ||
``` | ||
|
||
If wordpress was installed in a subdirectory you need to set its path, eg. | ||
|
||
```php | ||
$sApproot = $_SERVER['DOCUMENT_ROOT'].'/wordpress'; | ||
``` | ||
|
||
Then request this file, eg. <https://example.com/appmonitor/minimal.php>. You should get a JSON response. | ||
|
||
If so then add this url in Appmonitor server. Done. | ||
|
||
!!! "Note" | ||
This is the most simple variant and just a quick winner. | ||
You cannot customize the builtin checks or other metadata. | ||
|
||
### Customize checks | ||
|
||
This is the preferred variant. You can... | ||
|
||
* set metadata: | ||
* name of the instance (website) | ||
* customize the ttl | ||
* set an app specific contact that will be informed on errors | ||
* add additional checks | ||
|
||
Approach: | ||
|
||
* initialize the appmonitor class | ||
* set wanted metadata | ||
* include the app plugin for wordpress | ||
* add your own checks | ||
* send the response | ||
|
||
Create a file `[webroot]/appmonitor/check-wordpress.php` with this content: | ||
|
||
```php | ||
<?php | ||
|
||
// ---------------------------------------------------------------------- | ||
// initialize | ||
require_once('classes/appmonitor-client.class.php'); | ||
$oMonitor = new appmonitor(); | ||
|
||
// ---------------------------------------------------------------------- | ||
// set metadata | ||
// $oMonitor->setWebsite('My wordpress Blog'); | ||
// $oMonitor->setTTL(300); | ||
// $oMonitor->addTag('production'); | ||
|
||
// ---------------------------------------------------------------------- | ||
// include the app plugin for wordpress | ||
$sApproot = $_SERVER['DOCUMENT_ROOT']; | ||
@require 'plugins/apps/wordpress.php'; | ||
|
||
// ---------------------------------------------------------------------- | ||
// add your custom checks | ||
// $oMonitor->addCheck(...) | ||
|
||
// ---------------------------------------------------------------------- | ||
// send the response | ||
|
||
$oMonitor->setResult(); | ||
$oMonitor->render(); | ||
|
||
// ---------------------------------------------------------------------- | ||
``` | ||
|
||
Check it with <https://example.com/appmonitor/check-wordpress.php>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# Plugins/apps folder # | ||
<html> | ||
<div class="hero"> | ||
<h2>Plugins/apps/ folder</h2> | ||
In the folder plugins/apps are the files that contain grouped checks for a few applications. | ||
</div> | ||
</html> | ||
|
||
In the folder plugins/apps are the files that contain grouped checks for a few applications. | ||
|
||
Remark: | ||
### Remark | ||
|
||
This is work in progress. Currently a few groups for products are in the repository | ||
|
||
https://github.com/iml-it/appmonitor-clients | ||
<https://github.com/iml-it/appmonitor-clients> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters