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

Why would DiscoverInterfacesOnNode return data with InterfaceID set to 0?

$
0
0

Hey guys and gals,


I am having the most bizarre problem. If I POST/Invoke the DiscoverInterfacesOnNode verb, I appear to get back data that looks perfectly fine except that the InterfaceID field is 0! This seems quite bizarre to me because whenever I do this POST 'manually' via SoapUI, I get the same data, except that InterfaceID is in fact a valid number.


Been banging my head on this all day today and have yet to figure out how this could possibly be happening. The only thing that appears to be different is that in SoapUI's request header I can see "Accept-Encoding: gzip,deflate", but can't seem to see it in my request headers, which I'm trying to dump out via this C# code;


    foreach (KeyValuePair<string, IEnumerable<string>> httpContentHeader in requestMessage.Content.Headers)
    {
        this.loggerInstance.Info(
            "Header Item Name/Value: {0};",
            httpContentHeader.Key);

        foreach (var contentString in httpContentHeader.Value)
        {
            this.loggerInstance.Info(
                "Content Item: {0}",
                contentString);
        }
    }

--
03-Feb-2015 21:09:11.2714  INFO DiscoverInterfacesOnNode(): HttpRequestMessage.Content.Headers values:
03-Feb-2015 21:09:11.2744  INFO Header Item Name/Value: Content-Type;
03-Feb-2015 21:09:11.2764  INFO Content Item: application/json
--

I've googled it, but can't seem to find out how to add that Accept-Encoding line into my request.


Here is some other, hopefully helpful info; the order in which I attempt to add new nodes to Orion.


1. CreateNode call (*/v3/Json/Create/Orion.Nodes)

 

2. Update 2 Custom Properties for/on the Node just added.

 

3. Call my method that makes the DiscoverInterfacesOnNode call... (I'm going to include the rest of my code at this level because the method names should give you enough of an idea of what's being done and possibly why I'm having this issue.. if the order of these operations could possibly do what appears to be getting done to the data.)

 

// Invoke the DiscoverInterfacesOnNode verb for the new Node.
var discoveredInterfaces = DiscoverInterfacesOnNode(nodeId);

if (discoveredInterfaces.DiscoveredInterfaces.Count <= 0)
{
  this.loggerInstance.Warn(
   "Discovered NO INTERFACES for Node {0} !!",
   nodeId);
}

int addedInterfaces = 0;
if (discoveredInterfaces.DiscoveredInterfaces.Count > 0)
{
  addedInterfaces = AddInterfacesToNewNode(nodeId, discoveredInterfaces);

  loggerInstance.Info(
   "AddInterfacesToNewNode() returned: {0}",
   addedInterfaces);

  if (discoveredInterfaces.DiscoveredInterfaces.Count != addedInterfaces)
  {
   loggerInstance.Warn(
    "The number of interfaces ({0}) != the number of added ones ({1}) !",
    discoveredInterfaces.DiscoveredInterfaces.Count, addedInterfaces);
  }
}

// now for the Node pollers
var addedPollersCount = this.AddPollersToNewNode(nodeId, currentSoTItem);

if (addedPollersCount <= 0)
{
  loggerInstance.Warn(
   "AddPollersToNewNode( nodeId: {0}, * ) returned {1}.",
   nodeId,
   addedPollersCount);
}

// ..and the Interface pollers.
if (addedInterfaces > 0)
{
  this.loggerInstance.Debug(
   "AddPollersToInterfaces( {0}, {1}, {2} ): Calling...",
   nodeId,
   currentSoTItem.Hostname,
   discoveredInterfaces.DiscoveredInterfaces.Count);

  AddPollersToInterfaces(nodeId, currentSoTItem, discoveredInterfaces);
 
  this.loggerInstance.Debug("AddPollersToInterfaces(): Done.");
}

// and Finally, add the new node to NCM
this.loggerInstance.Debug("AddNodeToNCM(): Calling");
AddNodeToNCM(nodeId);
.

Inside the DiscoverInterfacesOnNode() method, I make the REST / POST call and dump out the result as 'raw' as I can; which is a string due to calling "response.Content.ReadAsStringAsync();" (where response is an HttpResponseMessage instance) so as to, again, get the data back as 'raw' as I can. This is to verify that I'm not doing anything that could be 0-ing out those values.

 

Here is a small chunk of my log output. You can see that the InterfaceID's are all 0, yet the other int fields have the same numbers I can see in the SoapUI output when making the DiscoverInterfacesOnNode POST.

03-Feb-2015 21:09:13.1764 DEBUG DiscoverInterfacesOnNode(): string: "{"DiscoveredInterfaces":[{"ifIndex":83886080,"Caption":"mgmt0","ifType":6,"ifSubType":0,"InterfaceID":0,"Manageable":true,"ifSpeed":0.0},{"ifIndex":335544320,"Caption":"loopback0","ifType":24,"ifSubType":0,"InterfaceID":0,"Manageable":true,"ifSpeed":0.0},...

 

Here is different interfaces data queried via SoapUI;

{"DiscoveredInterfaces": [{"ifIndex": 83886080,"Caption": "mgmt0","ifType": 6,"ifSubType": 0,"InterfaceID": 3717,"Manageable": true,"ifSpeed": 0},{"ifIndex": 385875968,"Caption": "Null0 · Null0 interface","ifType": 1,"ifSubType": 0,"InterfaceID": 3718,"Manageable": true,"ifSpeed": 0}],"Result": 0}


ANY thoughts on why/how this might be happening would be GREATLY appreciated.


Viewing all articles
Browse latest Browse all 3719

Trending Articles



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