6 Replies Latest reply on Aug 31, 2016 7:36 AM by sketterer

    PowerShell Node Creation - Missing Volumes

    sketterer

      Greetings Thwack community,

       

      We have a script in place that currently runs a query on our kiosk database for new systems, and then creates nodes for them in SolarWinds.  We have 2 different types of kiosks in the db, with the main difference being the local storage on it.  Kiosk type 1 only has a C drive.  Kiosk type 2 has a C drive and an M drive.  Looking at our nodes, we are seeing C drive utilization on all of our nodes, but we do not see any of the M drive data.  I don't know if it makes much of a difference but the Kiosk type 2 could either be Windows Embedded 2009 or a Server 2008 system.  I've included what I believe to be the pertinent part of the script for our node creation.

       

      $newNodeProps = @{
          EntityType="Orion.Nodes";
          IPAddress=$ip;
          IPAddressGUID=$ipGuid;
          Caption="";
          DynamicIP=$False;
          EngineID=3;
          Status=1;
          UnManaged=$False;
          Allow64BitCounters=$False;
          SysObjectID="";
          MachineType="";
          VendorIcon="";
          ObjectSubType="WMI";
          SNMPVersion=0;
          Community="";
          Location = "";
          Contact = "";
          NodeDescription="";
          Vendor="";
          IOSImage="";
          IOSVersion="";
      }

       

       

                  #Creating the node

                  $newNodeUri = New-SwisObject $swis –EntityType "Orion.Nodes" –Properties $newNodeProps

                  #Write-Host "newNodeURI is: "$newNodeUri

                  $nodeProps = Get-SwisObject $swis -Uri $newNodeUri

       

       

                  $poller = @{

                      NetObject="N:"+$nodeProps["NodeID"];

                      NetObjectType="N";

                      NetObjectID=$nodeProps["NodeID"]}

       

       

                  #Status

                  AddPoller("N.Status.ICMP.Native");

                  #ResponseTime

                  AddPoller("N.ResponseTime.ICMP.Native");

                  #Details

                  AddPoller("N.Details.WMI.XP");

                  #Uptime

                  AddPoller("N.Uptime.WMI.XP");

                  #CPU

                  AddPoller("N.Cpu.WMI.Windows");

                  #Memory

                  AddPoller("N.Memory.WMI.Windows");

                  #IP Address

                  AddPoller("N.IPAddress.WMI.Generic");

                  #Volumes

                  AddPoller("V.Details.WMI.Windows");

                  #Statistics

                  AddPoller("V.Statistics.WMI.Windows");

                  #Memory Utilization

                  AddPoller("N.Memory.WMI.Windows");

       

      Thank you for any input

        • Re: PowerShell Node Creation - Missing Volumes
          tdanner

          Is the M: drive a local disk or a network share?

           

          It looks like your script is adding the V.* pollers to the node. Those have to be added to the Volume.

            • Re: PowerShell Node Creation - Missing Volumes
              sketterer

              It is a local disk (local windows span).  If I click on list disks, I can manually add it.

               

              Would it be tweaking this line:

               

                          #Volumes

                          AddPoller("V.Details.WMI.Windows");

               

              or am I missing something.

                • Re: PowerShell Node Creation - Missing Volumes
                  tdanner

                  See this answer in an older thread: Re: Volumes not being polled

                  1 of 1 people found this helpful
                    • Re: PowerShell Node Creation - Missing Volumes
                      sketterer

                      after reviewing, I'm still not making heads or tails of this.  We do have a secondary script that goes in, applies monitors, and it appears to be checking for the volumes as well.  Here is the run down of the script, maybe i'm still missing something.  To save some space, abbreviating sections

                       

                      Make connect to our source record database

                      make connection to SolarWinds DB

                      Query source record for device information (all are custom properties)

                      For each device in source record, update corresponding SolarWinds node, if different

                      Check and add monitors to Nodes

                      Add volumes to Node section (There is a reference to:  https://thwack.solarwinds.com/message/242648#242648 as the source of this part of the script)

                       

                      foreach ($vol in $volumes)
                                          {
                                          #This checks for the existence of the C: and M: Drives assigned to the solarwinds node
                                          $SWNodeVolCheck = Get-SwisData -SwisConnection $swis -Query "SELECT NodeID, Caption FROM Orion.Volumes WHERE Caption = '$($vol)' AND NodeID = '$($SWNodeID)'"
                                      
                                          If ($SWNodeVolCheck -eq $null)
                                              {
                                              #Volume was not found, create new volume for current node
                                              #$VolAction = "Add $Vol"
                                             
                                              #$nodeProps = @{NodeID=2951}

                                              $newVolumeProps = @{
                                                  NodeID=$SWNodeID;
                                                  VolumeType="Fixed Disk";
                                                  VolumeSize="0";
                                                  Icon="FixedDisk.gif";
                                                  Index="3";
                                                  Caption=$vol;
                                                  VolumeDescription=$vol;
                                                  PollInterval="120";
                                                  StatCollection="10";
                                                  RediscoveryInterval="20";
                                                  StatusIcon="Up.gif";
                                                  FullName=$vol;
                                                  Responding="";
                                                  VolumePercentUsed="";
                                                  VolumeAllocationFailuresThisHour="";
                                                  VolumeSpaceUsed="";
                                                  VolumeAllocationFailuresToday="";
                                                  #VolumeSpaceAvailable="";
                                                  DiskQueueLength="";
                                                  DiskTransfer="";
                                                  DiskReads="";
                                                  DiskWrites="";
                                                  TotalDiskIOPS="";
                                                  }

                                              $newVolumeURI = New-SwisObject $swis –EntityType "Orion.Volumes" –Properties $newVolumeProps


                                              $VolProps = Get-SwisObject $swis -Uri $newVolumeURI


                                              foreach ($pollerType in @('V.Status.WMI.Windows','V.Details.WMI.Windows','V.Statistics.WMI.Windows'))
                                                  {
                                                  $poller = @{
                                                      PollerType=$pollerType;
                                                      NetObject="V:"+$VolProps["VolumeID"];
                                                      NetObjectType="V";
                                                      NetObjectID=$VolProps["VolumeID"];
                                                      }
                         
                                                  #$pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
                                                  AddPoller $pollerType;
                                                  }
                                            
                                              }
                                          }

                • Re: PowerShell Node Creation - Missing Volumes
                  sketterer

                  thank you for the information.  I will definitely review it and update our import accordingly.