Skip to content

renderorange/bluelight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

bluelight - poll AWS for deployment and display in the terminal

SYNOPSIS

poll.pl [--quiet] [--verbose] [--version] [--help]
display.pl [--version] [--help]
blinkstick.pl [--debug] [--version] [--help]

DESCRIPTION

The scripts in this repo are used to poll the Monk's CSuite deployment status per region at AWS, then display the results in a terminal dashboard.

polling

poll.pl polls Foundant's AWS S3 bucket for deployment information.

Polling runs in a loop, querying the deployment status S3 file for each region once every 150 seconds. Results are stored in a local json cache file. If a change is detected, polling time is decreased to once every 30 seconds until complete.

The polling intervals can be configured through config.json as seen below.

OPTIONS

  • --quiet

    Only print warn and fatal level logging to STDOUT.

  • --verbose

    Log additional polling information.

  • --version

    Print the version.

  • --help

    Print the help menu.

CONFIGURATION

config.json must be created in the project dir and contain the following:

{
    "url": "content.fcsuite.com",
    "regions": {
        "base": "deploy",
        "ca": "deploy-ca",
        "or": "deploy-or",
        "au": "deploy-au",
        "us": "deploy-us"
    },
    "log_dir": "/home/blaine/git/bluelight/",
    "poll_interval_short": 30,
    "poll_interval_long": 150,
    "cache_max_age": 1800
}

keys

  • url

    The base URL to query for region values.

  • regions

    key value pairs of region name and deploy file endpoints.

  • log_dir

    The directory to write the logfile.

  • poll_interval_short

    The amount of seconds the poll interval should last when checking more quickly for changes.

  • poll_interval_long

    The amount of seconds the poll interval should last when checking less frequently for changes.

  • cache_max_age

    The max age the cache should live before being force written.

LOGGING

Logging is output to poll.log to directory configured in log_dir in the config.json file.

[1718054384][info] starting poll
[1718054384][info] polling au region
[1718054385][debug] au region query returned complete
[1718054385][info] polling base region
[1718054385][debug] base region query returned complete
[1718054385][info] base region changed from deploy to complete
[1718054385][info] base cache set to complete
[1718054385][info] setting cache write for next interval
[1718054385][info] polling ca region
[1718054385][debug] ca region query returned complete
[1718054385][info] polling or region
[1718054386][debug] or region query returned complete
[1718054386][info] polling us region
[1718054386][debug] us region query returned complete
[1718054386][info] us region changed from deploy to complete
[1718054386][info] us cache set to complete
[1718054386][info] setting cache write for next interval
[1718054386][info] release is complete, setting poll interval to 150
[1718054386][debug] writing cache
[1718054386][debug] waiting 150 seconds for poll interval

display

display.pl reads the local json cache file then displays the output status for each region in a colored status.

display output

blinkstick

Included is blinkstick.pl which can be run to update an attached blinkstick with bluelight statuses.

ramdisk

create_ramdisk.bash creates a ramdisk at ~/git/bluelight/tmp/ramdisk then moves the cache.json file into it.

This is intended to save disk writes since they happen so frequently with bluelight.

AUTHOR

Blaine Motsinger blaine@renderorange.com

About

poll AWS for deployment and display in the terminal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors