Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all 3719 articles
Browse latest View live

Getting the error of "Set-SwisObject : Access to IPAM.IPNode denied." using PowerShell

$
0
0

When doing the set-swisobject I get an access denied error. The account "admin" is marked as an admin in the Orion website.

 

Is there another location to set permissions that enable read/write on the nodes?


Another question about AlertStatus records

$
0
0

When I query for alerts, and I get an ObjectType of "Routing Neighbors", or for that matter, anything that is NOT "Interface" or "Node" (actually, I haven't seen an object type of Node, so not sure what it would/should be), how do I know which table to query if I want to get information about the device that fired/raised the alert?

 

In other words, how do I know which table to query in order to get more information about the 'ActiveObject' that's raised the alert?

 

Have seen these ObjectTypes as well as "Interface":
<ObjectType>Hardware Sensor</ObjectType>
<ObjectType>Routing Neighbors</ObjectType>
<ObjectType>Multicast routing</ObjectType>
<ObjectType>IPAM Networks</ObjectType>

 

 

Thanks,

Scott

How to create array of arguments for Unmanage/Remanage? (C#)

$
0
0

I am trying to write a method for Unmanaging and Remanaging nodes in Orion, in C#. Using the CSClient example, I've been able to write a query Orion for a NodeID based on sysname. However, when I want to Invoke("Orion.Nodes", "Unmanage", args) I don't know how to correctly create the ArrayOfXMLElement that the method seems to want. I tried modifying the code used for the alert example, but it gives me "FaultException`1" when I try it. I created the data object to store the arguments based on the column names in the Nodes table. I am using VS2010, .net 4.0, Orion 2012.2.0, and SDK 1.6. I am very new at this so please be gentle :-) The portion of the code that gets the NodeID based on sysname works fine.

 

This is what my code looks like:

 

using System;

using System.Net;

using System.Runtime.Serialization;

using System.Xml;

using System.Linq;

using System.Xml.Linq;

using System.Xml.XPath;

using CSClient.SWIS;

 

namespace CSClient

{

    class Program

    {

        static void Main()

        {

            const string hostname = "myorionserver";

            const string username = @"myuser";

            const string password = "mypassword";

           

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

 

            var client = new InformationServiceClient("BasicHttpBinding_InformationService", string.Format("https://{0}:17778/SolarWinds/InformationService/v3/OrionBasic", hostname));

            client.ClientCredentials.UserName.UserName = username;

            client.ClientCredentials.UserName.Password = password;

            client.Open();

            var nodeIDInfo = client.QueryXml("SELECT TOP 1 NodeID from Orion.Nodes WHERE sysname like 'targetserver' RETURN XML AUTO", null);

            nodeIDInfo.Save(@"c:\temp\orionoutput.xml");

            var nodeID = nodeIDInfo.XPathSelectElement("//*[local-name()='NodeID']").Value;

            Console.WriteLine("Node ID is " + nodeID.ToString());

 

            string unmanageFrom = DateTime.Now.ToString();

            string unmanageUntil = DateTime.Now.AddHours(6).ToString();

 

            var unmanageInfo = new UnmanageInfo

            {

                NodeID = nodeID,

                UnManageFrom = unmanageFrom,

                UnManageUntil = unmanageUntil

            };

            var unmanaged = new[] { unmanageInfo };

 

            var dcs = new DataContractSerializer(unmanaged.GetType());

            var doc = new XmlDocument();

            using (var writer = doc.CreateNavigator().AppendChild())

            {

                dcs.WriteObject(writer, unmanaged);

            }

 

            var arguments = new ArrayOfXmlElement { XDocument.Load(new XmlNodeReader(doc)).Root };

            var result2 = client.Invoke("Orion.Nodes", "Unmanage", arguments);

            Console.Write(result2);

            Console.Read();

        }

 

        [DataContract(Name = "UnmanageInfo", Namespace = "http://schemas.solarwinds.com/2008/Orion")]

        public class UnmanageInfo

        {

            [DataMember(Order = 1)]

            public string NodeID;

 

            [DataMember(Order = 2)]

            public string UnManageFrom;

 

            [DataMember(Order = 3)]

            public string UnManageUntil;

 

        }

 

    }

}

How does "" work in Discovery Profiles?

$
0
0

I'd like to use the DiscoverNodes table as a way to import nodes which are discovered but I only want to populate that table with nodes which aren't being managed already. Is that what <AllowDuplicateNodes>false</AllowDuplicateNodes> is for? If I set that to true, does the discovery remove items which are already nodes? I can't seem to find that documented or a way in the web that indicates this is even an option? Does setting this to true get me where I want to be?

Orion.AlertStatus field questions

$
0
0

What is the difference between Orion.AlertStatus.State and Orion.AlertStatus.WorkingState ?

 

What is Orion.AlertStatus.TriggerTimeOffset ?  (Offset from what/when?)

 

 

Thanks,

Scott

Updating Orion.WorldMap.Point via the Perl SDK

$
0
0

I've been playing with the new world maps with doing the creating, updating and deletion of points via the Perl Orion SDK. I've had success with creating points with the following:

my $data = $self->{_swis}->Create("Orion.WorldMap.Point", {Instance => 'Orion.Nodes', InstanceID => $node_id, Latitude => $lat, Longitude => $long} );

 

 

 

 

 

However not having much success with with updates or deletions as both of the following:

my $data = $self->{_swis}->Update($self->{_swis_url} . "/Orion.WorldMap.Point/PointId=$point_id", {Latitude => $lat, Longitude => $long} );

 

 

my $data = $self->{_swis}->Delete("swis://localhost/Orion/Orion.WorldMap.Point/Instance=Orion.Nodes,PointId=$point_id");

 

produce the following error:

Invalid key properties specified for entity Orion.WorldMap.Point.&#xD;

Anyone got any pointers? I've got quite a large amount of location data to import and then allow updates to be carried out from our CMDB. And I also notice it's create multiple pointers for the same node.

 

Cheers,

 

Jon

Question about updating alerts (in the AlertStatus table)

$
0
0

Is it possible to update an alert Note (or for that matter, any custom alert fields) after the alert has been acknowledged? And if so, would I use the same three fields [to id the 'row'] one uses to acknowledge an alert, I mean, since there is no 'recordId' and all?

 

 

Thanks,

Scott

Need Help Converting SQL Report Writer Code to SWQL - Down Time Duration

$
0
0

Here is Report Writer SQL code that produces the duration of down time for a node.  I need to be able to convert this to SWQL and populate the 'hours down' time into a custom property field.  I want to use the 'hours down' time custom property field in conjunction with changing Google map Icon colors once time frame meets specified thresholds.   I'm not very savvy with SQL or coding so all suggestions are welcome.  Thanks everyone.  

 

SELECT     DATEDIFF(hh, T1.DownTime, CURRENT_TIMESTAMP) AS HoursDown, Nodes.Caption, Nodes.IP_Address,

T1.DownTime, Nodes.NodeID

FROM         (SELECT     MAX(EventTime) AS DownTime, NetObjectID, NetworkNode

                       FROM          Events

                       WHERE      (EventType = 1) AND (NetObjectType = 'N')

                       GROUP BY NetObjectID, NetworkNode) AS T1 INNER JOIN

                      Nodes ON T1.NetworkNode = Nodes.NodeID

WHERE     (Nodes.Status = '2') AND (Nodes.Owner = 'RHD')

ORDER BY HoursDown DESC, Nodes.Caption, T1.DownTime DESC, Nodes.NodeID

 

Output from this Query:

HoursDownNodeIP AddressDownTimeNode ID
139rtr.316864.ph.us.tgr.net10.165.4.111/2/2012 14:1818188
131rt2.023675.ph.us.tgr.net10.180.119.211/2/2012 22:1316384
120rt2.013146.ph.us.tgr.net10.81.4.211/3/2012 9:5615487
63rt2.013426.ph.us.tgr.net10.250.112.211/5/2012 18:1315560
42rtr.023040.ph.us.tgr.net10.80.164.111/6/2012 15:4816194
41rt2.012626.ph.us.tgr.net10.81.76.211/6/2012 16:5515348
39rt2.013236.ph.us.tgr.net10.7.34.211/6/2012 18:2215534
39rtr.023016.ph.us.tgr.net10.80.141.111/6/2012 18:0116174
36rt2.008384.ph.us.tgr.net10.74.64.211/6/2012 21:1314776
24rt2.026530.ph.us.tgr.net10.76.43.211/7/2012 9:4617140
17rt2.013122.ph.us.tgr.net10.81.94.211/7/2012 16:1115475
17rt2.013139.ph.us.tgr.net10.81.103.211/7/2012 16:1815484
16rtr.012934.ph.us.tgr.net10.82.80.111/7/2012 17:4815429
15rt2.006231.ph.us.tgr.net10.13.12.211/7/2012 18:2814567

How does "" work in Discovery Profiles?

$
0
0

I'd like to use the DiscoverNodes table as a way to import nodes which are discovered but I only want to populate that table with nodes which aren't being managed already. Is that what <AllowDuplicateNodes>false</AllowDuplicateNodes> is for? If I set that to true, does the discovery remove items which are already nodes? I can't seem to find that documented or a way in the web that indicates this is even an option? Does setting this to true get me where I want to be?

Problem consuming wsdl

$
0
0

I'm attempting to consume the wsdl in perl.  I've generated the 'InformationService' package and succesfully managed to deal with the lack of an ssl-certificate and connect to the service.

 

All I'm attempting to do at the moment is replicate the getOneAlert function from the sample Java client.  As far as I can tell, I am successfully sending the soap request to our server, but I am getting an http 500 response with the following faultcode:

 

The message with Action '#QueryXml' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

 

Any suggestions as to what might be the cause this?  I'm at a loss at the moment.

Another question about AlertStatus records

$
0
0

When I query for alerts, and I get an ObjectType of "Routing Neighbors", or for that matter, anything that is NOT "Interface" or "Node" (actually, I haven't seen an object type of Node, so not sure what it would/should be), how do I know which table to query if I want to get information about the device that fired/raised the alert?

 

In other words, how do I know which table to query in order to get more information about the 'ActiveObject' that's raised the alert?

 

Have seen these ObjectTypes as well as "Interface":
<ObjectType>Hardware Sensor</ObjectType>
<ObjectType>Routing Neighbors</ObjectType>
<ObjectType>Multicast routing</ObjectType>
<ObjectType>IPAM Networks</ObjectType>

 

 

Thanks,

Scott

Automated creation of NPM server nodes including specific node resources

$
0
0

I have a PS script that utilizes both the SDK and the Internet Explorer PS Object.  The script does the following:

Script Input Arguments:  Script Action (Currently just adds, but in the future it would delete, modify custom props, etc...), Node Name, Node's IP Address, Orion Poller name, server profile csv file (contains the custom properties to populate).  Powershell syntax:

Script Requirements: 

  • Discovery profile to be used by the script only.  The profile should include the SNMP strings required to add an SNMP node. Currently this is hard coded in the script.
  • csv File that contains custom property names as headers and the property values.  The custom property fields need to already exist.  You can modify the script fairly easily to read in your custom props.
  • (optional) a logfile name/path hard coded in the script that outputs script process and actions.
  • Internet Explorer browser (tested on v8 and v9)
  • I have not tested this on an NPM SSL website.

Script Syntax: <script name> add <node (server) name> <node IP Address> <Orion Poller Name> <server Profile Name>

Script Process Overview:

  • Prompts for SW credentials - Can be modified to use specific credentials without prompting.
  • Reads in arguments
  • Connects to Orion instance on the poller name specified.
  • Reads the custom properties from the csv file into a hash table
  • Starts discovery process
    • Modifies the discovery profile (currently coded in the script) and changes the discovery scope to only scan the IP address of the node (using the node's IP address argument)
    • logs into website using previously supplied credentials
    • Starts running the discovery scan using the modified discovery profile.
    • Adds the discovered node including it's resources found during the discovery.
    • Verifies the node has been added.
  • Updates the node's custom properties with the values from the csv file.
  • Removes specific node resources.  (I used this to remove the many virtual adapters found on Windows 2008 servers), but can be modified to remove other node resources as well.

 I don't want to post the script yet because I would like it to be more scripter friendly, but contact me if you are interested.

Chris

How does "" work in Discovery Profiles?

$
0
0

I'd like to use the DiscoverNodes table as a way to import nodes which are discovered but I only want to populate that table with nodes which aren't being managed already. Is that what <AllowDuplicateNodes>false</AllowDuplicateNodes> is for? If I set that to true, does the discovery remove items which are already nodes? I can't seem to find that documented or a way in the web that indicates this is even an option? Does setting this to true get me where I want to be?

Trouble getting the Java Client example to work

$
0
0

Hello

I am trying to get the JavaClient example from the SDK to work. Here is the error I keep getting:

 

 

 

 

 

 

Exception in thread "main"

 

 

javax.xml.ws.WebServiceException: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException

: Connection reset

at com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.close(Unknown Source)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(Unknown Source)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)

at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)

at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)

at javax.xml.ws.Service.<init>(Unknown Source)

at org.tempuri.InformationService_Service.<init>(

 

 

InformationService_Service.java:46

)

at SwisClient.getSwisClient(

 

 

SwisClient.java:90

)

at SwisClient.main(

 

 

SwisClient.java:42

)

Caused by:

 

 

javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException

: Connection reset

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)

at com.sun.net.ssl.internal.ssl.AppInputStream.available(Unknown Source)

at java.io.BufferedInputStream.available(Unknown Source)

at sun.net.www.MeteredStream.available(Unknown Source)

at sun.net.www.http.KeepAliveStream.close(Unknown Source)

at java.io.FilterInputStream.close(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)

... 11 more

Caused by:

 

 

javax.net.ssl.SSLException: java.net.SocketException

: Connection reset

at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)

at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)

at java.io.BufferedInputStream.fill(Unknown Source)

at java.io.BufferedInputStream.read1(Unknown Source)

at java.io.BufferedInputStream.read(Unknown Source)

at sun.net.www.MeteredStream.read(Unknown Source)

at java.io.FilterInputStream.read(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanQName(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source)

at com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter.next(Unknown Source)

at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.next(Unknown Source)

at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.nextContent(Unknown Source)

at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.nextElementContent(Unknown Source)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseBindingOperation(Unknown Source)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(Unknown Source)

... 10 more

Caused by:

 

 

java.net.SocketException

: Connection reset

Any help would be greatly appreciated

Updating Orion.WorldMap.Point via the Perl SDK

$
0
0

I've been playing with the new world maps with doing the creating, updating and deletion of points via the Perl Orion SDK. I've had success with creating points with the following:

my $data = $self->{_swis}->Create("Orion.WorldMap.Point", {Instance => 'Orion.Nodes', InstanceID => $node_id, Latitude => $lat, Longitude => $long} );

 

 

 

 

 

However not having much success with with updates or deletions as both of the following:

my $data = $self->{_swis}->Update($self->{_swis_url} . "/Orion.WorldMap.Point/PointId=$point_id", {Latitude => $lat, Longitude => $long} );

 

 

my $data = $self->{_swis}->Delete("swis://localhost/Orion/Orion.WorldMap.Point/Instance=Orion.Nodes,PointId=$point_id");

 

produce the following error:

Invalid key properties specified for entity Orion.WorldMap.Point.&#xD;

Anyone got any pointers? I've got quite a large amount of location data to import and then allow updates to be carried out from our CMDB. And I also notice it's create multiple pointers for the same node.

 

Cheers,

 

Jon


How to query the SWIS JSON interface using curl?

$
0
0

I thought I'd try curl before implementing it in the client, but all queries end in

curl: (7) Failed connect to 192.168.0.101:17778; Connection timed out

 

I've read the "SWIS REST/JSON API" thread, but can't figure out, why it doesn't work.

 

This is what I tried on a laptop in the server network:

curl --user myuser:mypass https://192.168.0.101:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT+NodeID+FROM+Orion.Nodes

 

I can connect in and run the query from SWQL Studio (same user, pass) just fine. Does the user have to have a special permission or is there a special setting to enable the query-interface, maybe?

 

Update:

If I try to connect to https://192.168.0.101:17778/SolarWinds/InformationService in a Browser, I get "The connection has timed out, The server at 192.168.0.101 is taking too long to respond.", but both SWIS and SWIS V3 Services are running.

SolarWinds to Service-Now Integration

$
0
0

SolarWinds & Service-Now

=====================

We’re trying to do the following (option 1 is our preferred while option 2 is a fallback):

1)

