I've recently being using SWQL to query the Solarwinds DB in order to fetch data. Now I'm trying to create a UnDP through SWQL, using Python, but I keep receiving this error:
Pointing to NodeCustomPoller Table:
swis.create('Orion.NPM.NodeCustomPollers', **props)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 34, in create
"Create/" + entity, properties).json()
File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 59, in _req
resp.raise_for_status()
File "/usr/lib/python2.7/site-packages/requests/models.py", line 834, in raise_for_status
raise HTTPError(http_error_msg, response=self)
HTTPError: 403 Client Error: Operation not supported on Orion.NPM.NodeCustomPollers
Pointing to CustomPoller Table:
swis.create('Orion.NPM.CustomPollers', **props)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 34, in create
"Create/" + entity, properties).json()
File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 59, in _req
resp.raise_for_status()
File "/usr/lib/python2.7/site-packages/requests/models.py", line 834, in raise_for_status
raise HTTPError(http_error_msg, response=self)
HTTPError: 400 Client Error: Cannot create instances of abstract entity Orion.NPM.CustomPollers.
Parameter name: entityType
I've created the props parameter using the columns I've seen in both tables through SWQL Studio, for example in CustomPollers:
props = {
'DisplayName': None,
'TimeUnitQuantity': 0,
'NetObjectPrefix': 'N',
'InstanceSiteId': 0,
'Description': 'RPM',
'PollerType': 'C',
'PollInterval': 5,
'InstanceType': 'Orion.NPM.NodeCustomPollers',
'TimeUnitID': 0,
'MIB': 'jnxRpmResultsSummaryTable',
'IncludeHistoricStatistics': True,
'Enabled': True,
'DefaultDisplayTimeUnitID': 0,
'CustomPollerParserID': 6,
'SNMPGetType': 'Get',
'GroupName': '_NOC',
'OID': '1.3.6.1.4.1.2636.3.50.1.2.1.4.16.79.78.45.82.80.77.45.83.85.66.77.65.82.73.78.69.16.78.65.80.49.45.83.65.66.45.65.69.49.51.95.67.82.2',
'UniqueName': 'ON-RPM',
}
I've also tried using fewer fields, even one by one, but keep receiving an error. Is it possible to create UnDP through SWQL?