This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How can I extract one serial number per line. HPE / Aruba

We currently have two reports that 'sort of' work for two different clients, but both have Aruba / HP / HPE kit. The problem comes when the devices are stacked and the report starts to get real messy, real quick.

What we need to do is extract all physical devices and their serial numbers (along with other info but that is a secondary aspect right now) so that one physical device has one associated serial number per line.

For one client, we are using a custom node poller a la:

The SWQL, which is meaningless to me or in SWQL Studio, for this is:

SELECT [data].[DisplayName] AS [DisplayName],[data].[Node].[DisplayName] AS [DisplayName1],[data].[InstanceSiteId] AS [InstanceSiteId]
FROM orion.npm.custompollerassignmentonnode AS data
WHERE
((([data].[CustomPoller].[OID]) = ('1.3.6.1.2.1.47.1.1.1.1.11')) AND (([data].[Node].[CustomProperties].[Client]) = ('XYZ')))
WITH NOLOCK

And when we add relevant columns to the custom table, the end report looks like a bit like this:

What I think we need to do is extract just the 'Module LevelX' part -- or -- the section that has:     but I suspect, if feasible, the easier one would be Module lLevel1.

When I browse the OID (1.3.6.1.2.1.47.1.1.1.1) via the MIB Browser

Other devices might have multiple blue lines between the serials, but what remains consistent in the report output is the Module line and/or the HPE Model lines.

Question: so is there a way to create the report to just show the relevant lines?

Extra: I mentioned above that we need to extract other info, so the report isn't just a bare:

device 1 unit 1 - serial number 1
device 1 unit 2 - serial number 2
etc

I mention this in case someone has a clever way of extracting just the relevant info as above and placing it one line, one serial. We need to add client, location, etc - all mostly custom properties.

For the record: We've been doing this via custom properties for now where the CP has all serial numbers for that device in one line separated by -- 
e.g. Device 1:  CN5BH1P018 -- CN5BH1P01J

but this causes issues with the reporting team as they have to manually edit and add in the additional lines and cut/paste the serial accordingly.

Bottom line is I guess that would be doable via custom SQL/SWQL but it is way beyond my reach.




  • I need to link in another table but no matter what format I put my FROM xx JOIN line I get a 'no viable alternative' error message.

    Essentially I need to link in the Orion.Nodes table to extract some data from that. As I don't understand the half of what your code is doing, it could be that my extra join is breaking the code in some manner that I just don't understand.

    Can you advise?

    From this section of one of your replies:

    END AS Member
    FROM NCM.Nodes a INNER Join NCM.EntityPhysical b ON a.NodeID = b.NodeID
    Where (EntityDescription like 'Aruba%' OR EntityDescription like '%J9%') AND Serial <> ' ' AND (EntityDescription <> 'Aruba' AND EntityName <> 'Switch Management Module')
    Order by AgentIP, Member, EntityDescription, EntityName