2 Replies Latest reply on Jan 20, 2012 3:41 PM by dpob

    query "PercentLoss" using soapUI

    dpob

      Here's the scenario; my team runs a program (on linux) that sometimes floods the network. Instead of waiting for someone to come tell us "Hey, you've crippled the network again.", we would like to have the program shutdown automatically if "Packet Loss" on more than 2 of our switches reach 85%.

      Here's how I think it could work; a script, (python/perl/bash) using SOAP can poll the "Packet Loss" stat from Orion NPM. If the stat reaches a point where people normally start complaining, it executes the shutdown script.

       

      I originally wrote a script in python that logged into the linux box over ssh, then ran the shutdown script, all from my test Orion NPM box. I then created an alert condition which executed the script when the packet loss threshold was met. It worked great in my tests, however the guys who run our Production Orion NPM won't allow us to install python or anything else on it. So now we must use SWIS. 

      I'm using soapUI to figure out the messages we need to send and what we'll be getting back, and so far all I can do through SOAP is read: swis://solarwinds/Orion/Orion.Nodes/NodeID=n/Stats 

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inf="http://schemas.solarwinds.com/2007/08/informationservice">

         <soapenv:Header/>

         <soapenv:Body>

            <inf:Read>

               <inf:uri>swis://solarwinds/Orion/Orion.Nodes/NodeID=1/Stats</inf:uri>

            </inf:Read>

         </soapenv:Body>

      </soapenv:Envelope>

       

      Using SWIS Studio, I use this query to see how many nodes are "down" though packet loss:

      select count(NodeID) AS NodesCount from Orion.NodesStats where PercentLoss = '100'

       

       

      Now for my real question:

      How do I send my query "select count(NodeID) AS NodesCount from Orion.NodesStats where PercentLoss = '100'" though SOAP?

      I know I should use the Query message type:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inf="http://schemas.solarwinds.com/2007/08/informationservice" xmlns:quer="http://schemas.solarwinds.com/2007/08/informationservice/queryoptions">

         <soapenv:Header/>

         <soapenv:Body>

            <inf:Query>

               <!--Optional:-->

               <inf:query>?</inf:query>

               <!--Optional:-->

               <inf:queryOptions>

                  <quer:outputFormat>?</quer:outputFormat>

               </inf:queryOptions>

            </inf:Query>

         </soapenv:Body>

      </soapenv:Envelope>

       

      But I'm not sure how to format it inside the SOAP request.

      Are there any other tools we could use from a linux machine, kind of like the PoweShell Snapin?

       

      Thanks!

       

      -dan-