A) SolarWinds generates alert

B) SolarWinds uses a “webservice/api/sdk/other tool” to “communicate with/connect to” with the appropriate information so ServiceNow can open a ticket with the appropriate categorization, priority, whether it is internally or externally managed (ticket assignment changes depending), etc.

C) ServiceNow will communicate to the “response team” that there is a new ticket that must be addressed

D) ServiceNow will “communicate with/connect to” SolarWinds to acknowledge the alert and to record the ServiceNow ticket in to the acknowledgement notes

E) SolarWinds will register alert and set alert to acknowledged status and will include the ServiceNow ticket number

*END*

 

2)

A) SolarWinds generates alert

B) SolarWinds sends email notification to ServiceNow – email will need to be in appropriate form to be “absorbed”

C) ServiceNow “absorbs” email and generates a ticket with the appropriate categorization, priority, whether it is internally or externally managed (ticket assignment changes depending), etc.

D) ServiceNow “responds” to email with acknowledgement and ticket number

E) SolarWinds registers the response and sets the alert to acknowledged status and will include the ServiceNow ticket number

*END*

 

At this time, we’re looking for foundational materials to help us get started and determine the easiest/best way to perform one of these options and we’re hoping SolarWinds support can give us some pointers on where to researching documentation and what documentation may exist. Our hope is this is a relatively straight forward activity since it seems like it would be fairly standard that companies would want their monitoring and ticketing systems to interact. We have been rather ineffectually researching SolarWinds documentation and Thwack for roughly a week and have been unable to find the “start here” materials. We understand that the referenced SDK is not supported and we will have to use Thwack as support, however, at this point, we don’t have enough information to understand whether the SDK is our best/only option. We see in the release notes that there is the VBClient, etc. however it is unclear if this is the proscribed technique or just *A* technique.

 

