8 Replies Latest reply on Oct 21, 2015 9:04 AM by dstone

    Volumes not being polled

    dstone

      I am trying to use PowerShell to automate adding nodes.  I can't not get the volumes to be monitored.  I can add them to the database and they show up under the node's summary page, but the volumes have no data.  Searching I did find and read https://thwack.solarwinds.com/thread/79088?q=Not%20mo, even though I made suer that VolumeType is set to "Fixed Disk" the VolumeTypeID is still showing up as 0.

       

      Here is the part of the code that gets the drive information from WMI, and then adds them to the database:

       

      $drives = Get-WmiObject -Credential ($creds) -ComputerName $Hostname -Class win32_Volume -Filter DriveType=3

       

          foreach ($drive in $drives){

         

              #Getting information from the driver and using it to build requirments in SolarWinds

              $DriveCaption = "$($drive.Caption) Label:$($drive.Label)  $([Convert]::ToString($drive.SerialNumber, 16))";

              $DriveDescrption = "$($drive.Caption) Label:$($drive.Label)  Serial Number $([Convert]::ToString($drive.SerialNumber, 16))";

                     

              #Adding everything to a hash

              $AddDrive = @{

              <#

                  NodeID=$NodeID; # NodeID on which the interface is working on

                  VolumeIndex= "4";

                  VolumeTypeID = "4";

                  Status=1;

                  #Type ="Fixed Disk";

                  VolumeType = "Fixed Disk";

                  Icon ="FixedDisk.gif";

                  Caption=$DriveCaption;

                  VolumeDescription=$DriveDescrption;

                  FullName = "$hostname-$DriveCaption"

                  PollInterval=120;

                  StatCollection=15;

                  RediscoveryInterval=30;

                  NextRediscovery=[DateTime]::UtcNow;

              #>

                  NodeID=$NodeID;

                  VolumeType="Fixed Disk";

                  VolumeTypeID="4";

                  Icon="FixedDisk.gif";

                  VolumeIndex="4";

                  Caption=$DriveCaption;

                  VolumeDescription=$DriveDescrption;

                  #status=1

                  FullName = "$hostname-$DriveCaption"

                  PollInterval="120";

                  StatCollection="15";

                  RediscoveryInterval="30";

                  #NextRediscovery=[DateTime]::UtcNow;

                 

              }

             

              #Inserting drives to be monitored into the database       

              $driveURI = New-swisobject $swis -EntityType "Orion.volumes" -properties $AddDrive

       

      Here is the code that is adding the pollers and the pollers that I am adding:

       

          function AddPoller($PollerType){

             

             Write-Verbose "Adding $pollertype to database"

       

       

              #Getting the first part of the WMI string before the period (.), which Solarwinds needs for it's database.

              $NetobjectPrefix = $Pollertype.split("{.}")

             

              #setting params for the database fields

              $poller["PollerType"]=$PollerType;

              $poller["NetObject"]=  $NetObjectprefix[0] +":"+$nodeid;

              $poller["NetobjectType"] = $NetobjectPrefix[0];

              $poller["NetObjectID"] = $nodeid;

             

              #Adding to the database

              $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

          }

       

          Addpoller("I.StatisticesErrors32.SNMP.IfTable")

          Addpoller("I.StatisticsTraffic.SNMP.Universal");

          Addpoller("I.Status.SNMP.IfTable");

          Addpoller("I.Rediscovery.SNMP.IfTable");

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

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

          Addpoller("N.Details.WMI.Vista");

          Addpoller("N.CPU.WMI.Windows");

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

          Addpoller("N.CPU.WMI.Windows");

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

          Addpoller("N.AssetInventory.Wmi.Generic");

          Addpoller("V.Details.SNMP.Generic");

          Addpoller("V.Statistics.SNMP.Generic");

          Addpoller("V.Status.SNMP.Generic");

       

      If I add the node via the web portal, everything is monitored.  I pulled the pollers from this test. If I added them to the database myself, it doesn't seem to work properly.

        • Re: Volumes not being polled
          tdanner

          This part is not right:

           

          #Getting the first part of the WMI string before the period (.), which Solarwinds needs for it's database.
          $NetobjectPrefix = $Pollertype.split("{.}")
          
          #setting params for the database fields
          $poller["PollerType"]=$PollerType;
          $poller["NetObject"]=  $NetObjectprefix[0] +":"+$nodeid;
          $poller["NetobjectType"] = $NetobjectPrefix[0];
          $poller["NetObjectID"] = $nodeid;
          

           

          You are using the $nodeid value for the node pollers (correct) but also the interface and volume pollers (incorrect). For the interface pollers, you need to use the InterfaceID value; for the volume pollers you need to use the VolumeID value.

           

          You can get the VolumeID value after the "$driveURI = New-swisobject $swis -EntityType "Orion.volumes" -properties $AddDrive" line. I would do it like this:

           

          $volume = Get-SwisObject $swis $driveURI
          $volumeId = $volume["VolumeID"]
          

           

          And similarly for the InterfaceID.

            • Re: Volumes not being polled
              dstone

              I don't think I understand what you are saying.  I updated the code to add the volume with the following:

               

               

                $AddDrive = @{
                              NodeID=$NodeID;
                              VolumeType="Fixed Disk";
                              VolumeTypeID="4";
                              Icon="FixedDisk.gif";
                              VolumeIndex="4";
                              Caption=$DriveCaption;
                              VolumeDescription=$DriveDescrption;
                              
                              FullName = "$hostname-$DriveCaption"
                              PollInterval="120";
                              StatCollection="15";
                              RediscoveryInterval="30";
                              
                          
                          }
                      
                          #Inserting drives to be monitored into the database        
                          $driveURI = New-swisobject $swis -EntityType "Orion.volumes" -properties $AddDrive
                          
                          $volume = Get-SwisObject $swis -uri $driveURI  
                          
                          if ($volume){
                          $volumeId = $volume["VolumeID"]  
              
              
                          write-host $volume['volumeID']
                          #Write-Verbose $volumeId
                          $poller = $null;
                          $poller = @{};
              
              
                          #setting params for the database fields
                          
                          #$poller["PollerType"]="V.Details.WMI.Windows";
                          $poller["PollerType"]="V.Details.SNMP.Generic";
                          $poller["NetObject"]=  "V:$volumeID"
                          $poller["NetobjectType"] = "V";
                          $poller["NetObjectID"] = $nodeid;
                      
                          #Adding to the database
                          $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
                          }
              
              
              
              
              
              

               

              This still didn't poll the volumes.  When I manually add the node, everything in the poller database looks like my original code. 

               

              I am updating the Orion.Pollers, Orion.Node, and Orion.Volume.  Is there any other database that I need to add it to?

                • Re: Volumes not being polled
                  tdanner

                  This line is wrong:


                  $poller["NetObjectID"] = $nodeid; 


                  It should be this:


                  $poller["NetObjectID"] = $volumeID; 

                    • Re: Volumes not being polled
                      dstone

                      I made that change, and waited over 30 mins.  The volumes still aren't polled. 

                       

                      polls.png

                        • Re: Volumes not being polled
                          tdanner

                          I just noticed something in your script that I wish I had noticed last week. In this list of pollers, you have a mix of SNMP and WMI pollers. These have to match the node type (the ObjectSubType property of the node) and the appropriate credential has to be assigned (SNMP creds for SNMP nodes, Windows creds for WMI nodes). (The ICMP pollers work for anything, since they only need an IP address.)

                           

                          Having a mix of SNMP and WMI pollers is not going to work. Most likely the ones of the wrong type would be ignored. Are you using SNMP or WMI for monitoring these nodes?

                            • Re: Volumes not being polled
                              dstone

                              Since this script is for Window machines, we are going to be using WMI.  The list of pollers are the same that are used when you use the Orion's Add Node feature via the website.  I know that the Orion SDK documentation states that for volumes and WMI the V.Details.WMI.Windows poller should be used. I have also tried using the V.Details.SNMP.Generic volume poller also.  I don't think either of them work.

                                • Re: Volumes not being polled
                                  madhavan

                                  Hi,

                                   

                                  I modified your script, by changing the NetObjectID when creating poller and added necessary pollers. This script works fine. Please use this and let us know.

                                   

                                  $AddDrive = @{  
                                                  NodeID=$nodeid;  
                                                  VolumeType="RAM";  
                                                  VolumeTypeID="2";  
                                                  Icon="RAM.gif";  
                                                  VolumeIndex="1";  
                                                  Caption="Physical Memory";  
                                                  VolumeDescription="Physical Memory";                    
                                  
                                  
                                                  PollInterval="120";  
                                                  StatCollection="15";  
                                                  RediscoveryInterval="30";
                                              }  
                                  
                                  
                                  #Inserting drives to be monitored into the database          
                                  $driveURI = New-swisobject $swis -EntityType "Orion.volumes" -properties $AddDrive
                                  
                                  
                                  $volume = Get-SwisObject $swis -uri $driveURI
                                  
                                  
                                  if ($volume){  
                                      $volumeId = $volume["VolumeID"]    
                                      
                                      write-host $volume['volumeID']  
                                  
                                  
                                      #Write-Verbose $volumeId  
                                      $poller = $null;  
                                      $poller = @{};  
                                    
                                    
                                      #setting params for the database fields  
                                                
                                      #$poller["PollerType"]="V.Details.WMI.Windows";  
                                      $poller["PollerType"]="V.Details.WMI.Windows";  
                                      $poller["NetObject"]=  "V:"+$volumeID;
                                      $poller["NetobjectType"] = "V";  
                                      $poller["NetObjectID"] = $volumeID;  
                                            
                                      #Adding to the database  
                                      $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller  
                                  
                                  
                                      $poller["PollerType"]="V.Statistics.WMI.Windows";
                                      $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller  
                                  
                                  
                                      $poller["PollerType"]="V.Status.WMI.Windows";
                                      $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller  
                                  }
                                  
                                  1 of 1 people found this helpful
                                    • Re: Volumes not being polled
                                      dstone

                                      Thanks MadHavan.  That seemed to work.  Guess not adding the V.Statistics.WMI.Windows and V.Status.WMI.Windows to the drives is what was causing it.

                                       

                                      I guess I spoke a little to soon, it seems like it doesn't get all the drive information.  For the host that I am working with it doesn't pull the second hard drive.  It does pull the first hard drive, and it seems to pull the information for the third, fourth, fifth, and sixth hard drives (which are on a SAN).  Those drives come back with at least some data.   The second hard drive comes back with 0GB capacity and 0 GB Space used.  While the actual drive is 39.8 GB and 30 GB used.