Kaseya Community

How can I create a view for multiple machine groups?

This question is not answered

In a nutshell, I want to be able to look at our clients that pay for KAM. 

I know how to filter for machines that have KAM installed.

I need a view that shows me all of the KAM client machines and whether or not they have KAM installed.

I assume the only way to do this unique setting would be in System where you edit the organizations, but I cannot find something that I can filter with, for when I go back to look at the agents.

I even tried changing the country, but it has not changed that column in the Agent view.

I know I can make a view with the group ID's and that's what I have now. but it's gross when you go to edit it. Is there no custom field that is both in Organization settings and is filter-able? 

All Replies
  • The first two thoughts I have are:

    1. Create a scope with appropriate organizations/groups in it

    -OR-

    2. Create a view with "Anti-Malware" checked in the "Add-On Modules" section

    We can also make more granular views based on Applications installed or Group ID filters in the Advanced section.

  • While I can use #2 for view client machines that HAVE KAM installed, it does not show me all machines that SHOULD HAVE KAM installed. I didn't think about creating a scope. That would actually work.

    I just don't see why this isn't easier. I would like to be able to create a view the same way I can create a scope. That would be super helpful. I'm just trying to be productive, rather than schedule installs and look at my numbers as a whole, rather than 20 machine groups- one at a time.

  • Use the View's Advanced agent data filter and add all the groups that should be getting KAM to the "Group ID"

    example: *Microsoft* AND *Kaseya* AND *Apple* AND etc... you can use excel to create the whole string if you have a ton of groups.

    Or conversely... if less groups are NOT getting KAM then you could filter for those... with NOT *Microsoft* etc...



    related advanced agent filter to Views
    [edited by: ghanssen at 8:40 AM (GMT -7) on Aug 20, 2013]
  • Hi,

    Here is a method you can use to achieve this (Disclaimer: For the most part!!!).  You create a new Org Custom Field (called for instance "AntiMalware-Service") using System->Site Customization...Org Custom Field Title tab...select a blank reserved custom field line and click Edit...name it AntiMalware-Service, and then Save.  Set the custom Field to say Y (no blank lines, carriage returns/linefeeds) on those Orgs where you offer that service.  Then put the following XML in a file under your \kaseya\xml\Procedures\AgentProcSQL\1\SQLRead folder:

    <?xml version="1.0" encoding="utf-8" ?>

    <queryList>

       <queryDef label="Get Org Custom Field of Agent" sql="SELECT RTRIM(LTRIM(REPLACE(REPLACE(ocf.fieldValue, '<<p>>', ''), '<</p>>', ''))) AS orgCustomFieldValue FROM kasadmin.orgCustomFields ocf INNER JOIN kasadmin.orgCustomFieldsDef ocfd ON ocfd.id=ocf.orgCustomFieldDefFK INNER JOIN kasadmin.org o ON o.id=ocf.orgFK INNER JOIN dbo.machGroup mg ON mg.orgFK=o.id INNER JOIN dbo.machNameTab mnt on mnt.machGroupGuid=mg.machGroupGuid WHERE mnt.agentGuid=#agentGuid# AND ocfd.ref='#orgCustFieldName#'" />

    </queryList>

    Then create a new Custom Field (string) under the Audit module and call it again "AntiMalware-Service".

    You can then create an Agent Procedure, and use a sqlRead("Get Org Custom Field of Agent", ...) step to gram the value stored at the Org level and populate the agent custom system info field using an updateSystemInfo("AntiMalware-Service", ...) step...Like in this agent procedure which you can import after putting the above XML file in place :) 

    <?xml version="1.0" encoding="utf-8"?><ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">  <Procedure name="Get and Set AntiMalware-Service Field of Agent" treePres="3" id="636249724" folderId="391597892526354" treeFullPath="myProcedures - kaseyasupport">    <Body description="">      <Statement name="GetVariable" continueOnFail="true">        <Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue" />        <Parameter xsi:type="StringParameter" name="SourceContent" value="N" />        <Parameter xsi:type="StringParameter" name="VariableName" value="global:override" />      </Statement>      <Statement name="GetVariable" continueOnFail="false">        <Parameter xsi:type="EnumParameter" name="VariableType" value="SQLView" />        <Parameter xsi:type="StringParameter" name="SourceContent" value="vMachine/agentGuid" />        <Parameter xsi:type="StringParameter" name="VariableName" value="agentGuid" />      </Statement>      <Statement name="GetVariable" continueOnFail="true">        <Parameter xsi:type="EnumParameter" name="VariableType" value="SQLView" />        <Parameter xsi:type="StringParameter" name="SourceContent" value="vSystemInfoManual/AntiMalware-Service" />        <Parameter xsi:type="StringParameter" name="VariableName" value="global:override" />      </Statement>      <If description="">        <Condition name="CheckVariable">          <Parameter xsi:type="StringParameter" name="VariableName" value="#global:override#" />          <Parameter xsi:type="EnumParameter" name="Condition" value="NotExists" />          <Parameter xsi:type="StringParameter" name="Value" value="" />        </Condition>        <Then>          <Statement name="GetVariable" continueOnFail="true">            <Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue" />            <Parameter xsi:type="StringParameter" name="SourceContent" value="N" />            <Parameter xsi:type="StringParameter" name="VariableName" value="global:override" />          </Statement>        </Then>      </If>      <If description="">        <Condition name="CheckVariable">          <Parameter xsi:type="StringParameter" name="VariableName" value="#global:override#" />          <Parameter xsi:type="EnumParameter" name="Condition" value="GreaterThan" />          <Parameter xsi:type="StringParameter" name="Value" value="" />        </Condition>        <Then>          <Statement name="GetVariable" continueOnFail="false">            <Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue" />            <Parameter xsi:type="StringParameter" name="SourceContent" value="N" />            <Parameter xsi:type="StringParameter" name="VariableName" value="global:override" />          </Statement>        </Then>      </If>      <If description="">        <Condition name="CheckVariable">          <Parameter xsi:type="StringParameter" name="VariableName" value="#global:override#" />          <Parameter xsi:type="EnumParameter" name="Condition" value="NotEquals" />          <Parameter xsi:type="StringParameter" name="Value" value="Y" />        </Condition>        <Then>          <Statement name="GetVariable" continueOnFail="false">            <Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue" />            <Parameter xsi:type="StringParameter" name="SourceContent" value="AntiMalware-Service" />            <Parameter xsi:type="StringParameter" name="VariableName" value="orgCustFieldName" />          </Statement>          <Statement name="GetVariable" continueOnFail="false">            <Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue" />            <Parameter xsi:type="StringParameter" name="SourceContent" value="+++SQLCMD:SELECT RTRIM(LTRIM(REPLACE(REPLACE(ocf.fieldValue, '&lt;&lt;p&gt;&gt;', ''), '&lt;&lt;/p&gt;&gt;', ''))) AS orgCustomFieldValue FROM kasadmin.orgCustomFields ocf INNER JOIN kasadmin.orgCustomFieldsDef ocfd ON ocfd.id=ocf.orgCustomFieldDefFK INNER JOIN kasadmin.org o ON o.id=ocf.orgFK INNER JOIN dbo.machGroup mg ON mg.orgFK=o.id INNER JOIN dbo.machNameTab mnt on mnt.machGroupGuid=mg.machGroupGuid WHERE mnt.agentGuid=#agentGuid# AND ocfd.ref='#orgCustFieldName#'" />            <Parameter xsi:type="StringParameter" name="VariableName" value="orgCustFieldValue" />          </Statement>          <Statement name="UpdateSystemInfo" continueOnFail="false">            <Parameter xsi:type="StringParameter" name="ColumnName" value="AntiMalware-Service" />            <Parameter xsi:type="StringParameter" name="Value" value="#orgCustFieldValue#" />          </Statement>        </Then>      </If>    </Body>  </Procedure></ScriptExport>

    You then schedule this agent procedure to run on all machines on some recurring interval and it will set the audit custom field to be the same as that value set in the Org custom field.  Then you can create your Views, but will need to use a combination of the Advanced Agent Data filter where AntiMalware-Service equals Y and the Applications filter where MBAM.EXE is Missing, since you cannot do a Add-Ons NOT installed filter.  This will be dependent on Latest Audits running to pick up MBAM.EXE in the list of Installed Applications, and the AntiMalware-Service custom field being populated, so there will be some margin or error for machines that are offline, or may not have run a Latest Audit since KAM was installed, and so forth, but for the most part it should work...

    I hope this helps,

    Matt Warburton

    Kaseya Professional Services

  • I am trying to do something similar, where I have account managers in charge of multiple 'groups' in Kaseya.  I wanted a view where I could see all their clients in one view.  This is what I am currently testing, so far so good.

    Create an agent procedures for each group you want to make.  It doesn't have to do anything at all, kaseya just needs to log that it ran.

    Create a policy that will occasionally run the procedure.

    Apply the policy on each client you want to group.

    Create a new view using the Agent Procedure section.

    Check: Agent Procedure NEW GROUP has executed in the last 999 days.

    It'd be really nice though if Kaseya added a section to simply check a box for multiple groups to be part of a view!

  • The best thing I've found to do with this is make a SCOPE for only certain client sites. Then, make a view for only Windows machines or whatever you need to weed out others from that scope. That's how I roll for this one.