Skip to content

Alert you when PM2.5 index is higher than a certain value PM2.5自动监测告警

License

Notifications You must be signed in to change notification settings

peinhu/pm25alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PM2.5告警

当PM2.5浓度在订阅者们指定的时间达到一定数值时分别进行告警。

示例3 示例2 示例1

要求  

PHP>=5.4
composer
cron

安装  

执行composer create-project -s dev peinhu/pm25alert

config/notification.php中设置通知方式的相关参数,在config/subscribers.php中设置订阅者的相关信息。

执行crontab -e,在末尾增加一行* * * * * /usr/bin/php /path-to-project/index > /dev/null 2>&1,注意/usr/bin/php请以实际为准,path-to-project替换成项目文件夹的路径。  

说明  

按PM2.5浓度而非AQI(空气质量指数)进行计算分级,分级标准参照中国/美国标准,结果仅反映PM2.5的污染情况。

默认使用pm25.in提供的api,也可换用其它api,创建一个新的DataProvider并将数据整理成标准数据格式即可。  

默认使用email进行通知,也可自行扩展其它通知服务。

发送记录和错误日志位于log/notification.log

许可证

使用GPLv2许可证, 查看LICENCE文件以获得更多信息。

About

Alert you when PM2.5 index is higher than a certain value PM2.5自动监测告警

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages