#8424 [WIP] Add a method to monitor the running status of the script
Closed 2 years ago by humaton. Opened 4 years ago by sayanchowdhury.
sayanchowdhury/releng clean-amis-monitor  into  master

file modified
+7
@@ -507,6 +507,11 @@ 

          log.error("There was an error creating issue: %s" % ex)

  

  

+ def heartbeat():

+     p = pathlib.Path('/var/clean_amis_monitor_file')

+     p.touch()

+ 

+ 

  if __name__ == "__main__":

      argument_parser = argparse.ArgumentParser()

      argument_parser.add_argument(
@@ -593,3 +598,5 @@ 

          deleted_amis = delete_amis_nd(deletetimestamp, dry_run=args.dry_run)

          if not args.dry_run:

              generate_report_delete(deleted_amis)

+ 

+     heartbeat()

So, I'm planning add a monitor to this cron job so that we know when this script stops running. Absence of this would accumulate the AMIs which in-turn would increase the AMI bills.

Signed-off-by: Sayan Chowdhury sayan.chowdhury2012@gmail.com

@puiterwijk Since this gets deployed in one of the releng boxes, what do you think would be an ideal path to create this file. Also, just to clarify the Nagios would be tracking this file right?

/cc @mohanboddu

@puiterwijk if you would be so kind as to give this some consideration when you have a spare cycle it would be appreciated

Any location is equally fine I'd say, as long as it's in a directory where the user running this script has write permissions without having to do weird things like chmod or whatever.

@sayanchowdhury this is tagged as WIP. Is there still something that need to done in this PR ? or can we merge it ?

This PR is stalled because it was opened against a master branch that no longer exists. closing.

Pull-Request has been closed by humaton

2 years ago
Metadata