Table DCI parameters
-
Hi,
I'm trying to write Table DCI under AIX agent, but i'm getting disorder when it's showed on Netxms server side while trying to add this table from DCIs:
below is how I'm getting the disorder of the DCIs table where it shows that available tables are shown under name, instance column and description instead of just being under Name:
and I'm not facing the same form for single parameter:
I defined NETXMS_SUBAGENT_TABLE and NETXMS_SUBAGENT_PARAM on AIX as below (if I try to use the same number of parameters for NETXMS_SUBAGENT_TABLE and NETXMS_SUBAGENT_PARAM , I got compilation error of parameters):
static NETXMS_SUBAGENT_TABLE m_tables[] = { { "Switch.TopReadTablesWork(*)", H_TOP_READ_TABLES_WORK, NULL } , { "Switch.Test1", H_TABLE_TEST, NULL } , { "Switch.Test2", H_TABLE_TEST, NULL } , { "Switch.Test3", H_TABLE_TEST, NULL } }; static NETXMS_SUBAGENT_PARAM m_parameters[] = { { "Switch.SrcVersion", H_Version, NULL,DCI_DT_STRING, "Source long version" }, { "Switch.Echo(*)", H_Echo, NULL,DCI_DT_STRING, "Echoes string back" },Can anyone helps me out of the exact format and type of NETXMS_SUBAGENT_TABLE ???
Thanks in advance


-
Hello.
NETXMS_SUBAGENT_TABLE is defined in include/nms_agent.h: http://git.netxms.org/public/netxms.git/blob/develop:/include/nms_agent.h?js=1#l406
Table example:
Filling up structure: http://git.netxms.org/public/netxms.git/blob/develop:/src/agent/subagents/aix/main.cpp?js=1#l266
Callback implementation: http://git.netxms.org/public/netxms.git/blob/develop:/src/agent/subagents/aix/disk.cpp?js=1#l108Small tip: you can use "nxget" tool for debugging, it connects directly to the agent and query parameter / table (just make sure your IP is in Servers/MasterServers). To query for table, use "-T" switch:
nxget -T 10.5.0.111 FileSystem.Volumes -
Thank you Alex,
Thanks a lot, i found the problem, in file nms_agent.h it was:
typedef struct
{
TCHAR name[MAX_PARAM_NAME];
LONG (* handler)(const TCHAR *, const TCHAR *, Table *);
const TCHAR *arg;
} NETXMS_SUBAGENT_TABLE;instead of being
typedef struct
{
TCHAR name[MAX_PARAM_NAME];
LONG (* handler)(const TCHAR *, const TCHAR *, Table *);
const TCHAR *arg;
TCHAR instanceColumns[MAX_COLUMN_NAME * MAX_INSTANCE_COLUMNS];
TCHAR description[MAX_DB_STRING];
} NETXMS_SUBAGENT_TABLE; -
You are using extremely old version (I'd say 1.1.11), which was released in the 2012.
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