Showing results for 
Search instead for 
Did you mean: 

Query NAC Database

Query NAC Database

New Contributor
Hi, can anybody tell me, how I can query the database on the NAC?

I try to make a query for the actual count of end systems on the NAC?
I have found, that a table "end_system" in the database exist, but the query:
tag=# select end_system_id from end_system
give me no results.


New Contributor
Hi SH,

thank you very much for your suggestion with the XMC databases, so I can find a very good solution for my problem:

First, I have to use the database "netsight", not "netsightrpt". As table in this database I use "tam_endsystem". Here all end-systems are stored. Then I made a search for all end-systems with status "ACCEPT" on each of our nac-appliances.

So, my cli command in directory /usr/local/Enterasys_Networks/NetSight/mysql/bin/mysql is:
./mysql --host=localhost --user=USER -pPASSWORD --port=4589 --protocol=TCP netsight -e 'select COUNT(*) from tam_endsystem where nacApplianceIp = "IP-OF-NAC-APPLIANCE" AND STATE = "ACCEPT";'

This script I saved for every of our nac-appliances with there corresponding IP-Address.

Regards and thanks,


Valued Contributor III
Hello Kurt,

thank you for your hint regarding graphiql. That's a good possibility. But in my opinion. The best solution depends on what somebody wants do to with the end system count.

If you will see the consumed licenses it's hard to pull the end system counts time by time, because of some mac addresses do not live long depending on the timers in switches, nac and wlan.
For this case the database information is much more accurate I think. Depending how accurate it must be . If 100 mac more or less it's not a problem to pull the end system macs.

Regards Stephan

Extreme Employee

as Stephan mentioned: if you query the end-system count from a NAC appliance's DB you will need to repeat this process on all your NAC appliances. It is easier to query the total count of all end-systems from all NAC appliances from the XMC database.

That said, we generally do not encourage customers/partners to directly query the DB. The preferred option would be to query end-system (and other) data via the API. If you have XMC v8.2 a simple way would be to pull the list of all MACs and then count them yourselve through some script. To test this, use your browser to go to your XMC at (use your XMC IP)

On the left side insert

Then click the play button above and you should see the list of all MACs on the right.


New Contributor
Hi, thank you for your answer. I will test this.

In the meantime, I have found another method. I have made a script with the following statement:
psql -U postgres -d tag -c "select count(*) from end_system" | grep -A1 - | grep -v -

The script open the database "tag" (the postgres database on the nac) and count the entries in the table end_system. The output gives me 4 lines, the count is found under the line "-----" because of this I made some grep for isolating the number.