Forum Discussion

David_Bond's avatar
David_Bond
Icon for Professor rankProfessor
7 months ago

Enhanced Script NetScans continually overwrites Resource Groups?

We have an Enhanced Script Netscan set up for a customer, set to run once an hour.  It works as expected, adding the discovered Resources to the assigned Resource Group.

We then manually add it to other Resource Groups and the next time the Netscan runs, it has removed that and simply placed it back into the discovery Resource Group.

Our code IS setting the Group Name array, so I believe that's what's doing it.

sql.eachRow(query) { row ->
    def host = [
        hostname   : row.IpAddress,
      displayname: row.LogicMonitorDisplayName,
        hostProps  : [
        "propertyX"      : row.ValueX,
        "propertyY"      : row.ValueY,
        "system.categories" : "NoPing",
        ],
      groupName  : ["Devices by Type/Custom Device Type"],
        collectorId: lmCreds.collectorId
    ]
    hosts << host
}

However, the Netscan is set to exclude any existing Resources:

Seems like a bug to me?

Customer is unhappy and wants a fix!  Any advice?

5 Replies

  • One thought is that "Enhanced Netscans" are more "Resource Management" scripts and are overwriting Group Membership by design.  This would actually be a very cool feature, but needs an extra Dropdown option on the "Exclude ip addresses" dialog e.g. "Overwrite existing Resource".

  • Were you able to get this resolved ?

    I have the same exact issue. This is causing devices that have been added to static groups for alerting purposes get removed. 

  • Good afternoon! David_Bond​ 

    Making an analogy;

    Enhanced Script does a "Put method execution" instead a "Patch method execution".

    I suggest for utilizing this discovery method for those new resources to be onboarded or for those resources to be updated by utilizing a Source of Truth (e.g. CSV file) and keep up-to-date this last one.

    Another option could be by handling the groupName's value as array but always including both the old groups and the new ones for.

    Regards.

  • I ended up opening a ticket about this issue. This is the response received: 
    "

    When running Netscan, the device group will be overridden to the one specified in the script along with the current NetScan Policy (i.e. NetScan configuration, the script it is using).

     

    If you want to prevent the existing device from being updated and instead add a new device with the same IP, you can edit the Netscan and use the "Exclude duplicate IP address" option. In the dropdown, select "matching resources currently assigned to these collectors" and specify the collector please add the same collector that is performing the scan.

     

    Note: Make sure that the other device (the existing one with the same IP) is not monitored by the same collector that will be performing the scan."

    Our solution: Create a dynamic group. Our netscans are balanced around different collectors and the workaround suggested would not work, by design, apparently.