Scripts and howtos for providing resource information and with easily identifable colors. You can call a program or script program as part of the Teleport label configuration. In addition to regular text you can also display unicode chars that include visually capturing colors like 🟡 🟢 ❌. Please check out these examples and offer any feedback!
WARNING: Confirm any of these scripts prior to use. All of them should be non-impactful. If you configure with a low period level that may cause additional overhead on the machine.
Script files:
getnodeinfo.sh
getfreemem.sh
getfreespace.sh
Example getnodeinfo.sh
output that combines the getfreemem.sh
and getfreespace.sh
output.
stats: 25% mem 🟢 54% storage 🟡
To install:
- Retrieve this repository
- Add
getnodeinfo.sh
,getfreemem.sh
,getfreespace.sh
to user running Teleport's path or copy to/usr/local/bin
- Confirm output running
getnodeinfo.sh
ssh_service:
enabled: yes
labels:
env: prod
commands:
- command:
- getnodeinfo.sh
name: stats
period: 1m
Uses a script to confirm port for database or application
Example DB:
$ tsh db ls
Name Description Labels Connect
----------------- ------------------------------ ------------------------------- -------
dev-mysql-db 🐬 dev database status=Ok 🟢,tier=dev
dev-mysql2 🐬 Example self hosted mysql status=Unavailable ❌,tier=dev
dev-postgresql-db 🐘 dev database status=Ok 🟢,tier=dev
Script files:
getavail.sh
getavail.sh
takes the host and port number for the service to confirm is open
Calls nmap to check for available service with given service type Usage: getavail.sh getavail.sh <output map output --outputnmap>
To install:
- Retrieve this repository
- Install
nmap
if not already available - Add
getavail.sh
to user PATH running Teleport path or copy to/usr/local/bin
- Confirm output running
# getavail.sh <database or web resource host> <port>
# Confirming if a port is open
getavail.sh www.example.com 443
Ok 🟢
#Now check against a port we don't expect to be available
```bash
getavail.sh www.example.com 444
Unavailable ❌
- name: "postgresql-db"
description: "🐘 postgresql database"
protocol: "postgres"
uri: "sample-rds-postgres-database-1.daf.us-east-1.rds.amazonaws.com:5432"
aws:
region: "us-east-1"
static_labels:
env: dev
dynamic_labels:
- name: "status"
command:
- getavail.sh
- sam-rds-postgres-database-1.cmzxvtskm1qh.us-east-1.rds.amazonaws.com
- 5432
- postgresql
period: 15m
Example
tsh apps ls
Application Description Public Address Labels
----------------- ----------- --------------------------------------------- -----------------------------------------------
jenkinsapp jenkinsapp.teleport.example.com status=Ok 🟢, teleport.dev/origin=config-file
Configure your service like below.
- name: "jenkinsapp"
uri: "http://localhost:8888"
commands:
- name: "status"
command:
- getavail.sh
- localhost
- 8888
period: 5m