Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
vendors:cisco:uc:ece:chatstatusv3 [2024/11/04 17:28] – [Download] gerardorourkevendors: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 1177: Line 1177:
                   value: >-                   value: >-
                     {"chatStatus":"closed","chatStatusReason":"out of service","chatTimer":0,"errorCode":503,"errorString":"CCE BusinessHours HTTP Error.","debugLevel":0,"cacheEngine":"Redis"}                     {"chatStatus":"closed","chatStatusReason":"out of service","chatTimer":0,"errorCode":503,"errorString":"CCE BusinessHours HTTP Error.","debugLevel":0,"cacheEngine":"Redis"}
 +</file>
 +
 +===== 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 '<!DOCTYPE html><html><head><title>Chat API Probe</title></head><body><h1>Chat API Server Health Probe</h1>';
 +
 +if (!class_exists('Redis')){
 +    http_response_code(500); //SET HTTP Response Code
 +    echo '<p>500 Error - Redis Module not installed</p></body></html>';
 +    exit();
 +}
 +
 +try{
 +    $redis = new Redis();
 +    $redis->connect('127.0.0.1', 6379);
 +    //check whether server is running or not
 +    echo "<p>In Service: ".$redis->ping()."</p></body></html>";
 +}catch (Exception $e) {
 +    http_response_code(500); //SET HTTP Response Code
 +    //echo '<p>500 Error - Redis' . $e . '</p></body></html>';
 +    echo '<p>500 Error - Redis</p></body></html>';
 +    exit();
 +}
 +?>
 </file> </file>
  • vendors/cisco/uc/ece/chatstatusv3.1730741319.txt.gz
  • Last modified: 2024/11/04 17:28
  • by gerardorourke