mirror of
https://github.com//cppla/ServerStatus
synced 2025-07-04 08:25:58 +08:00
commit
11a03a020c
server/src
File diff suppressed because it is too large
Load Diff
@ -270,8 +270,19 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
|
|||||||
typedef exprtk::expression<double> expression_t;
|
typedef exprtk::expression<double> expression_t;
|
||||||
typedef exprtk::parser<double> parser_t;
|
typedef exprtk::parser<double> parser_t;
|
||||||
const std::string expression_string = Watchdog(ID)->m_aRule;
|
const std::string expression_string = Watchdog(ID)->m_aRule;
|
||||||
|
int ClientID = ClientNetToClient(ClientNetID);
|
||||||
|
std::string username = Client(ClientID)->m_aUsername;
|
||||||
|
std::string name = Client(ClientID)->m_aName;
|
||||||
|
std::string type = Client(ClientID)->m_aType;
|
||||||
|
std::string host = Client(ClientID)->m_aHost;
|
||||||
|
std::string location = Client(ClientID)->m_aLocation;
|
||||||
|
|
||||||
symbol_table_t symbol_table;
|
symbol_table_t symbol_table;
|
||||||
|
symbol_table.add_stringvar("username", username);
|
||||||
|
symbol_table.add_stringvar("name", name);
|
||||||
|
symbol_table.add_stringvar("type", type);
|
||||||
|
symbol_table.add_stringvar("host", host);
|
||||||
|
symbol_table.add_stringvar("location", location);
|
||||||
symbol_table.add_variable("load_1",load_1);
|
symbol_table.add_variable("load_1",load_1);
|
||||||
symbol_table.add_variable("load_5",load_5);
|
symbol_table.add_variable("load_5",load_5);
|
||||||
symbol_table.add_variable("load_15",load_15);
|
symbol_table.add_variable("load_15",load_15);
|
||||||
@ -310,7 +321,6 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
|
|||||||
|
|
||||||
if (expression.value() > 0)
|
if (expression.value() > 0)
|
||||||
{
|
{
|
||||||
int ClientID = ClientNetToClient(ClientNetID);
|
|
||||||
time_t currentStamp = (long long)time(/*ago*/0);
|
time_t currentStamp = (long long)time(/*ago*/0);
|
||||||
if ((currentStamp-Client(ClientID)->m_AlarmLastTime) > Watchdog(ID)->m_aInterval)
|
if ((currentStamp-Client(ClientID)->m_AlarmLastTime) > Watchdog(ID)->m_aInterval)
|
||||||
{
|
{
|
||||||
@ -330,11 +340,11 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
|
|||||||
sprintf(encodeBuffer, "【告警名称】 %s \n\n【告警时间】 %s \n\n【用户名】 %s \n\n【节点名】 %s \n\n【虚拟化】 %s \n\n【主机名】 %s \n\n【位 置】 %s",
|
sprintf(encodeBuffer, "【告警名称】 %s \n\n【告警时间】 %s \n\n【用户名】 %s \n\n【节点名】 %s \n\n【虚拟化】 %s \n\n【主机名】 %s \n\n【位 置】 %s",
|
||||||
Watchdog(ID)->m_aName,
|
Watchdog(ID)->m_aName,
|
||||||
standardTime,
|
standardTime,
|
||||||
Client(ClientID)->m_aUsername,
|
username.c_str(),
|
||||||
Client(ClientID)->m_aName,
|
name.c_str(),
|
||||||
Client(ClientID)->m_aType,
|
type.c_str(),
|
||||||
Client(ClientID)->m_aHost,
|
host.c_str(),
|
||||||
Client(ClientID)->m_aLocation);
|
location.c_str());
|
||||||
char *encodeUrl = curl_easy_escape(curl, encodeBuffer, strlen(encodeBuffer));
|
char *encodeUrl = curl_easy_escape(curl, encodeBuffer, strlen(encodeBuffer));
|
||||||
|
|
||||||
//standard url
|
//standard url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user