get values from a DCI table with a tranform script
-
Can someone give me an example of a transform script that pulls a value from a DCI table into a variable?
-
Line like this:
table = AgentReadTable($node, "System.Processes");will read agent table (System.Processes in this example) into variable. It will be object variable of class Table. Then you can walk through table using it's methods. For example, to read value of column "NAME" in first row you can use the following code:
colIndex = table->getColumnIndex("NAME"); value = table->get(0, colIndex);You can iterate through table using rowCount attribute as stop indicator:
for(row = 0; row < table->rowCount; row++) { value = table->get(row, colIndex); }Best regards,
VictorP.S. If you meant transformation script of a table DCI, then you don't need to read table - variable $1 will hold table object.
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