Thanks in advance for your feedback and guidance!

Looking for verification of table choices for use in gathering performance metrics

$
0
0

The other day my boss asked me to look into getting performance data from/via the Orion SDK. Namely "Device CPU and Memory" and "Interface bandwidth in and out (ingress/egress)"

 

So, I wanted to verify that I've got the proper tables for said info. It looks like I want /Orion.CPULoad/ and /Orion.NPM.InterfaceTraffic/ respectively, correct?

 

Also, I'm a bit confused by the schema page (*\SolarWinds\Orion SDK\Schema\3.0\Orion.CPULoad.html) where it shows the last field, 'Node' and says "Defined by relationship Orion.NodesHostsCPULoad (System.Hosting)." My confusion springs from my inability to find either System.Hosting or Orion.NodesHostsCPULoad. Am I missing some other documentation, or... ?


Thanks,
Scott

Application name macro

$
0
0

I'm hoping someone out there has some answers.   The last couple weeks I've been in some development of a custom HTTP handler to capitalize of the use of these macros Solar winds provides, like ${NodeName} to extend the usefulness of User Link widgets.  For example i pass in http://solarwinds/QueryServer.handler?ServerName=${NodeName}&QueryType=Documentation and the handler will then perform a client direct to the location of the documentation specific for that server.  This is all working great.  I've even extended tools links for things like the VMConsole and RDP.

 

