07-30-2009 03:36 PM
We are trying to import CM End Host Data into a SAS server. We are looking for the CLI commands to capture the data or the parameters/script to run a cron job. Does anyone know if this is possible? If anyone has this working, do you have the CLI or script info?
Thanks in advance,
Dave Sipes
07-30-2009 04:54 PM
You can get this data in either CSV or XML format, or by directly connecting to the database. To get the data in CSV format, run:
NMSROOT/campus/bin/ut -cli -u admin -p admin -query all
To get the data in XML format, run:
NMSROOT/campus/bin/cmexport ut -u admin -p admin -host -query all
To use direct database access, see http://www.cisco.com/en/US/docs/net_mgmt/ciscoworks_lan_management_solution/3.2/database_schema/guide/dbviews.html .
07-30-2009 04:59 PM
If you want all the columns exported, include the "-layout all" option, as in:
NMSROOT/campus/bin/ut -cli -query all -layout all -export /path/to/output.ext -u admin -p pass
08-03-2009 01:21 PM
Thank you for the information. I ran the ut commnads and I am able to export the data. I have more questions. 1. Can we export only certain data, i.e, Port Name or Vlan id? 2. Is there a Man page for the UT commands?
Thanks for your help.
08-03-2009 01:31 PM
If you create custom layouts in the Campus Manager UI, you can then pass those layout names to ut -cli. The same is true for custom queries you create in the Campus Manager UI.
You can get command help from http://SERVER/help/CMcore/CmHelp/Ut_UtCli_Cmd.html
08-03-2009 03:01 PM
Joe,
The information that you have provided has been great. However, I am still having one issue with the CLI. When I use the Layout Name; [./ut -cli -u test21 -p test21 -query all -layout Ops_Ex], I receive an error:
log4j:ERROR No appenders could be found for category (com.cisco.nm.ani.clients.utng.application.UTDataManager).
log4j:ERROR Please initialize the log4j system properly.
ERROR UTCLI: Error loading preferences. Ops_Ex is not a valid layout name for this user. I can access the query and layout with the UI. Any help would be most appreciative.
Thank-you,
Dave Sipes
08-03-2009 03:17 PM
When you login to the GUI, are you using the same test21 user?
08-03-2009 03:26 PM
Yes, I created the test21 account under CS with permission to export data. I created the layout under the test21 account. I can run the command [./ut -cli -u test21 -p test21 -query all -layout default] and receive all the data. It is only when I try to use the custom layout Ops_Ex that it fails.
08-03-2009 03:33 PM
I cannot reproduce. I created a new user, test21 with Help Desk and Export Data privilege. I went to Campus Manager > User Tracking > Reports > Custom Layouts, and created a new layout called Basic with Port Name and VLAN Id. I then went to the command line, and ran:
ut -cli -u test21 -p test21 -query all -layout Basic
It worked.
This could be a permissions problem on your server. Check NMSROOT/campus/etc/cwsi/users/test21.ut.preferences to make sure casuser can write to this file. It should contain all of the available layout data.
08-03-2009 04:03 PM
Ok, I deleted and recreate the account. It is working fine now.
Thank you for your help and support!
Dave Sipes
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