How to pass the password to the dcrcli command from a batch file or scipt?

Unanswered Question
Aug 5th, 2008
User Badges:

Think LMS 2.6 with all patches...

We found out that if you schedule an "Export to File" in Common Services, it uses wildcards that you may have entered into the device selector to create the scheduled job BUT it then keeps running the exact same report; even after devices have be deleted and added; thus rendering the export useless.

So, if we could use DCRCLI from a scripted "cron" job, we could rely on the report being dynamic. But, we can't store a device username and password on the server (system admins for the server can't see that password). We could store the password on another server and run the script from another server but all we need to do that is to be able to pass the password to the command line dcrcli command.

Anyone have any ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Joe Clarke Tue, 08/05/2008 - 12:19
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

You can use the DCRCLIFILE file to store the username password combination. For example:

admin admin

Then, set the environment variable DCRCLIFILE to point to the fully-qualified path to this file. For example:

env DCRCLIFILE=/usr/security/dcrpw dcrcli -u admin ...

philip.r.hayes Mon, 08/11/2008 - 11:02
User Badges:

Actually, no, we can't use that file. Due to security concerns. We need to know if there is another way such as I described in my post.

Joe Clarke Mon, 08/11/2008 - 11:07
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

You could do this with an expect wrapper, or something that can spawn the command, wait for a prompt, then react. You cannot pass the password on the command line. This was actually done for security reasons so the password would not show up in the process table.


This Discussion