alerts/notification set up for file upload from local into Google storage bucket

huangapple go评论53阅读模式
英文:

alerts/notification set up for file upload from local into Google storage bucket

问题

我有一个脚本,可以将本地驱动器上的CSV数据文件上传到Google云存储桶。脚本计划每15分钟运行一次,任何新文件都会上传到存储桶。

我想知道是否可以设置通知/警报,以告诉我们在过去的24小时内没有上传数据时。

传感器数据保存为CSV格式在本地驱动器上,脚本将它们发送到存储桶。我希望在传感器停止工作并且在过去的24小时内没有上传数据文件时收到警报。

(传感器不会定期生成数据,每天只有一些文件,但如果它们在24小时内没有生成任何数据,那就可能出现问题,需要一个警报)

额外信息:警报系统的第二阶段将是在特定传感器不生成数据时收到警报。目前,我们有4-5个传感器,数据文件的名称为“sensorName_timestamp.csv”。如果每个传感器在过去的24小时内没有生成数据,我想收到警报。

英文:

I have a script that uploads CSV data files from a local drive into the google cloud storage bucket.
the script is scheduled to run every 15 minutes and any new files will be uploaded into the bucket.

I am wondering if we can set up notifications/alerts to tell us when no data has been uploaded within the last 24 hours.

Sensors data save as CSV in the Local drive and the script sends them to the bucket. I want to get an alert when sensors stop working and no data file is uploaded into the bucket within the past 24 hours.

(Sensors do not generate data regularly, few files per day, but if they don't generate any within 24 hours there should be something wrong and needs an alert)

Extra: The second phase of alerting system would be getting alerts for a specific sensor when it is not generating data. Currently, we have 4-5 sensors and the data files are named "sensorName_timestamp.csv"
I would like to get an alert if each sensor is not generating data within the past 24 hours.

答案1

得分: 1

如@al-dann所提到的,您可以使用云调度程序来触发云函数以设置警报或通知。

使用云调度程序,您可以设置在指定时间或定期间隔执行的计划工作单位。这些工作单位通常被称为cron作业。典型用例可能包括每天发送报告电子邮件,每10分钟更新缓存数据,或每小时更新摘要信息。

参考链接:https://cloud.google.com/scheduler/docs/schedule-run-cron-job

英文:

As mentioned by @al-dann, You can use a cloud scheduler for triggering cloud functions to set an alert or notifications.

> With Cloud Scheduler you set up scheduled units of work to be executed at defined times or regular intervals. These work units are commonly known as cron jobs. Typical use cases might include sending out a report email on a daily basis, updating cached data every 10 minutes, or updating summary information once an hour.

Reference: https://cloud.google.com/scheduler/docs/schedule-run-cron-job

huangapple
  • 本文由 发表于 2023年3月15日 19:27:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75744066.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定