04-05-2026 09:24 PM
For Site Engine, I'm trying to create a query in GraphQL where I can enter the MAC address of an end-system and get the last time it was on the network, and what switch (wireless access point) it was connected to at that time. Basically, trying to locate where it was when it dropped off the network.
I can successfully query 'lastSeenTime' but I need it to also return the result for the 'Switch Nickname' column within Control->End-Systems for that MAC address - the switch nickname is the hostname of the wireless access point. I don't see any variables for 'Switch Nickname' even though there is a column for it in the same table as the 'Last seen Time'
'locationInfo' only provides a MAC address of the BSSID the pulled from the 'AP MAC' column of the same table - it's not the switch/wireless AP interface
Here is my current GraphQL query:
{
accessControl {
endSystemByMac(macAddress: "58:6D:67:97:3A:XX") {
endSystem {
lastSeenTime
switchIP
locationInfo
ipAddress
operatingSystemName
state
extendedState
nacApplianceGroupName
}
}
}
}
Has anyone done this successfully, and if so, how?
4 weeks ago
I've only ever done this as a script. Here is a sample of a python script that I have for something similar:
query = '{ accessControl {endSystemByMac(macAddress: "' + mac + '") {endSystem{switchIP,reason}}}}'
response = emc_nbi.query(query)
if response and 'accessControl' in response and response['accessControl']['endSystemByMac']['endSystem']:
data = response['accessControl']['endSystemByMac']['endSystem']
sw_ip = data['switchIP']
reason = data['reason']
if sw_ip:
# Use the switchIP to pull the name of the AP the device is connected to.
queryD = '{ network {device(ip: "' + sw_ip + '") {nickName}}}'
responseD = emc_nbi.query(queryD)
dataD = responseD['network']['device']
apName = dataD['nickName']
04-09-2026 06:40 AM
The 'Switch Nickname' is not part of the accessControl table so it can not be included in the response to the query.
There is a way however. You will need to do a network query using the switchIP from your first query.
{
network {
device(ip: "' + sw_ip + '") {
nickName
}
}
}
a month ago
How would I make it a nested query? A lot of what I've read on GraphQL shows for the way SiteEngine handles schema you can't nest queries into a single query. Or at least I can't combine the query you typed into the query in my post.
Thoughts?