cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4412
Views
26
Helpful
10
Replies

UCCX CLI command/ query to show trigger, application, script

lleweyiss
Level 4
Level 4

I have UCCX 11.6  and I was told the CLI query to show the list of Triggers and the Applications they are assigned to.

For those of you who don't know it is:

run uccx sql db_cra select triggername, applicationname from crstrigger where active = 't'

 

What I would like to know if there is a query that will provide the Trigger, the Application, and the Script currently assigned to that Application.  

Is there a query that will put all those together?

IF not,  is there a query that lists the Application and Script currently assigned? 

then I could run both queries and put into Excel and manipulate to get all three lined up.

1 Accepted Solution

Accepted Solutions

Anthony Holloway
Cisco Employee
Cisco Employee

 

Unfortunately, this wont be possible from the CLI for one reason alone: Cisco stores certain data as private binary data, not intended for you to view.

 

From the DB Schema Document:

Table
crsapplication - The CrsApplication table records application information.

Column
privateData - Internal data not exposed to customers - BLOB

 

If you were to try and view this on the CLI, it would just print garbage to the screen and scroll your terminal a lot.

 

If you were to view the binary data in a Hex Editor, you would see something like this for the script name.

 

uccx-private-data.png

 

I thought of the Admin API next, since there is a list Application method to call, but unfortunately the Triggers are not in the output, though the Script name is.  There is also a list Trigger method to call, which gives us the Application Name.  Hmmm...

 

At this point, I would just write a program to call both APIs and merge the data together.

 

In fact, why not write a UCCX Script to do it?  This way you get the data you want, and you also get to learn UCCX!  I am attaching a script which does just that.  It reads both API calls: Trigger and Application, merges the data, then saves a CSV file report to the UCCX Document Repository.  Just replace the variable values with your own values and then run an active debug (F5).

 

If you have a lot of triggers or apps, then you might hit the 1,000 step maximum.  You'll need to change it to a higher number, and restart the engine.  There's not recommended number, but I often see systems at 10,000, some even at 50,000.

 

You could then take this a step further and if you have UCCX Premium, attach it to an HTTP Trigger, and have a web base report generated for you on the fly.  ;)

 

EDIT 2019-06-28 @ 10:10 AM CST

I refactored the script from 2 loops to 1, so it should not only run faster, but also, not hit the default 1,000 step max unless you have more than 140 triggers (6 steps of overhead, 7 steps per trigger).  Also, this script is written for UCCX 11.6(2) and makes use of the Make Rest Call step.

 

You should also review my article on masking passwords in scripts:

https://community.cisco.com/t5/collaboration-voice-and-video/uccx-masking-passwords-in-scripts/ta-p/3137357

 

EDIT 2019-06-28 @ 10:30 AM CST

Ok, I couldn't help myself, I am also now attaching a version of the script that creates an HTML output for use with UCCX Premium's HTTP triggers.

View solution in original post

10 Replies 10

Joel Jones
Level 1
Level 1

I have been looking for this as well. I haven't had time to dig through the schema and figure out how to join the two db's together. the Scripts live in the db_cra_repository and the application and triggers live in the db_cra. The query to just display all of the scripts is below. Just need to find the correct relationships.

run uccx sql db_cra_repository select filename from scriptsfiletbl

I've also noticed that its hard to figure out all the tables and columns within the db_cra_repository. So if anyone can provide that, i think it would help too.

I am a novice at sql commands, so I really don't know how to join that information from the 2 db's.
Thanks for the listing of scripts sql query, will add it to my "How to " file :-)

Since the UCCX application web pages don't present this relevant information on one screen , it would seem that most Admins would want to have all this in one view without opening each application .... just very surprised that no one else (I can find) is asking about it.
It seems, to me at least, like an obvious view that most people would want without having to figure out some sql query. Might be wrong :-)

Yeah, it always feels like Cisco doesn't care about the administrators lives. They never give us the features that help our lives. They only give us the features we didn't request and somehow makes them more money :)

Anthony Holloway
Cisco Employee
Cisco Employee

 

Unfortunately, this wont be possible from the CLI for one reason alone: Cisco stores certain data as private binary data, not intended for you to view.

 

From the DB Schema Document:

Table
crsapplication - The CrsApplication table records application information.

Column
privateData - Internal data not exposed to customers - BLOB

 

If you were to try and view this on the CLI, it would just print garbage to the screen and scroll your terminal a lot.

 

If you were to view the binary data in a Hex Editor, you would see something like this for the script name.

 

uccx-private-data.png

 

I thought of the Admin API next, since there is a list Application method to call, but unfortunately the Triggers are not in the output, though the Script name is.  There is also a list Trigger method to call, which gives us the Application Name.  Hmmm...

 

At this point, I would just write a program to call both APIs and merge the data together.

 

In fact, why not write a UCCX Script to do it?  This way you get the data you want, and you also get to learn UCCX!  I am attaching a script which does just that.  It reads both API calls: Trigger and Application, merges the data, then saves a CSV file report to the UCCX Document Repository.  Just replace the variable values with your own values and then run an active debug (F5).

 

If you have a lot of triggers or apps, then you might hit the 1,000 step maximum.  You'll need to change it to a higher number, and restart the engine.  There's not recommended number, but I often see systems at 10,000, some even at 50,000.

 

You could then take this a step further and if you have UCCX Premium, attach it to an HTTP Trigger, and have a web base report generated for you on the fly.  ;)

 

EDIT 2019-06-28 @ 10:10 AM CST

I refactored the script from 2 loops to 1, so it should not only run faster, but also, not hit the default 1,000 step max unless you have more than 140 triggers (6 steps of overhead, 7 steps per trigger).  Also, this script is written for UCCX 11.6(2) and makes use of the Make Rest Call step.

 

You should also review my article on masking passwords in scripts:

https://community.cisco.com/t5/collaboration-voice-and-video/uccx-masking-passwords-in-scripts/ta-p/3137357

 

EDIT 2019-06-28 @ 10:30 AM CST

Ok, I couldn't help myself, I am also now attaching a version of the script that creates an HTML output for use with UCCX Premium's HTTP triggers.

Thanks @Anthony Holloway for your work here! Sorry to beat the dead horse, but it sucks we have to do all this custom work to have a high level view of the system. You think Cisco would allow these actions naturally. Or at least not make the data "private" and not intended for us to view. I'll be working on a lot of things, so I'm hoping I get to test this solution out soon. Thanks again for the help!

I couldn't agree more. Cisco should consult people like us, the real users of these systems. ;)

Anthony,

 

Cant thank you enough for the work on this !!  While I am not a complete novice , my expertise would have taken me a while to get to this, especially the HTTP, I do not have any today and no need for it, so really would have been a bit much for me.  And I can now use this to get familiar and learn how to use it !!

 

I UCCX 11.6.1, Premium, and only have about 70 triggers.

I agree with both of you guys, the Developers should come and sit with real time users, that use the system day in an day out.  I have a laundry list of the items that would just make the web pages and the admin easier , more relevant :-)

 

THANKS !!!!!

 

Since this is related to triggers/applications I am posting it here. I am a beginner to programming. I am looking to add multiple triggers and applications to uccx 12.0. I am able to add one trigger/one application using api but not able to add multiple using api and I believe that is by design. I am using Postman. Please correct me if I am wrong.

If we cant do the above using postman, does anyone have a tool or script that can do this?

 

Thankyou.

 

Regards

Sriram

@srirgopa Recommend you to post your question in it’s own post instead of using an old already tagged as answered.



Response Signature


Thankyou. Will do.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: