Transformation script and $dci object
-
-
Hi!
Just test it, and it works as expected. Can you please show full script?
Best regards,
Victor -
Hi,
Sorry, that was my mistake.
Parameter what i need to get is description (http://wiki.netxms.org/wiki/NXSL:DCI).I created a dummy dci (parameter: Dummy, Origin: Internal, Data Type: string) and here are my simple test scripts:
sub main()
{
dciName = $dci->name;
return dciName;
}
When i click test button it shows error, but when script is "running on the server" the last value tab (and history) shows dummy.sub main()
{
dciName = $dci->description;
return dciName;
}
When i click test button it shows error, but when script is "running on the server" the last value tab (and history) shows dci description.sub main()
{
nodeName = $node->name;
return nodeName;
}
When i click test button it shows node name.Many thanks for your quick reply.
Here is a long story and full script ...and sorry my bad english

I try build dashbord that shows network statistic (eg. uplinks traffic (bytes/sec), port usage (%), router cpu usage, jne.) or network "heatmap". Users that can see this dashboard does not need see any other data on the devices.
First at all i created "readonly" user that only have rights to the one dashboard, but then i get errors that user does not have nesessary rights to read the dci data. So next i give read right to Device container and now dashboard works ok, but user see too much data on devices (and can do snmp walk).
I didn't found any option to give rights to only read dci data, so now i try create dummy object that have nesessary dcis.I hope that there is is a another way to do this kind of dashboard, so any tips/ideas are more than wellcome

This is script and now it works, but if i click test button i get error.
sub main()
{
//Custom attribute "source_node"
value_sourceNode = GetCustomAttribute($node, "source_node");//DCI description, it will need to be same as dci what we want read
dciDescription = $dci->description;value_SourceObject = FindNodeObject($node, value_sourceNode);
value_DCIid = FindDCIByDescription(value_SourceObject, dciDescription);
value_DCIdata = GetDCIValue(value_SourceObject, value_DCIid);
return value_DCIdata;
}Rgs
TM -
Hi!
Currently there are no other way to show dashboard without giving read access to nodes where data is collected, so your approach is absolutely right.
As for the script, it's actually a bug - in test mode $dci variable is not set. I'll fix it in the next release.
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