Self Service Manager Overview
Self Service project integrates with Grafana as a popup div container and works seamlessly for user integration. The service includes Inventory management for your environment including:
- Environments
- Hosts Groups
- Hosts
- Services
The Self Service Project allows you to run run various healing actions / event handlers against faulty services. Using various methods such as: SSH Commands, Trigger Jenkins Jobs, Run SQL Queries ( Oracle, PostgreSQL, CouchBase etc..) and trigger custom scripts written by user.
Since Grafana and Influx Chronofraf doesn’t have the option to integrate with any other tools neither allows you to attach self-corrective action using HTML plugin available from grafana website available in this URL https://grafana.com/grafana/plugins/aidanmountford-html-panel/
Self Service High Level Architecture
How does it works?
Self Service Manager can be installed on the same operating system using either port 80 or 443 or using the Self Service Docker container which includes all packages for administrating your environment the container includes
- SSH Server
- Apache HTTP Server
- PostgreSQL Server
- Scheduler (crontab)
- Perl ( Include DB Libraries, and system management )
- Python ( Include DB Libraries and Influx Libraries )
User Flow Step by Step
- User gets an alert in Grafana dashboard and can enable the popup container within the grafana.
- Container checks permissions for the user* and grant access to the inventory list and the actions available for the specified Hosts and corresponding Services.
- User access and select the designated action and trigger the job from the GUI
- Pop-up window replace content from to the Task action results and waits… updates the page every 2 seconds.
- Plugins Manager triggers the job in the background. The job is actual plugins that installed in /usrl/local/manager/plugins
- The plugin triggers the actual job to the destination for example Jenkins and provide output for the steps.
- When plugin is finished executing the commands. The Plugins manager finish and writes the results to the logs table.
- The GUI fetches the latest updates based on the UUID from the logs table and displays the result.
- The Plugin should also return exit codes
- OK status. Job performed successfully
- WARNING status. Job performed but has some issues
- CRITICAL status. Job failed to execute.
* Not fully implemented
Self Service Container Directory structure
Self Service Management installed in: /usr/local/manager
Directories and files description
- Bin
- data_loader – Loading data to selfservice database
- influxdata.py – retrieving data from influxdb and load to selfservice
- tasks – perform maintenance actions
- etc
- macros.ini – user defined macros
- settings.ini – various settings
- plugins
- ssh.sh – ssh plugin to execute remote jobs
- Jenkins.sh – trigger Jenkins jobs
- http.sh – http plugin for RestAPI requests
- sbin
- schedulerd – Scheduler to perform daily routine tasks
- plugins_manager – executes the actual plugins
- www
- Contains WEB GUI applications
- var
- contains logs
Database Entity relationship diagram (ERD)
Connection Between tables and how they are reflected when adding data
- Create environment – Adds Data to environments table
- Create hostgroup – Adds Data to hostgroups table
- Create service – Adds data to Services table
- Create event handler – add that to event_handlers table
- Assign one event handler or more to service – adds data to events_handlers_members table – services_members_id and event_handlers_id
- assign one or more service to hostgroup – adds data to hostgroups_services tables – services_id and hostgroups_id
- Create Host – adds data to hosts table
- Add Host to Environment – add data to enviroments_members – enviroments_id and hosts_id and hostgroups_id
- Add Host to Hostgroup – add data to hostgroups_members
Option 1
- Assign Host to Service – add data to services_members – hosts_id and services_id
Option 2
- Assign services belong to hostgroup to a host – select data from hostgroups_services based on hostgroups_id and then adds this services to services_members with services_id and hosts_id