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,
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 .
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
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.
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
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.
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.
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
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.
Ok, I deleted and recreate the account. It is working fine now.
Thank you for your help and support!