Now to the problem.. I moved on to applications.  I could have sworn i tested the existance of a macro variable that expands into a Application Name, when viewing a note with a bound Application item.  Here's the URL:  /Orion/APM/ApplicationDetails.aspx?netobject=

 

The things I've tried:

 

${Application}  - This only gets application information about Solarwinds itself.

${APM.ApplicationItem.Name} - Tried the table name because documentation said i should

${ApplicationItem.Name} - Seemed logical.

Plus 20-30 others, but wanted to list the obvious.

 

If someone knows of the magic bullet here, it'd be appreciated.

 

Tried to work around the problem in other ways too.  Since i knew i could markup these links with html code.  I attempted to inject a <script>document.write(document.url)</script> in the link, because the NetObjectID in the displayed url is enough, combined with the working macros to figure out where to redirect a user and more importantly to determine the application name.  But this was presented with an error (BTW, good job solarwinds) basically of the parsing engine protecting itself.  Here's the summary of the error: 

 

URL: https://solarwinds.<redacted>.com:443/Orion/APM/NetPerfMon/Resources/Misc/<script>document.write(document.url)</script>

Referrer: https://solarwinds.<redacted>.com:443/Orion/APM/NetPerfMon/Resources/Misc/<script>document.write(document.url)</script>

Message: A potentially dangerous Request.Path value was detected from the client (<).

