Поддержка Net.Interface.BytesIn64() для Linux
-
Net.Interface.BytesIn64() похоже не поддерживается для Linux ( как и написано в https://wiki.netxms.org/wiki/Agent_Parameters_Compatibility_Matrix)
Однако если ядро 64разрядное, то счетчики 64битные.
root@border0:~# ifconfig eth1 eth1 Link encap:Ethernet HWaddr 00:15:17:ba:fd:c2 inet6 addr: fe80::215:17ff:feba:fdc2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:210009505322 errors:0 dropped:0 overruns:0 frame:0 TX packets:339558039233 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:78015839084215 (70.9 TiB) TX bytes:390754645687990 (355.3 TiB) Interrupt:16 Memory:fea80000-feaa0000Неплохо бы поддерживать такие DCI на 64битных системах.
-
Да, попробую добавить.
-
Я для этого уже давно написал и использую такой патчик:
--- netxms-1.2.10/src/agent/subagents/linux/linux.cpp 2013-11-15 18:04:23.000000000 +0400 +++ netxms-1.2.10-r1/src/agent/subagents/linux/linux.cpp 2014-01-09 17:51:00.000000000 +0400 @@ -180,9 +180,9 @@ { _T("Net.Interface.AdminStatus(*)"), H_NetIfInfoFromIOCTL, (TCHAR *)IF_INFO_ADMIN_STATUS, DCI_DT_INT, DCIDESC_NET_INTERFACE_ADMINSTATUS }, { _T("Net.Interface.BytesIn(*)"), H_NetIfInfoFromProc, (TCHAR *)IF_INFO_BYTES_IN, - DCI_DT_UINT, DCIDESC_NET_INTERFACE_BYTESIN }, + DCI_DT_UINT64, DCIDESC_NET_INTERFACE_BYTESIN }, { _T("Net.Interface.BytesOut(*)"), H_NetIfInfoFromProc, (TCHAR *)IF_INFO_BYTES_OUT, - DCI_DT_UINT, DCIDESC_NET_INTERFACE_BYTESOUT }, + DCI_DT_UINT64, DCIDESC_NET_INTERFACE_BYTESOUT }, { _T("Net.Interface.Description(*)"), H_NetIfInfoFromIOCTL, (TCHAR *)IF_INFO_DESCRIPTION, DCI_DT_STRING, DCIDESC_NET_INTERFACE_DESCRIPTION }, { _T("Net.Interface.InErrors(*)"), H_NetIfInfoFromProc, (TCHAR *)IF_INFO_IN_ERRORS, diff -ur netxms-1.2.10/src/agent/subagents/linux/net.cpp netxms-1.2.10-r1/src/agent/subagents/linux/net.cpp --- netxms-1.2.10/src/agent/subagents/linux/net.cpp 2013-11-29 17:56:24.000000000 +0400 +++ netxms-1.2.10-r1/src/agent/subagents/linux/net.cpp 2014-01-09 17:53:39.000000000 +0400 @@ -526,15 +526,15 @@ int i; char *eptr, szBuffer[256]; const char *pszWord; - DWORD dwValue; + QWORD qwValue; LONG nRet = SYSINFO_RC_ERROR; for(i = 0, pszWord = pszLine; i <= nPos; i++) pszWord = ExtractWordA(pszWord, szBuffer); - dwValue = strtoul(szBuffer, &eptr, 0); + qwValue = (QWORD) strtoull(szBuffer, &eptr, 0); if (*eptr == 0) { - ret_uint(pValue, dwValue); + ret_uint64(pValue, qwValue); nRet = SYSINFO_RC_SUCCESS; } return nRet; -
64 битные счетчики добавлены в 2.0.5 и 2.1-М1.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login