VMware Cloud Community
TheVMinator
Expert
Expert
Jump to solution

Automating vCheck

Is it possible to run vcheck by just adding all the parameters after it on one command line such as:

.\vcheck.ps1 -thisparameter thisvalue -thatparameter thatvalue

(this way you don't have to answer all the prompts?  This helps if you want to automate kicking it off and you don't want to have to run through it first and answer all the questions)

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The parameters are all stored in the file GlobalVariables.ps1, you can change the entries in that file from another script, or perhaps have multiple versions of the file available.

The first step in your  vCO flow would then be to copy the correct version to the GlobalVariables.ps1 file.

After that you can just start the vCheck script


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

You'll find instructions how to run this as a scheduled task in Setting Up a Monitoring System to Run vCheck 6.15 for Scheduled Monitoring of Multiple vCenter Serve...


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

TheVMinator
Expert
Expert
Jump to solution

OK thanks.  This appears to be assuming that you are using scheduled task rather than a vCO workflow.  If most of your Orchestration is already in vCO, is that still the best option or should you use vCO rather than a scheduled task?  Or use them in conjunction?

Thanks

0 Kudos
LucD
Leadership
Leadership
Jump to solution

If you already use vCO for other work, you could the scheduling in there as well.

Have a look vCO vCheck.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

TheVMinator
Expert
Expert
Jump to solution

OK great thanks.  One more question - I do have a powershell server set up that I can connect to via vCO and kick off a powerCLi script on the powershell server using a WinRM connection.  Given a choice between using using vCO to run vco vcheck or using it to the regular vCHeck over winrm on a powershell server, which is best and why? 

0 Kudos
LucD
Leadership
Leadership
Jump to solution

In my opinion there is no "best" solution here.

Whatever fits your needs and complies with your standards, is the best solution.

If you selected vCO as your automation framework for workflows, stick with it.

Using the Windows Task Scheduler is clearly outside the vCO framework, and you will have to cope with all the management issues that this might impose.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TheVMinator
Expert
Expert
Jump to solution

Ok thanks.  I'm having a few issues using vCO vCheck which I'm working on, but in the meantime if I wanted to use vCO to initiate powerCLI vCheck, what is the best way to do this or is that a bad idea?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I suspect that you can just run the vCheck script from the vCO PowerShell plug-in.

See vCO PowerShell plug-in


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TheVMinator
Expert
Expert
Jump to solution

I'm actually using the plug-in, but just trying to determine the best strategy to use to make it work.   When I run vCheck in powercli I can step through all the configuration parameters it prompts me for which seems like 20 or 30 questions it asks me.  If I call vCheck from vCO, I can't do that.  I would have to somehow pass those parameters in the call from vCO to the PowerShell server.  To do that I'm assuming I would need one really big long command like:

c:\vcheck.ps1 -DRSDaysBackToReportOn 7 -StorageDRSDaysBackToReportOn 7                                                                   -DatastorePercentFreeSpaceToReportOn 20 -IncludeSnapshotsThisManyDaysOld 3

OK so I made up the parameters to show that I don't know what the parameters would be, or if specifying parameters like that in one big line for all the 20 or 30 questions it asks you is even possible?  If I could do it in a powerCLI window I could emulate the same command in vCO but I don't know if it is possible?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The parameters are all stored in the file GlobalVariables.ps1, you can change the entries in that file from another script, or perhaps have multiple versions of the file available.

The first step in your  vCO flow would then be to copy the correct version to the GlobalVariables.ps1 file.

After that you can just start the vCheck script


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TheVMinator
Expert
Expert
Jump to solution

OK thanks again

0 Kudos