9 Replies Latest reply on Jul 27, 2009 5:00 AM by jonchill

    Removing Interfaces from Switches

    jonchill

      Currently I'm monitoring all the interfaces on all our edge switches, so to bring down the number of elements monitored and release some of the load from the server I want to remove the interfaces from monitoring on all edge switches.

      Is it possible to do this with a SQL script of something similar, I've got a custom property for all our edge switches so distinguishing them from other switches isn't a problem?

      Any help would be much appreciated.

      Thanks

      Jon

        • Re: Removing Interfaces from Switches
          brian_duvall

          I would think if you have a custom property that states a switch is "edge" and you want to remove all interfaces associated with that switch, you could write a sql query to find all nodes with the custom property, then find where those nodeID's exist in the Interface table and perform a delete on all those rows that have the nodeID's of edge switches.  I believe db maintenance will remove all the orphaned data for interface IDs that no longer exist in database so that should clear all that out.  I would let a solarwinds support person confirm this behavior but that should do in quickly.

            • Re: Removing Interfaces from Switches
              jonchill

              Thanks Brian, I though it shouldn't be to difficult to achieve. I just need someone to give me an idea of the script to run as I'm not SQL programmer.

                • Re: Removing Interfaces from Switches

                  Here are a couple of queries that should do what you need.  The Where clause in each query will have to be modfied to match the name of your custom property field and the value to match in that field.  XXXXXX in each query should be replaced with the name of your custom property field and YYYYYY needs to be the value in the custom property you want to match (i.e. edge). 

                  The first query will just display a list of which interfaces will be deleted by the delete query.  The second query will actually delete the interface records from the interfaces table.

                  Always make a backup of your database before making changes directly to the tables with SQL commands. 

                  select nodes.caption as NodeName, interfaces.Caption as Interface from Nodes join interfaces on nodes.nodeid = interfaces.nodeid where nodes.XXXXXX = 'YYYYYY' order by nodes.caption

                  delete from interfaces where interfaces.nodeid in (select nodes.nodeid from nodes where nodes.XXXXXX = 'YYYYYY')