Exporting LMS 3.2 Campus Manager End Host Data via CLI or cron job

Unanswered Question
Jul 30th, 2009
User Badges:

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Thu, 07/30/2009 - 16:54
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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 .

yjdabear Thu, 07/30/2009 - 16:59
User Badges:
  • Gold, 750 points or more

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

dave_sipes Mon, 08/03/2009 - 13:21
User Badges:

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.

Joe Clarke Mon, 08/03/2009 - 13:31
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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

dave_sipes Mon, 08/03/2009 - 15:01
User Badges:

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

Joe Clarke Mon, 08/03/2009 - 15:17
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

When you login to the GUI, are you using the same test21 user?

dave_sipes Mon, 08/03/2009 - 15:26
User Badges:

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.

Joe Clarke Mon, 08/03/2009 - 15:33
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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.

dave_sipes Mon, 08/03/2009 - 16:03
User Badges:

Ok, I deleted and recreate the account. It is working fine now.


Thank you for your help and support!

Dave Sipes

Actions

This Discussion