News:

We really need your input in this questionnaire

Main Menu

DCI from table element

Started by wuwei, February 24, 2021, 02:58:10 PM

Previous topic - Next topic

wuwei

Hello,
is it possible to create a DCI from a table element?

I would have a DCI that gives me the version of an installed program (from table System.InstalledProducts) so that I will be able to create a symmary table with installed version for all clients.

Thank you.

Victor Kirhenshtein

Hi,

you can use script DCI that will read table value either directly from agent or from table DCI and extract version of product of interest. For example, this script accepts package name as argument and return it's version, directly reading table from agent:

packages = $node->readAgentTable("System.InstalledProducts");
if (packages == null)
   return null;
for(p : packages->rows)
{
   name = p->get(0);
   if (name == $ARGS[1])
      return p->get(1);
}
return null;


Best regards,
Victor

wuwei


Dawid Kellerman

Hi would some one you be so kind as to show how do I pass the argument to the script
I have it in the scripts but I set the ARG to "ProductVersionWantName" since I dont know or could not find how to pass the argument when setting the DCI
Regards Dawid

Filipp Sudanov

If you are using Script DCI to call the script, script parameters can be given in brackets after script name in parameter field.

Dawid Kellerman

Thank you Filipp
I went though all of the brackets yes I was lazy.. {}[]()

Passing arguments to scripts.



Picture being a thousand words

jdowney

Thanks for this have used this for our own netxms.