NetXMS Support Forum

English Support => General Support => Topic started by: Tursiops on November 15, 2015, 10:56:35 PM

Title: Assigning Map icons based on templates
Post by: Tursiops on November 15, 2015, 10:56:35 PM
Hi,

I'd like to be able to assign map icons based on a template (e.g. to allow using per-vendor icons for printers, servers, etc.).
Current templates do not seem to support that functionality (at least there is no direct option for that within the template properties).
Any idea how else this could be achieved?
Title: Re: Assigning Map icons based on templates
Post by: AleCoelli on January 28, 2020, 10:21:27 AM
+1
Title: Re: Assigning Map icons based on templates
Post by: Filipp Sudanov on January 29, 2020, 01:02:56 PM
You could create Hook::ConfigurationPoll script and change icon for node with NXSL script. It is necessary to specify GUID of image, currently in image library GUIDs are not visible, but will be visible starting from version 3.2 that should be out soon.
Title: Re: Assigning Map icons based on templates
Post by: AleCoelli on January 29, 2020, 01:12:20 PM
Quote from: Filipp Sudanov on January 29, 2020, 01:02:56 PM
You could create Hook::ConfigurationPoll script and change icon for node with NXSL script. It is necessary to specify GUID of image, currently in image library GUIDs are not visible, but will be visible starting from version 3.2 that should be out soon.
Hi Filipp, I'm trying to to exactly what you wrote.. can you link some documentation or (better) one example?
thanks

Alessandro
Title: Re: Assigning Map icons based on templates
Post by: Filipp Sudanov on January 31, 2020, 04:05:00 PM
templates = $node->templates;
foreach(t : templates)
{
   if (t->name == "Windows") {
      $node->setMapImage("Windows");
      break;
   }
}