forked from YoLoveLife/DevOps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request YoLoveLife#91 from YoLoveLife/devel
大体完成2.0功能
- Loading branch information
Showing
78 changed files
with
1,403 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
from celery.task import periodic_task | ||
from celery.schedules import crontab | ||
from pyecharts import Pie | ||
from deveops.conf import ALIYUN_PAGESIZE,REDIS_PORT,REDIS_SPACE,EXPIREDTIME | ||
from deveops.conf import ALIYUN_PAGESIZE,REDIS_PORT,REDIS_SPACE,EXPIREDTIME,DASHBOARD_TIME,EXPIRED_TIME,MANAGER_TIME | ||
from deveops import settings | ||
import redis, datetime, json, os | ||
from deveops.utils import aliyun | ||
|
@@ -22,7 +22,7 @@ | |
connect = redis.StrictRedis(port=REDIS_PORT,db=REDIS_SPACE) | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=30,hour=1,day_of_week="sunday")) | ||
@periodic_task(run_every=DASHBOARD_TIME) | ||
def weeklyDashboard(): | ||
import jinja2 | ||
loader = jinja2.FileSystemLoader(settings.BASE_DIR+'/apps/dashboard/docs/', encoding='utf-8') | ||
|
@@ -107,10 +107,10 @@ def weeklyDashboard(): | |
f.write(html) | ||
|
||
msg = '本周平台周报地址http://deveops.8531.cn:8888/media/dashboard/'+ datetime.datetime.now().strftime('%Y-%m-%d')+'/index.html' | ||
smtp.sendMail('devEops平台运维周报', msg, ['[email protected]','[email protected]','[email protected]','[email protected]']) | ||
smtp.sendMail('devEops平台运维周报', msg, ['[email protected]'])#,'[email protected]','[email protected]','[email protected]']) | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=1,hour=1,day_of_week="sunday")) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunECSExpiredInfoCatch(): | ||
ExpiredAliyunECS.objects.all().delete() | ||
countNumber = aliyun.fetch_ECSPage() | ||
|
@@ -127,7 +127,7 @@ def aliyunECSExpiredInfoCatch(): | |
ExpiredAliyunECS(**instance_data).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=2,hour=1,day_of_week="sunday")) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunRDSInfoCatch(): | ||
ExpiredAliyunRDS.objects.all().delete() | ||
countNumber = aliyun.fetch_RDSPage() | ||
|
@@ -143,7 +143,7 @@ def aliyunRDSInfoCatch(): | |
ExpiredAliyunRDS(**resolver.AliyunRDS2Json.decode(dt)).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=3,hour=1,day_of_week="sunday")) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunKVStoreInfoCatch(): | ||
ExpiredAliyunKVStore.objects.all().delete() | ||
countNumber = aliyun.fetch_KVStorePage() | ||
|
@@ -158,7 +158,7 @@ def aliyunKVStoreInfoCatch(): | |
ExpiredAliyunKVStore(**resolver.AliyunKVStore2Json.decode(dt)).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=4,hour=1,day_of_week="sunday")) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunMongoDBInfoCatch(): | ||
ExpiredAliyunMongoDB.objects.all().delete() | ||
countNumber = aliyun.fetch_MongoDBPage() | ||
|
@@ -175,7 +175,7 @@ def aliyunMongoDBInfoCatch(): | |
ExpiredAliyunMongoDB(**resolver.AliyunMongoDB2Json.decode(dt)).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=10,hour=1)) | ||
@periodic_task(run_every=MANAGER_TIME) | ||
def managerStatusCatch(): | ||
connect.delete('MANAGER_STATUS') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding:utf-8 -*- | ||
# !/usr/bin/env python | ||
# Time 18-6-21 | ||
# Author Yo | ||
# Email [email protected] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding:utf-8 -*- | ||
# !/usr/bin/env python | ||
# Time 18-6-21 | ||
# Author Yo | ||
# Email [email protected] |
Oops, something went wrong.