cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
13585
Views
20
Helpful
8
Replies

Schedule Restart of CUCM service in CLI or GUI

dneggers1
Level 4
Level 4

Hi there,

Is there a way to Schedule a restart of a Service in CUCM 6.1?

I would like to restart this service below automatically every fortnight or so.. I cant find anything in the CLI or the GUI that will do it..

admin:utils service restart Cisco CallManager Attendant Console Server

Cheers

Dion

8 Replies 8

Jaime Valencia
Cisco Employee
Cisco Employee

There is no way to do that on CUCM, you would need to write down a custom program to SSH into the server, log in, and issue the command.

But natively within the CUCM server there is no way to do that.

Nice idea, it certainly would be possible via the linux shell to try something like that, but not via the CLI we provide.

You might get in touch with your AM and submit a PER if you're interested in this.

HTH

java

if this helps, please rate

www.cisco.com/go/pdihelpdesk

HTH

java

if this helps, please rate

Thanks Java,

I will write a script to login and issue the command..

Many thanks,


Dion

Was you able to write a script to do this. I have a need to reboot our CUPS server on a schedule bases. I did write a script that will shh the server and login and issue the command Utils System restart. My issue is I can not get the script to pass the "yes" to the server when ask "are you sure you want to restart".

Regards,

Robert

for /f %%i in (rl.txt) do echo y | c:\putty\plink.exe

the "echo Y" will provide the yes option for every time you login to devices in rl.txt file.

Vivek Dubey

The Y does not need to be echoed once you answer Y once and let it write credentials to the registry in Local User. Then you can export these reg entries and use "reg add" and add these to your bat file so if other users need to use it they will not even get prompted for Y/N at login. Also for CUCM and UCCX to run multiple commands you will need hundreds of "enters" between the commands. So for example line 1 would be the CLI command, then 100-1000 enters, then second command. The amount of enters needed differs depending on the output. Usually 300 will work with anything, if not add more, I've had to use 1000+ before it runs the second command. Also you will need to run EXIT as the last command or plink will never finish. I use the following command below. This will parse out the extra Admin: prompts you will when using many enters. Also note the -m switch to run multiple commands doesn't work as advertised.Notice how I use the < symbol to redirect the .txt file with the commands into the plink.exe command. You can try adding the Echo Y^| at the beginning of the plink command to answer Y to login prompt, I had some luck, but importing the reg entry it adds automatically is the best solution. Cisco IOS doesn't seem to have these issues but with Cisco CUCM and CCX this is the only way it works.

for /f "tokens=*" %%a in ('plink 2^>nul -ssh -pw password -l username IP ^< ShowNetEth0.txt^|find /v "admin:"') do echo %%a

Did you ever get this to work?  I cant seem to figure out plink and passing the Y.

Hi Larry,

I made a small Python code which shuts down CUCM. It should be run on a separate server. You can use "pexpect" library to login to CUCM via SSH and send "utils system shutdown", than wait for "Enter (yes/no)?" and finally send "yes". Something like this:

import pexpect
import sys
server_ip = "<CUCM IP>"
server_user = "<platform user>"
server_pass = "<platform pass>"
child = pexpect.spawn('ssh %s@%s' % (server_user, server_ip))
child.logfile = sys.stdout
child.timeout = 60
child.expect('password:')
child.sendline(server_pass)
child.expect('admin:')
child.sendline('utils system shutdown')
child.expect('Enter (yes/no)?')
child.sendline('yes')
child.expect(' Appliance is being Powered - Off ...')
print 'Shutdown command successfully sent.'

Thanks for sharing that info Dragan.  I used your script to reboot UCCX servers periodically, I just needed to modify the poweroff statements to what the UCCX (or any UC cli) will expect/output.

child.sendline('utils system restart')
child.expect('Enter (yes/no)?')
child.sendline('yes')
child.expect(' Appliance is being Restarted ...')

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: