Greetings,
I have been working on implementing a new way to add nodes to monitoring within our environment utilizing powershell and the solarwinds API. I have come across an issue where response time does not incorporate with the node that i add via script, but the traditional manner of adding icmp nodes, it does work. i am curious if anyone has any insight as to what i may be missing to make this work?
Here is my function to add a node.
function add-node{
# add a node
$newNodeProps = @{
EntityType="Orion.Nodes";
DNS = $Fqdn;
SysName = $ServerName;
PolledStatus = 1;
IPAddress=$ip;
IsServer = $False;
External = $false;
Caption=$NodeCaption;
DynamicIP=$False;
EngineID=1;
Status=1;
UnManaged=$False;
Allow64BitCounters=$True;
SysObjectID="";
MachineType="";
VendorIcon="";
ObjectSubType="ICMP";
#SNMPVersion=2;
Community="";
# polling timing (optional)
RediscoveryInterval=30; # minutes (5..525600=1 year)
PollInterval=120; # seconds (1..1200)
StatCollection=10; # minutes (1..600)
}
$newNodeCustProps= @{
Address1 = $NodeAddress1;
Address2 = $NodeAddress2;
AddressCity = $NodeCity;
AddressCounty = $NodeCounty;
AddressFacility = $location;
Department = $nodeAgency;
EM_Environment = $NodeEnvironment;
EM_ServerMonitoringPriority = $NodeMonitoringPriority;
EMCoreApp = $NodeEMCoreApp;
EMNodeDown = $NodeEMCoreApp;
Node_Type = $NodeType;
Outage_Notification_To = $OutageNotificationTo;
ServerServices_SLA = $ServerServices_SLA;
Service_Level = $Service_Level;
}
$newNodeUri = New-SwisObject $swis –EntityType "Orion.Nodes" –Properties $newNodeProps
$nodeProps = Get-SwisObject $swis -Uri $newNodeUri
$newNodeUriN = $newNodeUri + "/CustomProperties"
#$newNodeFQDNURI =$newNodeUri + "Fqdn"
$mute = Set-SwisObject $swis -Uri $newNodeUriN -Properties $newNodeCustProps -Verbose
#$mute = Set-SwisObject $swis -Uri $newNodeFQDNURI -Properties $newNodeFQDN -Verbose
# register specific pollers for the node
$poller = @{
NetObject="N:"+$nodeProps["NodeID"];
NetObjectType="N";
NetObjectID=$nodeProps["NodeID"];
}
$nodeSettings = @{
NodeID = $nodeID
SettingName = "Core.WebBrowseTemplate"
SettingValue = "http://{{ HrefIPAddress }}"
} # Add NodeID, WebBrowseTemplate, and SSH Port
$mute = New-SwisObject $swis "Orion.NodeSettings" $nodeSettings # Set the new settings from above
$nodeSettings["SettingName"] = "NodeSettings.SSH.Port" # Set the node SettingName property
$nodeSettings["SettingValue"] = "22" # Set the node SettingValue property
$mute = New-SwisObject $swis "Orion.NodeSettings" $nodeSettings
$poller = @{
NetObject = "N:" + $nodeID
NetObjectType = "N"
NetObjectID = $nodeID
}
$poller["PollerType"]="N.Status.ICMP.Native"; # Set the type property
$mute = New-SwisObject $swis "Orion.Pollers" $poller # Send the poller data to Orion
# Response time
$poller["PollerType"]="N.ResponseTime.ICMP.Native"; # Add this property to the poller
$mute = New-SwisObject $swis "Orion.Pollers" $poller # Send the poller data to Orion
# Details
$poller["PollerType"]="N.Details.SNMP.Generic";
$pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
# Uptime
$poller["PollerType"]="N.Uptime.SNMP.Generic";
$pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller
}