Quantcast
Channel: THWACK: Discussion List - All Communities
Viewing all articles
Browse latest Browse all 16365

Upgrade from NMP 11.0.1 to 11.5 breaks SDK 1.10 set CustomProperties

$
0
0
Hello all,

I want to thank those that released the SDK.  It's a great tool and we've used it extensively.
We have a powershell script, using v1.10.16.0 of the SDK, which we use to add nodes, setup pollers, and set the nodes Custom Properties.  After upgrading Orion Network Performance Monitor from 11.0.1 to 11.5 values for Custom Properties no longer get set.  It's as if the initial node creation seems to no longer create the ground work or index for custom properties to be added/edited.  When we run the script there's no errors generated.
After a node is added via the PS script, if you go in through the WebGUI, and edit the custom properties of the node, save it and go back, the values for those custom properties have reverted back to the origional values.  We are not seeing any issues if a node is manually added via the GUI.  I have a feeling some of the tables have been split and it's almost like the '
Has anyone else run into this issue?
# Basic add node, add n-pollers, set some custom props (p.s. what circle of hell did I enter trying to copy and paste into this form's editor?)
#PSSnapin presence check/add
if (!(Get-PSSnapin-Name"SwisSnapin"-ErrorActionSilentlyContinue))
    { Add-PSSnapinSwisSnapin-ErrorActionSilentlyContinue }
# Default values
[string]$AlertingTier="SysOps Linux - P1 Very Urgent"
[string]$Access_KCNDataCenter="No"
[String]$KCNHardwareType="None"
[string]$ResponsibleGroup="Server Operations (Linux)"
[string]$Community="public"
[string]$SiteAddressState="MO"
ip2guid($ipString) {
  $ip=[System.Net.IPAddress]::Parse($ipString)
  $src=$ip.GetAddressBytes();
  $data=new-objectbyte[]16
  $src.CopyTo($data,$data.Length -$src.Length)
  $dest=new-objectbyte[]16
  [Array]::Copy($data,12,$dest,0,4)
  [Array]::Copy($data,10,$dest,4,2)
  [Array]::Copy($data,8,$dest,6,2)
  [Array]::Copy($data,6,$dest,8,2)
  [Array]::Copy($data,0,$dest,10,6)

  return (New-ObjectGuid (,$dest)).ToString()
}
AddPoller($PollerType) {
  $poller["PollerType"]=$PollerType;
  $pollerUri=New-SwisObject$swis-EntityType"Orion.Pollers"-Properties$poller
}

# Connect to SolarWinds
$SWhost ="cgslpwiswnpm01.centric.com"
$username="user"
$password =Read-Host-Prompt"Enter password"-AsSecureString
$cred =New-Object-typenameSystem.Management.Automation.PSCredential-argumentlist$username,$password
$swis = Connect-Swis-host$SWhost-cred$cred
# For simplicity just putting in a host and IP
# In the script we have steps to verify fqdn and ip
$hostname = 'somehost'
$ip = '10.0.0.1'
$ipGuid=ip2guid($ip)
# add a node
$newNodeProps= @{
  EntityType="Orion.Nodes";
  IPAddress=$ip;
  IPAddressGUID=$ipGuid;
  Caption=$hostname;
  DynamicIP=$False;
  Engine=1;
  Status=1;
  UnManaged=$False;
  Allow64BitCounters=$False;
  SysObjectID="";
  MachineType="";
  VendorIcon="";
  ObjectSubType="SNMP";
  SNMPVersion=2;
  Community=$Community;
}
$newNodeUri=New-SwisObject$swis-EntityType"Orion.Nodes"-Properties$newNodeProps
$nodeProps=Get-SwisObject$swis-Uri$newNodeUri

# register specific pollers for the node
$poller= @{
  NetObject="N:"+$nodeProps["NodeID"];
  NetObjectType="N";
  NetObjectID=$nodeProps["NodeID"];
}
### Create N-type Pollers
AddPoller("N.Status.SNMP.Native");
AddPoller("N.ResponseTime.ICMP.Native");
AddPoller("N.Details.SNMP.Generic");
AddPoller("N.Uptime.SNMP.Generic");
AddPoller("N.Cpu.SNMP.NetSnmpSystemStats");
AddPoller("N.Cpu.SNMP.NetSnmpCpuIdle");
AddPoller("N.Memory.SNMP.NetSnmpReal");
AddPoller("N.IPAddress.ICMP.Generic");

## Prepare a custom property value
$customProps= @{
  AlertingTier=$AlertingTier;
  ResponsibleGroup=$ResponsibleGroup;
  KCNHardwareType=$KCNHardwareType;
  SiteAddressState=$SiteAddressState;
  Comments="Host added by script";

## Build the Custom Properties node URI
$SWNodeURICP="$newNodeUri/CustomProperties"
## Set Custom Properties
Set-SwisObject$swis-Uri$SWNodeURICP-Properties$customProps




Viewing all articles
Browse latest Browse all 16365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>