close #16 v0.6.2已发布,增加同步阿里云ECS标签功能。
parent
c8db45e85a
commit
609feb2770
|
@ -39,6 +39,8 @@ def get_avd():
|
||||||
f"- 类型:{avd_dict['avd_type']}\n" \
|
f"- 类型:{avd_dict['avd_type']}\n" \
|
||||||
f"- 披露:{avd_dict['avd_time']}\n" \
|
f"- 披露:{avd_dict['avd_time']}\n" \
|
||||||
f"- 状态:<font color=\"#ff0000\">{avd_dict['avd_stat']}</font>({avd_dict['avd_collect']})\n"
|
f"- 状态:<font color=\"#ff0000\">{avd_dict['avd_stat']}</font>({avd_dict['avd_collect']})\n"
|
||||||
|
if avd_dict['avd_id'] == last_avd.get('avd_id'):
|
||||||
|
content = content + '(已披露漏洞,今日推送为状态或类型有更新。)\n'
|
||||||
if avd_switch['switch'] and avd_switch['wecom'] and wecomwh.startswith('https://qyapi.weixin.qq.com'):
|
if avd_switch['switch'] and avd_switch['wecom'] and wecomwh.startswith('https://qyapi.weixin.qq.com'):
|
||||||
wecom(wecomwh,content)
|
wecom(wecomwh,content)
|
||||||
if avd_switch['switch'] and avd_switch['dingding'] and dingdingwh.startswith('https://oapi.dingtalk.com'):
|
if avd_switch['switch'] and avd_switch['dingding'] and dingdingwh.startswith('https://oapi.dingtalk.com'):
|
||||||
|
@ -49,6 +51,8 @@ def get_avd():
|
||||||
f"类型:{avd_dict['avd_type']}\n" \
|
f"类型:{avd_dict['avd_type']}\n" \
|
||||||
f"披露:{avd_dict['avd_time']}\n" \
|
f"披露:{avd_dict['avd_time']}\n" \
|
||||||
f"状态:**{avd_dict['avd_stat']}**({avd_dict['avd_collect']})"
|
f"状态:**{avd_dict['avd_stat']}**({avd_dict['avd_collect']})"
|
||||||
|
if avd_dict['avd_id'] == last_avd.get('avd_id'):
|
||||||
|
md = md + '\n(已披露漏洞,今日推送为状态或类型有更新。)'
|
||||||
feishu(feishuwh,title,md)
|
feishu(feishuwh,title,md)
|
||||||
|
|
||||||
def wecom(webhook,content):
|
def wecom(webhook,content):
|
||||||
|
|
|
@ -63,7 +63,7 @@ def ecs(account,region):
|
||||||
'name':i['InstanceName'],'group':group_dict.get(i['ResourceGroupId'],'无'),'ostype':i['OSType'].lower(),
|
'name':i['InstanceName'],'group':group_dict.get(i['ResourceGroupId'],'无'),'ostype':i['OSType'].lower(),
|
||||||
'status':i['Status'],'region':region,
|
'status':i['Status'],'region':region,
|
||||||
'ip':i["InnerIpAddress"]["IpAddress"] if len(i["InnerIpAddress"]["IpAddress"]) != 0 else i['NetworkInterfaces']['NetworkInterface'][0]['PrimaryIpAddress'],
|
'ip':i["InnerIpAddress"]["IpAddress"] if len(i["InnerIpAddress"]["IpAddress"]) != 0 else i['NetworkInterfaces']['NetworkInterface'][0]['PrimaryIpAddress'],
|
||||||
'cpu':f"{i['Cpu']}核",'mem':f"{str(round(i['Memory']/1024,1)).rstrip('.0')}GB",'exp':i['ExpiredTime'].split('T')[0]
|
'cpu':f"{i['Cpu']}核",'mem':f"{str(round(i['Memory']/1024,1)).rstrip('.0')}GB",'exp':i['ExpiredTime'].split('T')[0],'ecstag': i.get('Tags',{}).get('Tag',[])
|
||||||
}for i in ecs_list}
|
}for i in ecs_list}
|
||||||
ecs_dict.update(ecs_dict_temp)
|
ecs_dict.update(ecs_dict_temp)
|
||||||
next_token = ecs.body.next_token
|
next_token = ecs.body.next_token
|
||||||
|
|
|
@ -61,6 +61,12 @@ def w2consul(vendor,account,region,ecs_dict):
|
||||||
"interval": "60s"
|
"interval": "60s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if vendor == 'alicloud' and v['ecstag'] != []:
|
||||||
|
ecstag_dict = {}
|
||||||
|
for ecstag in v['ecstag']:
|
||||||
|
if ecstag['TagKey'].encode().isalnum():
|
||||||
|
ecstag_dict[ecstag['TagKey']] = ecstag['TagValue']
|
||||||
|
data['Meta'].update(ecstag_dict)
|
||||||
reg = requests.put(puturl, headers=headers, data=json.dumps(data))
|
reg = requests.put(puturl, headers=headers, data=json.dumps(data))
|
||||||
if reg.status_code == 200:
|
if reg.status_code == 200:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
<el-autocomplete v-model="temp.env" :fetch-suggestions="Sugg_env" placeholder="优先选择" clearable class="filter-item" />
|
<el-autocomplete v-model="temp.env" :fetch-suggestions="Sugg_env" placeholder="优先选择" clearable class="filter-item" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input v-model="temp.name" placeholder="请输入" clearable class="filter-item" /><font size="2" color="#ff0000">前5个字段组合后需唯一,重复会覆盖已有监控项!</font>
|
<el-input v-model="temp.name" placeholder="请输入" clearable class="filter-item" /><font size="3px" color="#ff0000">上面5个字段组合后需唯一,重复会覆盖已有监控项!</font>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="instance">
|
<el-form-item prop="instance">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
|
|
|
@ -4,6 +4,14 @@
|
||||||
<el-link :underline="false" type="primary" icon="el-icon-star-on" href="https://github.com/starsliao/ConsulManager" target="_blank" class="dashboard-text">StarsL.cn</el-link>
|
<el-link :underline="false" type="primary" icon="el-icon-star-on" href="https://github.com/starsliao/ConsulManager" target="_blank" class="dashboard-text">StarsL.cn</el-link>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
<el-timeline>
|
<el-timeline>
|
||||||
|
<el-timeline-item timestamp="2022/6/16" placement="top">
|
||||||
|
<el-card>
|
||||||
|
<h4>v0.6.2</h4>
|
||||||
|
<p>已披露的漏洞有状态或类型更新,再次推送时候增加了提示。</p>
|
||||||
|
<p>同步阿里云ECS支持同步ECS的标签到Consul的meta中,注意标签的key有中文或符号会忽略,因为meta的key不支持。</p>
|
||||||
|
<p>自建主机的新增页面优化了描述和提交处理逻辑。</p>
|
||||||
|
</el-card>
|
||||||
|
</el-timeline-item>
|
||||||
<el-timeline-item timestamp="2022/6/13" placement="top">
|
<el-timeline-item timestamp="2022/6/13" placement="top">
|
||||||
<el-card>
|
<el-card>
|
||||||
<h4>v0.6.1</h4>
|
<h4>v0.6.1</h4>
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
||||||
|
|
||||||
<div class="title-container" style="text-align:center">
|
<div class="title-container" style="text-align:center">
|
||||||
<img src="../../assets/login_images/SLH.png" width="90" height="90">
|
<img src="../../assets/login_images/SLH.png" width="90" height="90"><br><br>
|
||||||
<h3 style="font-size:35px" class="title">Consul Manager</h3>
|
<h3 style="font-size:35px" class="title">Consul Manager</h3><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div align="center" class="title-container">
|
<div align="center" class="title-container">
|
||||||
<span style="font-size:12px" class="title">v0.6.1</span>
|
<span style="font-size:12px" class="title">v0.6.2</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -96,6 +96,7 @@
|
||||||
|
|
||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="37%">
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="37%">
|
||||||
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="auto" style="width: 90%; margin-left: 20px;">
|
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="auto" style="width: 90%; margin-left: 20px;">
|
||||||
|
<font size="3px" color="#ff0000">【注意:前5个字段组合后需唯一,重复会覆盖已有监控项!】</font>
|
||||||
<el-form-item label="机房/公司" prop="vendor">
|
<el-form-item label="机房/公司" prop="vendor">
|
||||||
<el-autocomplete v-model="temp.vendor" :fetch-suggestions="Sugg_vendor" placeholder="优先选择" clearable class="filter-item" />
|
<el-autocomplete v-model="temp.vendor" :fetch-suggestions="Sugg_vendor" placeholder="优先选择" clearable class="filter-item" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
Loading…
Reference in New Issue