Need assistance adding serial number and mac address to webhook trigger. Can't seem to find a variable to add or get a custom variable to work.

Trying to get MAC and Serial Number for node/device into webhook payload, but cannot find a working variable, and all attempts to create a custom variable seem to be failing.

Here is one option that I've tried. I've tried many different formatting options, but just can't seem to get the values into the payloads. I've put the variables that I've been trying to get to work in boldface. All the others work without issue

Any assistance would be greatly appreciate. Thank you all.

{
"app_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "${N=Alerting;M=Severity}",
"managed": "${N=SwisEntity;M=CustomProperties.Managed}",
"byob": "${N=SwisEntity;M=CustomProperties.BYOB_Circuit}",
"alert": "${N=Alerting;M=AlertMessage}",
"host": "${N=SWQL;M=SELECT TOP 1 RelatedNodeCaption FROM Orion.AlertObjects WHERE AlertObjectID = ${N=Alerting;M=AlertObjectID} }",
"custid": "${N=SwisEntity;M=CustomProperties.CustID}",
"object": "${N=SWQL;M=SELECT TOP 1 EntityCaption FROM Orion.AlertObjects WHERE AlertObjectID = ${N=Alerting;M=AlertObjectID} }",
"object_type": "${N=Alerting;M=ObjectType}",
"NodeID": "${N=SwisEntity;M=NodeID}",


"serialnum": "${SQL:Select TOP 1 ServiceTag FROM APM_HardwareInfo WHERE nodeid='${NodeID}'}",

 "macid": "${SQL: SELECT TOP 1 MAC FROM NodeMACAddresses FROM APM_HardwareInfo WHERE nodeid=${NodeID}}",


"description": "${N=Alerting;M=AlertDescription}",
"solarwinds_url": "${N=Alerting;M=AlertDetailsUrl}",
"acknowledged": "${N=Alerting;M=Acknowledged}",
"acknowledged_by": "${N=Alerting;M=AcknowledgedBy}",
"polling_engine": "${N=SwisEntity;M=Engine.ServerName}",
"ipaddress": "${N=SwisEntity;M=IP_Address}",
"latitude": "${N=SwisEntity;M=CustomProperties.Latitude}",
"longitude": "${N=SwisEntity;M=CustomProperties.Longitude}",
"location": "${N=SwisEntity;M=Location}",
"carrier": "${N=SwisEntity;M=CustomProperties.CarrierName}",
"carriername": "${N=SwisEntity;M=CustomProperties.CarrierName}",
"contactinfoemail": "${N=SwisEntity;M=CustomProperties.ContactInfoEmail}",
"circuitid": "${N=SwisEntity;M=CustomProperties.CircuitID}",
"siteaddress:": "${N=SwisEntity;M=CustomProperties.SiteAddress}",
"circuitype": "${N=SwisEntity;M=CustomProperties.CircuitType}",
"circuitspeed": "${N=SwisEntity;M=CustomProperties.CircuitSpeed}",
"timestamp": "${N=SWQL;M=SELECT GETUTCDATE() as a1 FROM Orion.Engines}",
"solarwinds_object_id": "${N=Alerting;M=AlertObjectID}"
}

Parents
  • The only thing I can see is possibly SQL should be SWQL ? It looks like you are using SWQL in some of the other selects.

  • yeah.... tried both ways.  Seems to be lack of data to pull... now attempting the suggestion  had above. Trying to figure out how to accomplish his suggestion.

  • In my case it was done by running a scheduled SQL report each day (not SWQL, you can't update with that) which would do something to the effect of 

    select n.nodeid, n.caption, n.MySerialNumberCustomProperty
    from nodes n
    where n.MySerialNumberCustomProperty is null or n.MySerialNumberCustomProperty = ''
    ;
    
    update nodes
    set MySerialNumberCustomProperty = othertable.serialnumber
    from nodes
    join othertable on othertable.nodeid=nodes.nodeid

    The tricky part is just hunting down all those tables and coming up with good where conditions to filter how I needed it to be

  • I create a custom property, similar to to what  does. I just update it through SWIS on a schedule using a PowerShell script. The main places that I pull serials/service tags from are listed below, with the exception of UnDPs which will likely be unique to your environment.

    • NCM.Nodes
    • NCM.CiscoChassis
    • Orion.HardwareHealth.HardwareInfo
    • Orion.AssetInventory.ServerInformation
    You'll find other entities that have the information, but they seem to reliably bubble up to other entities from my experience. For example, all of the entities below bubble up to Orion.HardwareHealth.HardwareInfo
    • Orion.HardwareHealth.HardwareInfoBase
    • Orion.HardwareHealth.HardwareInfoForArray
    • Orion.HardwareHealth.HardwareInfoForChassis
    • Orion.HardwareHealth.HardwareInfoForUCSChassis
Reply
  • I create a custom property, similar to to what  does. I just update it through SWIS on a schedule using a PowerShell script. The main places that I pull serials/service tags from are listed below, with the exception of UnDPs which will likely be unique to your environment.

    • NCM.Nodes
    • NCM.CiscoChassis
    • Orion.HardwareHealth.HardwareInfo
    • Orion.AssetInventory.ServerInformation
    You'll find other entities that have the information, but they seem to reliably bubble up to other entities from my experience. For example, all of the entities below bubble up to Orion.HardwareHealth.HardwareInfo
    • Orion.HardwareHealth.HardwareInfoBase
    • Orion.HardwareHealth.HardwareInfoForArray
    • Orion.HardwareHealth.HardwareInfoForChassis
    • Orion.HardwareHealth.HardwareInfoForUCSChassis
Children
No Data