mirror of https://github.com/lework/script
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
508 B
29 lines
508 B
function wechattalk() |
|
{ |
|
curl -Method Get "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxx" |
|
} |
|
|
|
$msg= "Windows Server备份失败通知! |
|
" |
|
$counter= 0 |
|
|
|
#备份检查 |
|
if (Get-ChildItem D:\serverbackup\WindowsImageBackup\test\Catalog | Where{$_.LastWriteTime -lt (Get-Date).AddDays(-32)}) |
|
{ |
|
$msg= $msg + |
|
" |
|
○ test(10.8.8.1): |
|
" |
|
$counter= $counter + 1 |
|
} |
|
|
|
if ($counter -eq 0){ |
|
$msg= "Windows Server 备份检查完成,备份状态正常!" |
|
} |
|
|
|
$msg= $msg + |
|
" |
|
告警来源 127.0.0.1 |
|
" |
|
|
|
wechattalk |