Clustering with SNMP Proxy
-
Victor,
Any though/suggestion for combined/sum graph? -
Hi!
You can use transformation scripts to get values from different nodes and sum them up to value of current DCI. For example, if you have DCIs named "Param1" on nodes node1 and node2, you can create the following transformation script on node1 to add up value from node2:
node2 = FindNodeObject($node, "node2"); value = GetDCIValue(node2, FindDCIByDescription(node2, "Param1")); return $1 + value;See also the following topics:
https://www.netxms.org/forum/configuration/findnodeobject-not-working-(for-me)/
https://www.netxms.org/forum/configuration/nxsl-and-dci/Please also note that if you are using server older than 1.0.8, you must explicitly define main function in your script, i.e.
sub main() { node2 = FindNodeObject($node, "node2"); value = GetDCIValue(node2, FindDCIByDescription(node2, "Param1")); return $1 + value; }Best regards,
Victor -
Dear Victor, The script you shared did not worked. I tried to "Test" above transformation with Test value = 2(random), I get error "Error 14 in line 2: Left argument of -> must be a reference to object". I further added a check
if (node2 == null)
return 0; // No such node or access deniedand surprisingly I get this "0" returned. Please note that my nodes are part of cluster. Is that could be limitation?
Using the approach you suggest, I may loose information of my one node. I just wonder if you can have some push method from scripting. Can I create a dummy node, define data collection with origion "Push Agent". Then define a schedule to run every minute "1 * * * *". Finally do something like below into Transformation?
node1 = FindNodeObject($node, "system-1");
value1 = GetDCIValue(node1, FindDCIByDescription(node1, "Auth-Req"));
node2 = FindNodeObject($node, "system-2");
value2 = GetDCIValue(node2, FindDCIByDescription(node2, "Auth-Req"));
return value1 + value2;I'd even fine if database triger level of twick can be done as some very advance level.
-
@sumit-pandya said in Clustering with SNMP Proxy:
Dear Victor, The script you shared did not worked. I tried to "Test" above transformation with Test value = 2(random), I get error "Error 14 in line 2: Left argument of -> must be a reference to object". I further added a check
if (node2 == null)
return 0; // No such node or access deniedand surprisingly I get this "0" returned. Please note that my nodes are part of cluster. Is that could be limitation?
Did you set trusted nodes as described here: https://www.netxms.org/forum/configuration/nxsl-and-dci/msg4633/#msg4633? Most likely it's an access control issue.
@sumit-pandya said in Clustering with SNMP Proxy:
Using the approach you suggest, I may loose information of my one node. I just wonder if you can have some push method from scripting. Can I create a dummy node, define data collection with origion "Push Agent". Then define a schedule to run every minute "1 * * * *". Finally do something like below into Transformation?
node1 = FindNodeObject($node, "system-1");
value1 = GetDCIValue(node1, FindDCIByDescription(node1, "Auth-Req"));
node2 = FindNodeObject($node, "system-2");
value2 = GetDCIValue(node2, FindDCIByDescription(node2, "Auth-Req"));
return value1 + value2;I'd even fine if database triger level of twick can be done as some very advance level.
You can create additional DCI with source "Internal" and name "Dummy" (of course description can be any). It will always have value of 0, and you can schedule it like any other DCI and use transformation script to get values from two "real" DCIs and sum them.
Best regards,
Victor -
Script testing work but it doesnot gets scheduled. after some time DCI status get changed to "Not Supported". I did tried with both defaulting Interval to 60 seconds as well using advanced schedule "1 * * * *". Please guide me further.
About all other problems I think that databases changes takes very long time to get reflected into other modules/components. I request you to check commit type of activity at some configuration change activity. I suspect same could be causing database curruption while shutdown!!!
-
Could you please send me screenshots of your DCI configuration?
Best regards,
Victor -
Find attached screen. Please note that Transformation script returns proper result while testing. Below is script for your quick reference (Though it is not required)
node1 = FindNodeObject($node, "SSTLDel52");
value1 = GetDCIValue(node1, FindDCIByDescription(node1, "AuthReq"));
node2 = FindNodeObject($node, "SSTLDel54");
value2 = GetDCIValue(node2, FindDCIByDescription(node2, "AuthReq"));
return value1 + value2;After posting, I let "Parameter" name to be remained "Dummy". Now I see I can get proper values automatically by schedule. Cheers.
On another nodes: I followed your instruction about "Cluster node disapper" with patch. Now my nodes remains after restart.
I hope you have enough BUG registrar generate. Though all of my problems got resolved by workarounds

-
Yes, it must be named "Dummy". This is what I wrote in my previous message:
@victor said in Clustering with SNMP Proxy:
You can create additional DCI with source "Internal" and name "Dummy" (of course description can be any).
You can change description of the DCI, but not the name. Description is a free form text intended to be read and understand by humans, but name is a parameter's identifier understandable by server and/or agents. "Internal" origin means that values for these parameters generated by NetXMS serer itself, without asking any external entities. One of supported internal parameters is named "Dummy", and it always returns 0 when polled for value. It was added specifically for providing "ticks" for calculated DCIs.
So it is not a "workaround", it's just correct system configuration

Best regards,
Victor -
@victor said in Clustering with SNMP Proxy:
Yes, it must be named "Dummy". This is what I wrote in my previous message:
@victor said in Clustering with SNMP Proxy:
You can create additional DCI with source "Internal" and name "Dummy" (of course description can be any).
My mistake to overlook that "Quotation"
though "Quotation" is my practice as well.@victor said in Clustering with SNMP Proxy:
So it is not a "workaround", it's just correct system configuration

I'm indded sorry for that unusual term. However I's not only pointing about this "Dummy" problem. I've co-related all my experience with NetXMS, like Cluster node disapper, OS hang without n/w, etc. For this "Dummy", if you cannot allow any other name then can't it make some select-only/drop-down type input there?
Finally Yes, this thread can be closed but this has something to go into Mantis
-
Can I create DCI for dummy summary node with help of Array as below?
array monitornodes;
monitornodes = {"system-1" , "system-2", "system-3"};
summary=0;
for (i=1; monitornodes[i] != NULL ; i++)
{
inode = FindNodeObject($node, monitornodes[i]);
ivalue = GetDCIValue(inode, FindDCIByDescription(inode, "TotalAuth"));
summary = summary + ivalue;
}
return summary;I see array initialization is not been supported as above syntax. However I get success with below syntax
array monitornodes;
monitornodes[1] = "system-1";
monitornodes[2] = "system-2";
monitornodes[2] = "system-3";My point of asking is primary about array initialization syntax.
-
Hi!
The only possible initialization of array is like
monitornodes[1] = "system-1";
monitornodes[2] = "system-2";
monitornodes[2] = "system-3";I like the idea of having array initializers, I will add it to NXSL. Also, your script has an error if for loop condition - it should be monitornodes[i] != NULL, not monitornodes != NULL. So, correct version of the script should looks like this:
array monitornodes; monitornodes[1] = "system-1"; monitornodes[2] = "system-2"; monitornodes[2] = "system-3"; summary=0; for (i=1; monitornodes[i] != NULL ; i++) { inode = FindNodeObject($node, monitornodes[i]); ivalue = GetDCIValue(inode, FindDCIByDescription(inode, "TotalAuth")); summary += ivalue; } return summary;Best regards,
Victor
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