Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

a script to extract cwcli out put from LMS 3.1

on my old LMS 2.6 using a command on my script to pull cwcli as follow" system('/usr/local/bin/ssh LMS-serv /opt/CSCOpx/campus/bin/ut -u XXX -p XXX -cli -query all -layout DEVICES > /tmp/ut-data'); this work because the server log on root privilage. now I don't have root privilege on New LMS server.so i couldn't log in with out providing the password. so how I can add password on ssh line " system('/usr/local/bin/ssh" I know add option (-l)for login but don't know what option use for password. because -p is not password instead of for port any help!!!!

3 REPLIES
Cisco Employee

Re: a script to extract cwcli out put from LMS 3.1

This is not possible. You will have to enter the password manually. Note: you really don't want to the password on the command line as it would then be visible in the ps output. You should consider setting up public key authentication, and using an ssh-agent. Alternatively, you can use something like expect to wrap the call to ssh in order to respond to the Password: prompt.

Re: a script to extract cwcli out put from LMS 3.1

I do not know how you further process the received data you get from cwcli, but beside the public key authentication to authenticate you should also have a look if the servlet option could be a solution:

http://www.cisco.com/en/US/docs/net_mgmt/ciscoworks_campus_manager/5.1/user/guide/dee.html#wp1034795

with this you do not have to login to the server but you are sending a request to the Web-Server and you will get back the result that could be written in a file. But the result will be in XML not csv.

New Member

Re: a script to extract cwcli out put from LMS 3.1

thank you so very much, my perl knowledge is very limited and I am very happy to try anything at this moment, do you think can convert xml to csv later? I am using this data for many things including for service desk I need badly.

124
Views
0
Helpful
3
Replies
作成コンテンツを作成するには してください