bluelight - poll AWS for deployment and display in the terminal
poll.pl [--quiet] [--verbose] [--version] [--help]
display.pl [--version] [--help]
blinkstick.pl [--debug] [--version] [--help]
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.
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.
-
--quiet
Only print warn and fatal level logging to STDOUT.
-
--verbose
Log additional polling information.
-
--version
Print the version.
-
--help
Print the help menu.
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
}
-
urlThe base URL to query for region values.
-
regionskey value pairs of region name and deploy file endpoints.
-
log_dirThe directory to write the logfile.
-
poll_interval_shortThe amount of seconds the poll interval should last when checking more quickly for changes.
-
poll_interval_longThe amount of seconds the poll interval should last when checking less frequently for changes.
-
cache_max_ageThe max age the cache should live before being force written.
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.pl reads the local json cache file then displays the output status for each region in a colored status.
Included is blinkstick.pl which can be run to update an attached blinkstick with bluelight statuses.
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.
Blaine Motsinger blaine@renderorange.com
