Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] A plugin to monitor the Sensu license #342

Open
asachs01 opened this issue Nov 8, 2022 · 0 comments
Open

[FEATURE REQUEST] A plugin to monitor the Sensu license #342

asachs01 opened this issue Nov 8, 2022 · 0 comments
Milestone

Comments

@asachs01
Copy link
Contributor

asachs01 commented Nov 8, 2022

As an enterprise or free user, I'd like to know if my license is close to expiring.

I've created this hacky bash script, but it's not an ideal solution:

#!/bin/bash


#Set variables
CURRENT_DATETIME=$(date -d now +"%s")
LICENSE_EXPIRY=$(sensuctl license info --format wrapped-json | jq .spec.license.validUntil | xargs)
LICENSE_EXPIRY_DATETIME=$(date -d $LICENSE_EXPIRY +"%s")

#Uncomment to make sure vars are working
#echo $CURRENT_DATETIME
#echo $LICENSE_EXPIRY_DATETIME

#Do some maths
DAYS_LEFT=$(( ( LICENSE_EXPIRY_DATETIME - CURRENT_DATETIME )/(60*60*24) ))

if [ $DAYS_LEFT -le 60 ]
  then
  echo "You have less than 60 days left for your Sensu license";
  exit 1
elif [ $DAYS_LEFT -le 30 ]
  then
  echo "You have less than 30 days left for your Sensu license"
  exit 2
else
  echo "You have greater than 60 days left for your Sensu license"
  exit 0
fi

@portertech portertech added this to the 6.10.0 milestone Nov 30, 2022
@portertech portertech modified the milestones: 6.10.0, 6.11.0 Jan 10, 2023
@fguimond fguimond modified the milestones: 6.11.0, 6.12.0 Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants