NetXMS Support Forum

English Support => General Support => Topic started by: MatthewDreher on October 01, 2016, 12:45:02 AM

Title: Automatic Groups of Servers
Post by: MatthewDreher on October 01, 2016, 12:45:02 AM
Hello,

How would I automatically create groups/views of servers/nodes?  For example: a view where I can see all the servers that are in maintenance mode.

I'm guessing it may have something to do with the auto apply rules, but I'm not 100% sure. 

Thank you. 
Title: Re: Automatic Groups of Servers
Post by: Tursiops on October 03, 2016, 04:23:31 AM
As you suggested, I'd create Containers and use auto-apply rules/scripts on those.
I've done similar things to group some systems at our end, not for maintenance though.
Title: Re: Automatic Groups of Servers
Post by: MatthewDreher on October 03, 2016, 08:36:09 PM
Any ideas how I would do that for servers in maintenance mode, and servers with a "problem" of some sort?
Title: Re: Automatic Groups of Servers
Post by: Tursiops on October 04, 2016, 12:53:21 AM
For systems with a certain status the following should work:

if ( $node->status == 4 ) return true;
return false;


See https://wiki.netxms.org/wiki/NXSL:NetObj for possible status values (the above is for "Critical").
I couldn't actually see any way to get the actual Maintenance status, yet for all I recall NXSL does allow you to set/unset maintenance status on a node, so I would expect there to be a way to query the current status. However, the above $node->status does not give you that, e.g. it returned "Normal" on a node that was in Normal state when I put it into maintenance mode.

Also keep in mind that this won't exactly give you a live view either. These rules are only applied when a configuration poll runs against a system, so there could be quite a delay.

For that, maybe a Dashboard with a Status Map would be more suitable. You can select which severity you want to see. Grouping is available per container, but if you have lots of Critical systems. I am not sure about the refresh here - I can't configure it. But it seems to "flicker" all the time, so that seems more live?
That map doesn't have an option for "Maintenance" though.
Title: Re: Automatic Groups of Servers
Post by: MatthewDreher on October 11, 2016, 08:47:16 PM
Maybe this could be added then?  And thanks for the info on the node status.  I would just put that as an auto apply rule to the container, right?

Also, just to make sure, nodes can be in multiple folders at once, right?
Title: Re: Automatic Groups of Servers
Post by: Tursiops on October 13, 2016, 12:50:18 AM
Yes, just adding that as an auto apply rule to a container would work.
As I said though, this will only update on configuration polls - there could be hours between them.

And yes, nodes can be in multiple containers.