NetXMS Support Forum

English Support => General Support => Topic started by: atena on July 29, 2020, 06:46:34 AM

Title: DCIs Description changing
Post by: atena on July 29, 2020, 06:46:34 AM
Hello
I add 200 DCIs in a node and now I want to change something in their Descriptions, is there any way to change them by script or something else instead of changing them manually and one by one??
thanks
Title: Re: DCIs Description changing
Post by: Alex Kirhenshtein on July 29, 2020, 01:55:27 PM
You can use nxshell for that:

from org.netxms.client.datacollection import DataCollectionConfiguration, DataCollectionObject
from org.netxms.client.objects import Node, Template

o = s.findObjectByName("Alexs-MBP")
config = session.openDataCollectionConfiguration(o.objectId)
for dc in config.items:
    dc.description = dc.description + " - TEST"
    config.modifyObject(dc)
config.close()
Title: Re: DCIs Description changing
Post by: atena on July 29, 2020, 04:11:09 PM
Thanks a lot for your response but I got an error after line config.modifyobject(dc) which said org.netxms.client.datacollectioncon object has no attribute 'modifyobject'
can you please help me to solve this?
thanks again for you reply and help

best regard
Atena
Title: Re: DCIs Description changing
Post by: Victor Kirhenshtein on July 29, 2020, 05:12:36 PM
Hi,

pay attention to case - it is modifyObject, not modifyobject.

Best regards,
Victor