ErrorSite: System.Web.HttpRequest.ValidateInputIfRequiredByConfig

ErrorType: System.Web.HttpException

Stack:

at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()

at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)

Assemblies:

 

Next question:   This line in the error messages alludes to an override of sorts to allow me to do what i want  ValidateInputIfRequiredByConfig - But i didn't want to willy-nilly start tripping around finding where to insert the change. 

 

Other food for throught:  There seems to be a single Regex line in a .cs file (CommonWebHelper.cs), which i believe is the http processor for solarwinds.. that control what tags may be used.

Here's the line:  static string _tagsToEncodeReg = "<(?!br|/br|p|/p|span|/span|div|/div|table|/table|tr|/tr|td|/td|a|/a|b|/b|i(?!nput)|/i(?!nput))(?:[^\">]|\"[^\"]*\")*>"

 

Again, i didn't want to dink with those pieces of code that were mine.  The objective was to extend what's allowed in Solarwinds.  But if some dev has a magic answer here.. i'd be helpful.

 

Rambled a bit, but i've spent some time looking for this answer and it's a lynch pin for me to help this organization bring home the "Single Pane of Glass" mentality by intelligently locating their scattered data, but organized data based on a display context in solarwinds (Server's or Applications)

SDK/PowerShell - Group Creation Script Issue

$
0
0


Trying to use the following script (based on the 'Groups' example in the SDK) to add groups based on Nodes.Location and a CustomProperty !=

 

if (! (Get-PSSnapin | where {$_.Name -eq "SwisSnapin"})) {    Add-PSSnapin "SwisSnapin"
}
# Connect to SWIS
$hostname = "localhost"
$username = "username here"
$password = "password here" | ConvertTo-SecureString -asPlainText -Force
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password 
$swis = Connect-Swis -host $hostname -cred $cred
#Set the locatoin of the csv
Set-Location 'C:\Users\username here\Desktop'
# read in csv file
$importFile="./MakeGroups.csv"
$importList=IMPORT-CSV $importFile
#iterate through each entry in csv file
FOREACH($import in $importList)
{    $SiteCode = $import.Location    $members = @(  @{ Name = "$SiteCode"; Definition = "filter:/Orion.Nodes[Location='$SiteCode' AND CustomProperties.Device_Type != 'Router']" }
)
$groupId = (Invoke-SwisVerb $swis "Orion.Container" "CreateContainer" @(    # group name    "$SiteCode",    # owner, must be 'Core'    "Core",    # refresh frequency    60,    # Status rollup mode:    # 0 = Mixed status shows warning    # 1 = Show worst status    # 2 = Show best status    0,    # group description    "Group created by the PowerShell sample script.",    # polling enabled/disabled = true/false (in lowercase)    "true",    # group members    ([xml]@(       "<ArrayOfMemberDefinitionInfo xmlns='http://schemas.solarwinds.com/2008/Orion'>",       [string]($members |% {         "<MemberDefinitionInfo><Name>$($_.Name)</Name><Definition>$($_.Definition)</Definition></MemberDefinitionInfo>"         }       ),       "</ArrayOfMemberDefinitionInfo>"    )).DocumentElement  )).InnerText     
}

 

 

Keep getting this error:

 

Invoke-SwisVerb : Entity Orion.Nodes does not contain requested property A

At C:\Users\username here\Desktop\MakeGroups.ps1:32 char:14

+  $groupId = (Invoke-SwisVerb $swis "Orion.Container" "CreateContainer" @(

+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1

    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

 

 

Looking in the DB, the script is creating the group under 'Containers', but there is not an entry being created under 'ContainerMemberDefinitions'

 

All help is appreciated

Viewing all 3719 articles
Browse latest View live