I have a question regarding changing agent skills automatically every night.
I've been told that it's possible to change agent skills back to "default" by using :
(found in Cisco-uccx-developer-guide-902.pdf)
| || |
HTTP Success Code
HTTP Failure Codes
401, 402, 405
But when I try I keep getting error 405 (Method not allowed) when using this script :
Dim strHTTP = Request.ServerVariables("HTTP_HOST")
Dim strServerFile As String = strHTTP & "/Webpage/Cisco_files/XML_masterfile.xml"
Dim wc As WebClient = New WebClient
wc.Credentials = New System.Net.NetworkCredential(usernameGoesHere, passwordGoesHer)
wc.UploadString("http://10.146.102.13:8080/adminapi/resource/", "PUT", strServerFile)
Catch ex As Exception
Can anybody tell me what I'm doing wrong?
See attached XML file for file details
is there any other error message apart from the HTTP status?
Also, did you try looking at the logs? Start up RTMT and look for one named catalina.out.
The problem is that I'm placed in an external company that are using the system, but we dont administrate it from here - so I'm not sure that I have access to those logs. What is the RTMT?
The error I get is in danish :
System.Net.WebException: Fjernserveren returnerede en fejl: (405) Metoden er ikke tilladt. ved System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte data, WebRequest& request) ved System.Net.WebClient.UploadString(Uri address, String method, String data) ved System.Net.WebClient.UploadString(String address, String method, String data) ved _CiscoChange.UpdateAgentSkills() i E:\Projects\Webpage\CiscoChange.aspx.vb:linje 17
Fjernserveren returnerede en fejl: (405) Metoden er ikke tilladt = Remoteserver returned an error : (405) Method is not allowed
Is it possible to do from a SQL storedprocedure instead you think?
no, SQL is not an option for administering UCCX. The REST API has been created to do that.
I'll try and install a UCCX 9 in my lab as soon as I find the installation media.
RTMT = RealTime Monitoring Tool, a software to download and analyze logs from UCCX.
Hi again Gergely,
I can't find the file i RTMT and I don't have access to root/ where it's also placed
Would be great if you are able to install and help me - thanks
it's available on the UCCX. Tools > Pugins.
Once installed, go to the Trace & Log Central, Collect Files, select all files for both UCCX and System, then do the REST API test again, then download the recent logs. We are looking for one named catalina.out.
I still cant find the file, all I get is this :
Collect Files in progress for node telm98cucm01.dk.telmore.net
Downloading results into E:\\TraceCollectionResult_2013-12-17_12-46-59_telm98cucm01.dk.telmore.net.xml for node telm98cucm01.dk.telmore.net
Completed downloading results into ...E:\\TraceCollectionResult_2013-12-17_12-46-59_telm98cucm01.dk.telmore.net.xml for node telm98cucm01.dk.telmore.net
Downloading files for node telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_02_201312171142_57043 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_01_201312171142_84793 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_02_201312171143_57044 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_01_201312171143_84794 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_02_201312171144_57045 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_01_201312171144_84795 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_02_201312171145_57046 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_01_201312171145_84796 from the node: telm98cucm01.dk.telmore.net
Downloaded cdr_StandAloneCluster_02_201312171146_57047 from the node: telm98cucm01.dk.telmore.net
No.of files Collected: 9
Collection Failed for: 1 files.
The following files were not collected:
Completed downloading for node telm98cucm01.dk.telmore.net
er... you are downloding CDR files from a CUCM.
I might need to take a look at the log files from a UCCX.
I'm getting this error, but that might be because it's server 2 - we also have one called telm98cucm01
I just got a lot more files this time around and I can see that we got catalina.out also
UCCX is called https://10.146.102.12 - but when I called that yesterday it failed collecting Ressources ... today it works
I ran through that log quickly, but I can't see anything in detail.
Anyway, what is 10.146.102.13?
One more thing, the doc says you need to pass the user ID (~ agent ID, or in CUCM: End User) in the URL
So you'll have to modify this line of your script:
", "PUT", strServerFile)
", "PUT", strServerFile)
10.146.102.13 is Cisco Unified Intelligence Center
Ahh ... I thought I could update all agents in one run.
No I get error (415) Unsupported Media Type - I'll see if I can geet a new catalina file
Strange, I cant seem to generate a new catalina file now.
415 Unsupported Media Type
The media type specified in the Accept header is not supported by the server. This will be the common response when the client resources version is no longer supported by the server.
I really appriciate you help so far G - hope you still can help me.
I am not a .NET user and I'll never be, but there should be a way to specify the media type of your request. Should be set to "Application/XML".
About the security stuff: it's HTTP Basic, and the user should have administrative rights on UCCX.
Do you have curl? If not, please go and download it. We are going to try to invoke the UCCX REST API with it (just to eliminate the possibility of errors in your program).
I've tried to download curl, but I can't seem to install it - it just blinks and then nothing happens.
This is my new script:
Dim strServerFile As String = Server.MapPath("~/Cisco_files/XML_masterfile_Rarja.xml")
Dim myWebClient As WebClient = New WebClient
Dim strContentLenght As String = Encoding.ASCII.GetBytes(strServerFile).ToString
myWebClient.Credentials = New System.Net.NetworkCredential("rarja", "myPasswordHere")
myWebClient.UploadString("http://10.146.102.12:8080/adminapi/resource/rarja/", "PUT", strServerFile)
Now I get a (400) Bad Request when I run it - so I guess that we have progress
Okay, it is really necessary to bypass the program and just test the URL.
I don't understand this code, but are you sure the username/password combination is sent along with the HTTP request?
Now I think Curl is installed according to :
(I'm not sure that I found the correct valid CERT files)
So what do you need me to do now?
curl -v -X POST -d @filename.xml "http://adminuser:firstname.lastname@example.org:8080/adminapi/resource/
curl -v -X POST -d @filename.xml -u adminuser:adminpassword "http://10.146.102.13:8080/adminapi/resource/
Wuhuu! That worked ...
E:\Projects\Webpage\Cisco_files>curl -v -X PUT -d @XML_masterfile.xml -u rarja:password "http://10.146.102.13:8080/adminapi/resource/rarja" --header "Content
* About to connect() to 10.146.102.13 port 8080 (#0)
* Trying 10.146.102.13...
* Adding handle: conn: 0x1f4c3d0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1f4c3d0) send_pipe: 1, recv_pipe: 0
* Connected to 10.146.102.13 (10.146.102.13) port 8080 (#0)
* Server auth using Basic with user 'rarja'
> PUT /adminapi/resource/rarja HTTP/1.1
> Authorization: Basic cmFyamE6U2FuZGVyMjAwOSU=
> User-Agent: curl/7.33.0
> Host: 10.146.102.13:8080
> Accept: */*
> Content-Length: 2532
> Expect: 100-continue
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Set-Cookie: JSESSIONID=91D8D679899986645DE21036E0ABB52C; Path=/adminapi/; Http
< Content-Length: 0
< Date: Wed, 18 Dec 2013 13:18:15 GMT
* Server Cisco is not blacklisted
< Server: Cisco
* Connection #0 to host 10.146.102.13 left intact
Hi, I am sorry but I cannot help you with that as I know nothing about .NET languages. A quick search at Stackoverflow got me this: