*UPDATE* Object tools filer by client OS for local commands fixes #1249
authorEriks Jenkevics <eriks@netxms.org>
Wed, 31 Aug 2016 10:34:02 +0000 (13:34 +0300)
committerEriks Jenkevics <eriks@netxms.org>
Wed, 31 Aug 2016 10:34:02 +0000 (13:34 +0300)
src/java/client/netxms-client/src/main/java/org/netxms/client/objecttools/ObjectTool.java
src/java/client/netxms-client/src/main/java/org/netxms/client/objecttools/ObjectToolDetails.java
src/java/client/netxms-client/src/main/java/org/netxms/client/objecttools/ObjectToolFilter.java
src/java/netxms-eclipse/ObjectTools/src/org/netxms/ui/eclipse/objecttools/messages.properties
src/java/netxms-eclipse/ObjectTools/src/org/netxms/ui/eclipse/objecttools/messages_ru.properties
src/java/netxms-eclipse/ObjectTools/src/org/netxms/ui/eclipse/objecttools/propertypages/Filter.java
webui/webapp/ObjectTools/src/org/netxms/ui/eclipse/objecttools/messages.properties
webui/webapp/ObjectTools/src/org/netxms/ui/eclipse/objecttools/messages_ru.properties
webui/webapp/ObjectTools/src/org/netxms/ui/eclipse/objecttools/propertypages/Filter.java

index b793f77..7351e38 100644 (file)
@@ -52,10 +52,10 @@ public class ObjectTool
        public static final int GENERATES_OUTPUT          = 0x00000010;
        public static final int DISABLED                  = 0x00000020;
        public static final int SHOW_IN_COMMANDS          = 0x00000040;
-   public static final int REQUIRES_REMOTE_OS_MATCH  = 0x00000080;
+   public static final int REQUIRES_NODE_OS_MATCH  = 0x00000080;
    public static final int REQUIRES_TEMPLATE_MATCH   = 0x00000100;
        public static final int SNMP_INDEXED_BY_VALUE     = 0x00010000;
-       public static final int REQUIRES_LOCAL_OS_MATCH   = 0x00020000;
+       public static final int REQUIRES_WORKSTATION_OS_MATCH   = 0x00020000;
        
        protected long id;
        protected String name;
@@ -222,10 +222,10 @@ public class ObjectTool
                                return false;   // OID does not match
                }
                
-          if ((flags & REQUIRES_REMOTE_OS_MATCH) != 0)
+          if ((flags & REQUIRES_NODE_OS_MATCH) != 0)
       {
              boolean match = false;
-             String[] substrings = filter.toolLocOS.split(",");
+             String[] substrings = filter.toolNodeOS.split(",");
              for(int i = 0; i < substrings.length; i++)
              {;
                 if (Pattern.matches(substrings[i], node.getPlatformName()))
@@ -237,10 +237,10 @@ public class ObjectTool
                 return false;  //Not correct type of OS
       }
           
-          if ((flags & REQUIRES_LOCAL_OS_MATCH) != 0)
+          if ((flags & REQUIRES_WORKSTATION_OS_MATCH) != 0)
       {
          boolean match = false;
-         String[] substrings = filter.toolLocOS.split(",");
+         String[] substrings = filter.toolWorkstationOS.split(",");
          for(int i = 0; i < substrings.length; i++)
          {;
             if (Pattern.matches(substrings[i], System.getProperty("os.name")))
@@ -430,17 +430,17 @@ public class ObjectTool
    /**
     * @return the toolRemOS
     */
-   public String getToolRemOS()
+   public String getToolNodeOS()
    {
-      return filter.toolRemOS;
+      return filter.toolNodeOS;
    }
    
    /**
     * @return the toolLocOS
     */
-   public String getToolLocOS()
+   public String getToolWorkstationOS()
    {
-      return filter.toolLocOS;
+      return filter.toolWorkstationOS;
    }
 
    /**
index 0b3ed9d..1bf15dd 100644 (file)
@@ -290,20 +290,20 @@ public class ObjectToolDetails extends ObjectTool
    }
 
    /**
-    * @param toolRemOS  the comma separated list of OS name regexps
+    * @param toolNodeOS  the comma separated list of OS name regexps
     */
-   public void setToolRemOS(String toolRemOS)
+   public void setToolNodeOS(String toolNodeOS)
    {
-      filter.toolRemOS = toolRemOS;
+      filter.toolNodeOS = toolNodeOS;
       modified = true;
    }
    
    /**
-    * @param toolLocOS  the comma separated list of OS name regexps
+    * @param toolWorkstationOS  the comma separated list of OS name regexps
     */
-   public void setToolLocOS(String toolLocOS)
+   public void setToolWorkstationOS(String toolWorkstationOS)
    {
-      filter.toolLocOS = toolLocOS;
+      filter.toolWorkstationOS = toolWorkstationOS;
       modified = true;
    }
 
index 5522c78..03bffd4 100644 (file)
@@ -14,10 +14,10 @@ import org.simpleframework.xml.core.Persister;
 public class ObjectToolFilter
 {
    @Element(required=false, name="toolOS")
-   public String toolRemOS;
+   public String toolNodeOS;
    
    @Element(required=false)
-   public String toolLocOS;
+   public String toolWorkstationOS;
    
    @Element(required=false)
    public String toolTemplate;
@@ -54,8 +54,8 @@ public class ObjectToolFilter
    
    public ObjectToolFilter()
    {
-      toolRemOS = "";
-      toolLocOS = "";
+      toolNodeOS = "";
+      toolWorkstationOS = "";
       toolTemplate = "";
       snmpOid = "";
    }
index a5ffe5e..5622fc1 100644 (file)
@@ -41,7 +41,7 @@ EditInputFieldDialog_Type=Type
 EditInputFieldDialog_ValidatePassword=Validate password after entry
 Filter_AgentNeeded=NetXMS agent should be available
 Filter_OIDShouldMatch=Node SNMP OID should match with the following template:
-Filter_OSShouldMatch=Remote system OS name should match this template(coma separated regular expression list):
+Filter_OSShouldMatch=Node OS name should match this template(coma separated regular expression list):
 Filter_SNMPNeeded=Node should support SNMP
 Filter_TemplateShouldMatch=Parent template name should match this template(coma separated regular expression list):
 General_AgentCommand=Agent's command
index f70a151..b224418 100644 (file)
@@ -41,7 +41,7 @@ EditInputFieldDialog_Type=\u0422\u0438\u043f
 EditInputFieldDialog_ValidatePassword=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430
 Filter_AgentNeeded=\u0410\u0433\u0435\u043d\u0442 NetXMS \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d
 Filter_OIDShouldMatch=\u0423\u0437\u0435\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c SNMP OID, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443:
-Filter_OSShouldMatch=\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0439 \u041e\u0421 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443(\u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438):
+Filter_OSShouldMatch=\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u041e\u0421 \u0443\u0437\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443(\u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438):
 Filter_SNMPNeeded=\u0423\u0437\u0435\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c SNMP
 Filter_TemplateShouldMatch=\u0418\u043c\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443(\u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438):
 General_AgentCommand=\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u0430
index a2d4025..39ce043 100644 (file)
@@ -42,12 +42,12 @@ public class Filter extends PropertyPage
        private Button checkAgent;
        private Button checkSNMP;
        private Button checkMatchOID;
-       private Button checkMatchRemoteOS;
-       private Button checkMatchLocalOS;
+       private Button checkMatchNodeOS;
+       private Button checkMatchWorkstationOS;
        private Button checkMatchTemplate;
        private Text textOID;
-       private Text textRemOS;
-       private Text textLocOS;
+       private Text textNodeOS;
+       private Text textWorkstationOS;
        private Text textTemplate;
 
        /* (non-Javadoc)
@@ -112,16 +112,16 @@ public class Filter extends PropertyPage
                textOID.setLayoutData(gd);
                textOID.setEnabled(checkMatchOID.getSelection());
                
-               checkMatchRemoteOS = new Button(dialogArea, SWT.CHECK);
-               checkMatchRemoteOS.setText(Messages.get().Filter_OSShouldMatch);
-               checkMatchRemoteOS.setSelection((objectTool.getFlags() & ObjectTool.REQUIRES_REMOTE_OS_MATCH) != 0);
-               checkMatchRemoteOS.addSelectionListener(new SelectionListener() {
+               checkMatchNodeOS = new Button(dialogArea, SWT.CHECK);
+               checkMatchNodeOS.setText(Messages.get().Filter_OSShouldMatch);
+               checkMatchNodeOS.setSelection((objectTool.getFlags() & ObjectTool.REQUIRES_NODE_OS_MATCH) != 0);
+               checkMatchNodeOS.addSelectionListener(new SelectionListener() {
                        @Override
                        public void widgetSelected(SelectionEvent e)
                        {
-                               textRemOS.setEnabled(checkMatchRemoteOS.getSelection());
-                               if (checkMatchRemoteOS.getSelection())
-                                       textRemOS.setFocus();
+                               textNodeOS.setEnabled(checkMatchNodeOS.getSelection());
+                               if (checkMatchNodeOS.getSelection())
+                                       textNodeOS.setFocus();
                        }
 
                        @Override
@@ -131,42 +131,45 @@ public class Filter extends PropertyPage
                        }
                });
                
-               textRemOS = new Text(dialogArea, SWT.BORDER);
-               textRemOS.setText(objectTool.getToolRemOS());
+               textNodeOS = new Text(dialogArea, SWT.BORDER);
+               textNodeOS.setText(objectTool.getToolNodeOS());
                gd = new GridData();
                gd.horizontalAlignment = SWT.FILL;
                gd.grabExcessHorizontalSpace = true;
                gd.horizontalIndent = 20;
-               textRemOS.setLayoutData(gd);
-               textRemOS.setEnabled(checkMatchRemoteOS.getSelection());
+               textNodeOS.setLayoutData(gd);
+               textNodeOS.setEnabled(checkMatchNodeOS.getSelection());
                
-               checkMatchLocalOS = new Button(dialogArea, SWT.CHECK);
-               checkMatchLocalOS.setText("Local system OS name should match this template(coma separated regular expression list)");
-               checkMatchLocalOS.setSelection((objectTool.getFlags() & ObjectTool.REQUIRES_LOCAL_OS_MATCH) != 0);
-               checkMatchLocalOS.addSelectionListener(new SelectionListener() {         
-         @Override
-         public void widgetSelected(SelectionEvent e)
-         {
-            textLocOS.setEnabled(checkMatchLocalOS.getSelection());
-            if (checkMatchLocalOS.getSelection())
-               textLocOS.setFocus();            
-         }
-         
-         @Override
-         public void widgetDefaultSelected(SelectionEvent e)
-         {
-            widgetSelected(e);            
-         }
-      });
-               
-               textLocOS = new Text(dialogArea, SWT.BORDER);
-               textLocOS.setText(objectTool.getToolLocOS());
-               gd = new GridData();
-               gd.horizontalAlignment = SWT.FILL;
-      gd.grabExcessHorizontalSpace = true;
-      gd.horizontalIndent = 20;
-      textLocOS.setLayoutData(gd);
-      textLocOS.setEnabled(checkMatchLocalOS.getSelection());
+               if (objectTool.getType() == ObjectTool.TYPE_LOCAL_COMMAND)
+               {
+               checkMatchWorkstationOS = new Button(dialogArea, SWT.CHECK);
+               checkMatchWorkstationOS.setText("Workstation OS name should match this template(coma separated regular expression list)");
+               checkMatchWorkstationOS.setSelection((objectTool.getFlags() & ObjectTool.REQUIRES_WORKSTATION_OS_MATCH) != 0);
+               checkMatchWorkstationOS.addSelectionListener(new SelectionListener() {         
+            @Override
+            public void widgetSelected(SelectionEvent e)
+            {
+               textWorkstationOS.setEnabled(checkMatchWorkstationOS.getSelection());
+               if (checkMatchWorkstationOS.getSelection())
+                  textWorkstationOS.setFocus();            
+            }
+            
+            @Override
+            public void widgetDefaultSelected(SelectionEvent e)
+            {
+               widgetSelected(e);            
+            }
+         });
+               
+               textWorkstationOS = new Text(dialogArea, SWT.BORDER);
+               textWorkstationOS.setText(objectTool.getToolWorkstationOS());
+               gd = new GridData();
+               gd.horizontalAlignment = SWT.FILL;
+         gd.grabExcessHorizontalSpace = true;
+         gd.horizontalIndent = 20;
+         textWorkstationOS.setLayoutData(gd);
+         textWorkstationOS.setEnabled(checkMatchWorkstationOS.getSelection());
+               }
                
                checkMatchTemplate = new Button(dialogArea, SWT.CHECK);
                checkMatchTemplate.setText(Messages.get().Filter_TemplateShouldMatch);
@@ -223,19 +226,20 @@ public class Filter extends PropertyPage
                
                objectTool.setSnmpOid(textOID.getText());               
 
-      if (checkMatchRemoteOS.getSelection())
-         objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_REMOTE_OS_MATCH);
+      if (checkMatchNodeOS.getSelection())
+         objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_NODE_OS_MATCH);
       else
-         objectTool.setFlags(objectTool.getFlags() & ~ObjectTool.REQUIRES_REMOTE_OS_MATCH);
+         objectTool.setFlags(objectTool.getFlags() & ~ObjectTool.REQUIRES_NODE_OS_MATCH);
       
-      objectTool.setToolRemOS(textRemOS.getText());
+      objectTool.setToolNodeOS(textNodeOS.getText());
       
-      if (checkMatchLocalOS.getSelection())
-         objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_LOCAL_OS_MATCH);
+      if ((checkMatchWorkstationOS != null) && checkMatchWorkstationOS.getSelection())
+         objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_WORKSTATION_OS_MATCH);
       else
-         objectTool.setFlags(objectTool.getFlags() & ~ObjectTool.REQUIRES_LOCAL_OS_MATCH);
+         objectTool.setFlags(objectTool.getFlags() & ~ObjectTool.REQUIRES_WORKSTATION_OS_MATCH);
       
-      objectTool.setToolLocOS(textLocOS.getText());
+      if (textWorkstationOS != null)
+         objectTool.setToolWorkstationOS(textWorkstationOS.getText());
 
       if (checkMatchTemplate.getSelection())
          objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_TEMPLATE_MATCH);
index a5ffe5e..5622fc1 100644 (file)
@@ -41,7 +41,7 @@ EditInputFieldDialog_Type=Type
 EditInputFieldDialog_ValidatePassword=Validate password after entry
 Filter_AgentNeeded=NetXMS agent should be available
 Filter_OIDShouldMatch=Node SNMP OID should match with the following template:
-Filter_OSShouldMatch=Remote system OS name should match this template(coma separated regular expression list):
+Filter_OSShouldMatch=Node OS name should match this template(coma separated regular expression list):
 Filter_SNMPNeeded=Node should support SNMP
 Filter_TemplateShouldMatch=Parent template name should match this template(coma separated regular expression list):
 General_AgentCommand=Agent's command
index b730eb0..0da6a66 100644 (file)
@@ -41,7 +41,7 @@ EditInputFieldDialog_Type=Type
 EditInputFieldDialog_ValidatePassword=Validate password after entry
 Filter_AgentNeeded=\u0410\u0433\u0435\u043d\u0442 NetXMS \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d
 Filter_OIDShouldMatch=\u0423\u0437\u0435\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c SNMP OID, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443:
-Filter_OSShouldMatch=\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0439 \u041e\u0421 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443(\u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438):
+Filter_OSShouldMatch=\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u041e\u0421 \u0443\u0437\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443(\u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438):
 Filter_SNMPNeeded=\u0423\u0437\u0435\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c SNMP
 Filter_TemplateShouldMatch=Parent template name should match this template(coma separated regular expression list):
 General_AgentCommand=\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u0430
index 7e597a8..39ce043 100644 (file)
@@ -42,10 +42,12 @@ public class Filter extends PropertyPage
        private Button checkAgent;
        private Button checkSNMP;
        private Button checkMatchOID;
-       private Button checkMatchOS;
+       private Button checkMatchNodeOS;
+       private Button checkMatchWorkstationOS;
        private Button checkMatchTemplate;
        private Text textOID;
-       private Text textOS;
+       private Text textNodeOS;
+       private Text textWorkstationOS;
        private Text textTemplate;
 
        /* (non-Javadoc)
@@ -110,16 +112,16 @@ public class Filter extends PropertyPage
                textOID.setLayoutData(gd);
                textOID.setEnabled(checkMatchOID.getSelection());
                
-               checkMatchOS = new Button(dialogArea, SWT.CHECK);
-               checkMatchOS.setText(Messages.get().Filter_OSShouldMatch);
-               checkMatchOS.setSelection((objectTool.getFlags() & ObjectTool.REQUIRES_OS_MATCH) != 0);
-               checkMatchOS.addSelectionListener(new SelectionListener() {
+               checkMatchNodeOS = new Button(dialogArea, SWT.CHECK);
+               checkMatchNodeOS.setText(Messages.get().Filter_OSShouldMatch);
+               checkMatchNodeOS.setSelection((objectTool.getFlags() & ObjectTool.REQUIRES_NODE_OS_MATCH) != 0);
+               checkMatchNodeOS.addSelectionListener(new SelectionListener() {
                        @Override
                        public void widgetSelected(SelectionEvent e)
                        {
-                               textOS.setEnabled(checkMatchOS.getSelection());
-                               if (checkMatchOS.getSelection())
-                                       textOS.setFocus();
+                               textNodeOS.setEnabled(checkMatchNodeOS.getSelection());
+                               if (checkMatchNodeOS.getSelection())
+                                       textNodeOS.setFocus();
                        }
 
                        @Override
@@ -129,14 +131,45 @@ public class Filter extends PropertyPage
                        }
                });
                
-               textOS = new Text(dialogArea, SWT.BORDER);
-               textOS.setText(objectTool.getToolOS());
+               textNodeOS = new Text(dialogArea, SWT.BORDER);
+               textNodeOS.setText(objectTool.getToolNodeOS());
                gd = new GridData();
                gd.horizontalAlignment = SWT.FILL;
                gd.grabExcessHorizontalSpace = true;
                gd.horizontalIndent = 20;
-               textOS.setLayoutData(gd);
-               textOS.setEnabled(checkMatchOS.getSelection());
+               textNodeOS.setLayoutData(gd);
+               textNodeOS.setEnabled(checkMatchNodeOS.getSelection());
+               
+               if (objectTool.getType() == ObjectTool.TYPE_LOCAL_COMMAND)
+               {
+               checkMatchWorkstationOS = new Button(dialogArea, SWT.CHECK);
+               checkMatchWorkstationOS.setText("Workstation OS name should match this template(coma separated regular expression list)");
+               checkMatchWorkstationOS.setSelection((objectTool.getFlags() & ObjectTool.REQUIRES_WORKSTATION_OS_MATCH) != 0);
+               checkMatchWorkstationOS.addSelectionListener(new SelectionListener() {         
+            @Override
+            public void widgetSelected(SelectionEvent e)
+            {
+               textWorkstationOS.setEnabled(checkMatchWorkstationOS.getSelection());
+               if (checkMatchWorkstationOS.getSelection())
+                  textWorkstationOS.setFocus();            
+            }
+            
+            @Override
+            public void widgetDefaultSelected(SelectionEvent e)
+            {
+               widgetSelected(e);            
+            }
+         });
+               
+               textWorkstationOS = new Text(dialogArea, SWT.BORDER);
+               textWorkstationOS.setText(objectTool.getToolWorkstationOS());
+               gd = new GridData();
+               gd.horizontalAlignment = SWT.FILL;
+         gd.grabExcessHorizontalSpace = true;
+         gd.horizontalIndent = 20;
+         textWorkstationOS.setLayoutData(gd);
+         textWorkstationOS.setEnabled(checkMatchWorkstationOS.getSelection());
+               }
                
                checkMatchTemplate = new Button(dialogArea, SWT.CHECK);
                checkMatchTemplate.setText(Messages.get().Filter_TemplateShouldMatch);
@@ -193,12 +226,20 @@ public class Filter extends PropertyPage
                
                objectTool.setSnmpOid(textOID.getText());               
 
-      if (checkMatchOS.getSelection())
-         objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_OS_MATCH);
+      if (checkMatchNodeOS.getSelection())
+         objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_NODE_OS_MATCH);
+      else
+         objectTool.setFlags(objectTool.getFlags() & ~ObjectTool.REQUIRES_NODE_OS_MATCH);
+      
+      objectTool.setToolNodeOS(textNodeOS.getText());
+      
+      if ((checkMatchWorkstationOS != null) && checkMatchWorkstationOS.getSelection())
+         objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_WORKSTATION_OS_MATCH);
       else
-         objectTool.setFlags(objectTool.getFlags() & ~ObjectTool.REQUIRES_OS_MATCH);
+         objectTool.setFlags(objectTool.getFlags() & ~ObjectTool.REQUIRES_WORKSTATION_OS_MATCH);
       
-      objectTool.setToolOS(textOS.getText());
+      if (textWorkstationOS != null)
+         objectTool.setToolWorkstationOS(textWorkstationOS.getText());
 
       if (checkMatchTemplate.getSelection())
          objectTool.setFlags(objectTool.getFlags() | ObjectTool.REQUIRES_TEMPLATE_MATCH);