How To Healthcheck Eyeglass with 3rd party monitoring tools
This technical note details how to setup healthcheck script for use with 3rd party monitoring applications to detect if Eyeglass process are operating normally
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
- 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:
- Login to the Eyeglass web page
- Click on “Eyeglass Main Menu” and select “Eyeglass REST API”
- Click “API Tokens” tab and Click on “Create New Token”.
- Enter a name for this token, For example: Test.
- 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"
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:
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
Copyright Superna LLC