get to post

pull/210/head
cppla 2022-10-31 18:36:33 +08:00
parent 14db7ec943
commit c116067c39
2 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ cd ServerStatus/server && make
```diff
! watchdog rule 可以为任何已知字段的表达式。
! watchdog interval 最小通知间隔。
! watchdog callback 可自定义为Get方法的URL告警内容将拼接其后并发起回调。
! watchdog callback 可自定义为Post方法的URL告警内容将拼接其后并发起回调。
! watchdog callback Telegramhttps://api.telegram.org/bot你自己的密钥/sendMessage?parse_mode=HTML&disable_web_page_preview=true&chat_id=你自己的标识&text=
! watchdog callback Server酱: https://sctapi.ftqq.com/你自己的密钥.send?title=ServerStatus&desp=

View File

@ -314,7 +314,6 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
time_t currentStamp = (long long)time(/*ago*/0);
if ((currentStamp-Client(ClientID)->m_AlarmLastTime) > Watchdog(ID)->m_aInterval)
{
//todo 这里需要换成线程
Client(ClientID)->m_AlarmLastTime = currentStamp;
CURL *curl;
CURLcode res;
@ -344,6 +343,7 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
sprintf(urlBuffer, "%s%s",Watchdog(ID)->m_aCallback, encodeUrl);
curl_easy_setopt(curl, CURLOPT_POST, 1);
curl_easy_setopt(curl, CURLOPT_URL, urlBuffer);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 3L);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 6L);