This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Adding a specific volume to monitoring

Hello everyone!

I am trying to add a specific file system to monitoring with SWIS API. So far I've been using the discovery method successfully, but there are situations where I need to add additional volumes after the node has been already discovered and added to SolarWinds.

I have tried to achieve this with "swis.create", but I'm not sure if it is supposed to work this way, since I would have to generate VolumeID & Volume Index and to set IDENTITY INSERT to ON for the table. I couldn't find any specific "verb" defined for Orion.Volumes for such an action. Does anyone know if this is the way to do it, or is there another way that I'm missing?

Example below:

    def create_volumes(self,volume,voldesc,volidx,voltype,volid,nodeid):

        """ provided a list of volumes and the nodeid from Orion.Nodes it adds them to monitoring """

        props = {

                'VolumeIndex': volidx,

                'VolumeDescription': voldesc,

                'VolumeID': volid,

                'NodeID': nodeid,

                'VolumeTypeID': voltype,

                'Caption': volume

        }

        results = self.swis.create('Orion.Volumes', **props)

        try:

            return results

        except IndexError:

            return False

Returns:

Traceback (most recent call last):

  File "./add_missing_hosts_new.py", line 366, in <module>

    result = c.create_volumes(volume,voldesc,volidx,voltype,volid,nodeid)

  File "/home/apop-sa/automations/monitoring/swtools/swtools/client.py", line 158, in create_volumes

    results = self.swis.create('Orion.Volumes', **props)

  File "/usr/local/lib/python2.7/dist-packages/orionsdk/swisclient.py", line 34, in create

    "Create/" + entity, properties).json()

  File "/usr/local/lib/python2.7/dist-packages/orionsdk/swisclient.py", line 59, in _req

    resp.raise_for_status()

  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 935, in raise_for_status

    raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 400 Client Error: Cannot insert explicit value for identity column in table 'Volumes' when IDENTITY_INSERT is set to OFF. for url:

Thank you!!!

  • Remove "VolumeID" from your payload.

    Also note that to take this approach to adding volumes you will need to ensure you are populating creating the appropriate Orion.Pollers instances. I recommend you select an equivalent volume that was added via Discovery or List Resources and look to see what Orion.Pollers has for that volume, then do the same for the ones you add from Python. The exact set of pollers needed will vary according to what kind of node it is (Windows vs. Linux vs. other).

  • Thanks a lot for your help. I am a step closer now. If I remove the "VolumeID" I can add the volume, but as you mentioned it doesn't work, it is added with a question mark and no stats are reported for it. So, it's most probably an issue with pollers. However I'm not really sure how to select/ update pollers per volume. I can select pollers per nodeid, but the information in the table remains unchanged when adding a new file system manually (more below) Also I've tried listing pollers per volume Uri and couldn't find anything. Sorry If these questions may sound silly, but I'm new to the Solarwinds API.

    What I have tried.

    self.swis.query("SELECT PollerID, PollerType, NetObject, NetObjectType, Enabled, DisplayName, Description, InstanceType, InstanceSiteId, Uri FROM Orion.Pollers WHERE NetObjectID = \'{}\'".format(nodeid))

    [{u'DisplayName': None, u'NetObjectType': u'I', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=60256', u'PollerType': u'I.StatisticsErrors32.SNMP.IfTable', u'InstanceSiteId': 0, u'NetObject': u'I:9915', u'PollerID': 60256, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'I', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=60257', u'PollerType': u'I.StatisticsTraffic.SNMP.Universal', u'InstanceSiteId': 0, u'NetObject': u'I:9915', u'PollerID': 60257, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'I', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=60258', u'PollerType': u'I.Status.SNMP.IfTable', u'InstanceSiteId': 0, u'NetObject': u'I:9915', u'PollerID': 60258, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'I', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=60259', u'PollerType': u'I.Rediscovery.SNMP.IfTable', u'InstanceSiteId': 0, u'NetObject': u'I:9915', u'PollerID': 60259, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': False, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569636', u'PollerType': u'N.Status.SNMP.Native', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569636, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': False, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569638', u'PollerType': u'N.ResponseTime.SNMP.Native', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569638, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': False, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569704', u'PollerType': u'N.Routing.SNMP.Ipv4CidrRoutingTable', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569704, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569635', u'PollerType': u'N.Status.ICMP.Native', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569635, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569637', u'PollerType': u'N.ResponseTime.ICMP.Native', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569637, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569639', u'PollerType': u'N.Details.SNMP.Generic', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569639, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569640', u'PollerType': u'N.Uptime.SNMP.Generic', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569640, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569641', u'PollerType': u'N.Cpu.SNMP.HrProcessorLoad', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569641, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569642', u'PollerType': u'N.Memory.SNMP.NetSnmpReal', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569642, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569643', u'PollerType': u'N.Topology_Layer3.SNMP.ipNetToMedia', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569643, u'InstanceType': u'Orion.Pollers', u'Description': None}, {u'DisplayName': None, u'NetObjectType': u'N', u'Enabled': True, u'Uri': u'swis://HIKAWSORS01..com/Orion/Orion.Pollers/PollerID=569709', u'PollerType': u'N.AssetInventory.Snmp.Generic', u'InstanceSiteId': 0, u'NetObject': u'N:9915', u'PollerID': 569709, u'InstanceType': u'Orion.Pollers', u'Description': None}]}

    Can you please suggest a swis.query to find out the pollers per volume?

    Thanks !!!

  • Quick update. It did work eventually as I managed to recreate the volume pollers manually. While the stats (like space used, etc) appear to be reported correctly in the GUI, the volumes have a question mark in front of them, so there may be something else beside pollers that need to be manually recreated. If anyone has any clue, please let me know!

    Thank you for your help!!

    temp.png