[파이썬]텔레그램 푸시(2023버전)
# Script/Python2023. 1. 17. 10:45[파이썬]텔레그램 푸시(2023버전)

파이참을 작성해서 텔레그램 푸시를 테스트해볼려고하니 기존에 사용했던 방식은 먹히지 않아 구글링해본 결과 최근 텔레그램봇이 v20으로 업데이트 되면서 문제가 발생 해서 아래와 같이 하면 동작. import telegram import asyncio chat_token = "#############################" bot = telegram.Bot(token = chat_token) text = '안녕하세요' #### 리눅스에서는 아래 코드 삭제 또는 주석처리해야함 #### asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.run(bot.sendMessage(chat_id = "#############..

[파워쉘]윈도우 시간동기화 실패시 텔레그램 푸시
# Script/Powershell2020. 3. 16. 10:24[파워쉘]윈도우 시간동기화 실패시 텔레그램 푸시

$hostname = hostname $events=Get-WinEvent -FilterHashtable @ -MaxEvents 1 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $token = "#####################" $chatId = "#####################" $message = $events.message Invoke-RestMethod -Uri "https://api.telegram.org/bot$token/sendMessage?text=$message&chat_id=$chatId"

[파워쉘]veeam 백업결과 텔레그램 푸시 스크립트
# Script/Powershell2020. 3. 2. 13:57[파워쉘]veeam 백업결과 텔레그램 푸시 스크립트

Add-PSSnapin VeeamPSSnapin $vmjobname = "test" $vmjob = get-vbrjob -name $vmjobname while ($vmjob.isrunning -eq "true") { start-sleep -s 60 } $vmresult = $vmjob.findlastsession().result [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $token = "######################" $chatId = "#####################" $message = $vmjobname + " 백업결과 " + $vmresult Invoke-RestMethod -..

[파워쉘]텔레그램 푸시 오류 해결방법
# Script/Powershell2020. 2. 28. 10:45[파워쉘]텔레그램 푸시 오류 해결방법

윈도우2012서버에 접속감시 텔레그램 설정을 하였는데 어느순간부터 푸시가 오지 않아 확인해보니 아래와 같이 오류발생 Invoke-webrequest : 요청이 중단되었습니다. SSL/TLS 보안 채널을 만들 수 없습니다. 해결방법 아래내용 스크립트에 추가 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

centos5 텔레그램 알림봇 연결불가 이슈
# trouble shooting2020. 2. 27. 17:06centos5 텔레그램 알림봇 연결불가 이슈

centos5.11에서 텔레그램 감시 설정 걸었었는데 아래와 같이 오류 발생 curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version tlsv1이 문제가되어 발생된듯합니다. openssl 및 curl 버전 업그레이드하면 해결! openssl버전 업그레이드 https://darksharavim.tistory.com/463 centos5 openssl 버전 업그레이드 버전확인 $ openssl version OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 $ wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz $ ...

image