09-14-2020 05:42 PM
I'm trying to write a script to check a bunch of things. One of them is if UCCX master / slave are correct.
If I do
utils service list
I see at the bottom
Primary node = true (or false)
But I'm looking for Master / Slave designation, not 'primary node'.
I've seen something in the wallboard that's a URL like
http:///uccx/isDBMaster
However it's far better if this is a command line thing -- I can type it into my list, and I'm done.
If there is no direct command in the CLI to do this, would there be a way to do it with a SQL query?
09-15-2020 10:44 AM
I actually don't know the answer to this question, but I think I might have a creative workaround. So, the master has a node ID, and if you simply look at the last call to be processed, the node ID of that last call, should be the current master. Though, it is possible that a failover event has occurred between the last phone call, and when you check it. However, this might be a very narrow case.
run uccx sql db_cra select limit 1 nodeid from contactcalldetail order by startdatetime desc
09-15-2020 01:39 PM
Anthony,
That is a pretty clever solution and definite progress. After a reboot I'd have to make sure to make a phone call to the right number, and probably have an agent logged in then, I guess, right? Would there be any way to 'make a call' from the command line?
Another consideration, you have located the Node ID in the SQL (NICE FIND!), ..... how could we figure out how "isDBMaster" gets populated; or where the master/slave M and S on the serviceability page are coming from, in SQL. That would have to be in the database too, wouldn't it?
09-15-2020 02:58 PM
You cannot create a call from UCCX CLI.
I'm not so sure it's stored in the DB, since it's state and not configuration.
09-15-2020 03:05 PM
You can try checking the Master/Slave status from the Browser using this URL
https://uccx.cisco.com:9443/engineconfig/systeminfo
In the XML Output, look for the "dbMaster" field - if thats "True" then its Master in my opinion.
09-15-2020 03:41 PM
I put my UCCX IP in place of "uccx.cisco.com:9443". Is that correct?
I'm not getting anything.
https://10.1.1.25/engineconfig/systeminfo
...
HTTP Status 404 - /engineconfig/systeminfo type: Status report message: /engineconfig/systeminfo description: The requested resource is not available.
Is this supposed to give me a result similar to this link ".../uccx/isDBMaster" link?
09-16-2020 06:44 AM
I think you missed the port 9443 in the URL you tried above - it should be like this
https://10.1.1.25:9443/engineconfig/systeminfo
09-21-2020 10:12 AM
oh, I should have replied with the exact link you sent. But I did try that first.
I tried:
HTTPS, HTTP
9443, 443, no port
nothing worked.
Do I have to enable it somewhere?
09-17-2021 09:58 PM
This is applicable for 12.0+. Thanks a lot btw, would be great to have something like this to control CUC Primary/Secondary node assignment
09-21-2020 09:10 AM
Where do you think that Master/Slave status value lives then? ... a different database? text file?
The GUI and "isDBMaster" are pulling it from somewhere, or do they do some sort of test every time you query them?
thanks Anthony
09-21-2020 09:47 AM
It’s a state call as Anthony wrote. When you use either one of the posted calls it would do the query for what state the node is in and report it in “real time”. It is not stored anywhere.
09-16-2020 12:43 PM
Maybe there is an API that will tell you if your CCX is Master or Slave. You could run that from the command line.
Anthony's answer would be a brilliant solution, except you have to wait for a call to happen first. Great for daily status checking, but not for reboots.
02-03-2021 01:31 PM
Yeah, there's an API. It's in my original question. But for it to work you have to enable it in the Wallboard, which is not ideal.
And yeah, the reason I wanted it was for reboots at night. So I could see that everything booted up back to the way it was.
I still don't understand where the 'state' values are? Maybe in dynamic variables? "UCCX serviceability >> tools >> network services" is somehow able to pull it. ...
Thanks. Let me know if you get any other ideas.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide