Assigning Map icons based on templates

Started by Tursiops, November 15, 2015, 10:56:35 PM

Previous topic - Next topic

Tursiops

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?


Filipp Sudanov

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.

AleCoelli

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

Filipp Sudanov

templates = $node->templates;
foreach(t : templates)
{
   if (t->name == "Windows") {
      $node->setMapImage("Windows");
      break;
   }
}