How To Healthcheck Eyeglass with 3rd party monitoring tools

How To Healthcheck Eyeglass with 3rd party monitoring tools

Overview

This solution can be used with 3rd party monitoring applications to detect if eyeglass process are operating normally.  This solution will use Eyeglass API to health check the two eyeglass processes using a rest call example.

The key processes that should be monitored as running are

  • Sca

  • Scadb

  • OS commands to check if they are active and running

  • Systemctl status sca

  • Systemctl status scadb

They can be included in 3rd party tools that can monitor service status on Linux hosts.

The steps below walk through how to setup healthcheck script using the eyeglass REST API:

  1. Login to the Eyeglass web page

  2. Click on “Eyeglass Main Menu” and select “Eyeglass REST API”


  1. Click “API Tokens” tab and Click on “Create New Token”.


  1. Enter a name for this token, For example: Test.  


  1. Click API Explorer tab and Launch API Explorer.



6. After accessing to Superna Eyeglass REST API, copy the API Token (including the igls-xxx) created in the step 4 from right to the left side and paste this on the top of the window and click on “Explore” button as below:

7.  Go to Job and click on Get /jobs

8.  Scroll down and Select  “Try it out!”

9.  Copy the curl command indicated in the Curl box below: i.e. curl - X… , this curl command with the API Token allows you to verify the authentication and communication to the Superna Eyeglass.


10. In order to create an script, open a Notepad and paste the curl command indicated in the step 9 adding 2  bold commands at the beginning and at the end of the curl command as below:

curl -q -k -v  <<curl command>> 2>&1  | grep -e "HTTP" | grep "200 OK"

i.e

curl -q -k -v curl -X GET --header 'Accept: application/json' --header 'api_key: igls-103eipktk48lke2rbhds51jo3h5r02uvqk7e4e4s4set6hrt55gu' 'https://172.16.89.170/sera/v1/jobs' 2>&1  | grep -e "HTTP" | grep "200 OK"



11. Then, SSH to Eyeglass appliance as admin and sudo su to root. Copy the modified curl command above,  paste it in SSH and hit Enter. To verify the response, type:

echo $?

If the response code is 0, it indicates that is OK (Eyeglass communication is healthy), while 1 indicates fault.




12. Finally, this command allows you to create the script to monitor the Eyeglass appliance.



Typical Deployment of the Healthcheck Script




For more information, watch this how to video to build a CURL command builder  to failover Video


Comments