Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| vendors:cisco:uc:ece:chatstatusv3 [2024/08/09 14:59] – [Download] gerardorourke | vendors:cisco:uc:ece:chatstatusv3 [2024/11/05 14:17] (current) – [PHP Code to act as a health probe on the Chat API Server] gerardorourke | ||
|---|---|---|---|
| Line 250: | Line 250: | ||
| This file includes a sample webpage which uses the chatStatus API and some simple custom JavaScript to change the webpage to open/ | This file includes a sample webpage which uses the chatStatus API and some simple custom JavaScript to change the webpage to open/ | ||
| - | *{{ : | + | *{{ : |
| ===== chatStatus API Code===== | ===== chatStatus API Code===== | ||
| Line 266: | Line 266: | ||
| - Increased timeout values. If Primary DNS is down, it takes 5 seconds to attempt Backup. | - Increased timeout values. If Primary DNS is down, it takes 5 seconds to attempt Backup. | ||
| - DNS is NOT enabled by default on Red Hat Enterprise - but is strongly recommended to be enabled! | - DNS is NOT enabled by default on Red Hat Enterprise - but is strongly recommended to be enabled! | ||
| - | | + | */ |
| /* | /* | ||
| Line 1177: | Line 1177: | ||
| value: >- | value: >- | ||
| {" | {" | ||
| + | </ | ||
| + | |||
| + | ===== PHP Code to act as a health probe on the Chat API Server ===== | ||
| + | This will fail if there is an issue with Apache or Redis | ||
| + | |||
| + | <file php probe.php> | ||
| + | <?php | ||
| + | echo '< | ||
| + | |||
| + | if (!class_exists(' | ||
| + | http_response_code(500); | ||
| + | echo '< | ||
| + | exit(); | ||
| + | } | ||
| + | |||
| + | try{ | ||
| + | $redis = new Redis(); | ||
| + | $redis-> | ||
| + | //check whether server is running or not | ||
| + | echo "< | ||
| + | }catch (Exception $e) { | ||
| + | http_response_code(500); | ||
| + | //echo '< | ||
| + | echo '< | ||
| + | exit(); | ||
| + | } | ||
| + | ?> | ||
| </ | </ | ||