### Example Deployment Command Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/deployWindowsAgentSimple/README.md This example shows how to use the deployWindowsAgentSimple.ps1 script to install the agent and configure a service account on remote servers listed in sqlServers.txt. ```powershell # example .\deployWindowsAgentSimple.ps1 -vip mycluster -username admin -domain local -serverList .\sqlServers.txt -installAgent -serviceAccount mydomain.net\myuser # end example ``` -------------------------------- ### Example Deployment Command Source: https://github.com/bseltz-cohesity/scripts/blob/master/ccs/powershell/deployCCSWindowsAgent/README.md This example demonstrates how to run the deployCCSWindowsAgent.ps1 script to install the agent, register it as a protection source and SQL server, and configure a service account. Ensure you replace placeholders with your actual values. ```powershell # example ."/deployCCSWindowsAgent.ps1" -username myuser@mydomain.net -region us-west-2 -serverList ".\sqlServers.txt" -installAgent -saasConnector 'my saas connector' -register -registerSQL -serviceAccount mydomain.net\myuser # end example ``` -------------------------------- ### Python Virtual Environment Setup and Script Execution Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/generateAndUploadClusterCerts/README.md Set up a Python virtual environment, install prerequisites, download scripts, and run the main script. ```bash # Install virtualenv sudo pip3 install virtualenv # Create myenv python3 -m venv myenv # Enter myenv source myenv/bin/activate # Install requests in myenv pip3 install requests # download the cert.py script curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/generateAndUploadClusterCerts/generateAndUploadClusterCerts.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity/pyhesity.py chmod +x generateAndUploadClusterCerts.py # run the cert.py script ./generateAndUploadClusterCerts.py --config cluster-cert.json [--generate] [--upload] # Exit virtualenv deactivate ``` -------------------------------- ### Example: Deploy Linux Agent Source: https://github.com/bseltz-cohesity/scripts/blob/master/windows/deployLinuxAgent/README.md Demonstrates how to run the `deployLinuxAgent.exe` tool to deploy a Cohesity agent installer to a Linux host via SSH. Specify the target server, username, and the path to the installer file. ```bash #example deployLinuxAgent.exe -s myhost1 -u myusername -f el-cohesity-agent-6.6.0d_u6-1.x86_64.rpm #end example ``` -------------------------------- ### Enable and Start Upgrade Server Service Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/upgradeCluster/README.md Enables the upgrade server to start on boot and then starts the service. ```bash systemctl enable cohesity-upgradeserver.service systemctl start cohesity-upgradeserver.service ``` -------------------------------- ### Download and Install EPIC VM Freeze Thaw Script Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/epic_vm_freeze_thaw/README.md Download the script from GitHub, place it in the specified directory, and make it executable. This is the initial setup step for the script. ```bash sudo mkdir /etc/vmware-tools/backupScripts.d cd /etc/vmware-tools/backupScripts.d sudo curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/bash/epic_vm_freeze_thaw/epic_vm_freeze_thaw.sh sudo chmod +x epic_vm_freeze_thaw.sh ``` -------------------------------- ### Example Log Output Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/refreshNASclone/README.md This is an example of the log output generated by the `refreshNASclone.py` script, indicating the start time, view deletion, and recovery process. ```text started at 2019-03-17 18:25:10 deleting view test recovering \\mynas.mydomain.net\myshare from 2019-03-17 18:24:52 to test ``` -------------------------------- ### Example Script Execution Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/createZDLRAView/README.md This example demonstrates how to run the `createZDLRAView.py` script with various parameters to create a new view. ```bash #example ./createZDLRAView.py -v mycluster \ -u myusername \ -d mydomain.net \ -n newview1 \ -s mystoragedomain \ -w '192.168.1.0, 255.255.255.0, Test Lab' \ -w 192.168.2.11 #end example ``` -------------------------------- ### Example Usage of createViewAlias.py Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/createViewAlias/README.md This example demonstrates how to run the createViewAlias.py script with essential parameters to create a view alias. ```bash #example ./createViewAlias.py -v mycluster \ -u myusername \ -d mydomain.net \ -n myview \ -a myalias \ -p /folder1 #end example ``` -------------------------------- ### Linux Example Parameters Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/epic_pure_ppg_freeze_thaw/README.md Example parameters for running the EPIC freeze/thaw script on a Linux host. ```bash # linux example parameters -t 0 -i prod -e epicadm ``` -------------------------------- ### Deploy and Register Cohesity Agent on Windows Servers Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/deployWindowsAgent/README.md This example demonstrates how to use the deployWindowsAgent.ps1 script to install the agent, register the server as a Cohesity protection source, register it as a SQL protection source, and configure a service account for the agent. It assumes a server list file is provided. ```powershell # example ."/deployWindowsAgent.ps1" -vip mycluster -username admin -domain local -serverList ".\sqlServers.txt" -installAgent -register -registerSQL -serviceAccount mydomain.net\myuser # end example ``` -------------------------------- ### Example Usage of backupNow Tool Source: https://github.com/bseltz-cohesity/scripts/blob/master/aix/backupNow/README.md This example demonstrates how to run the backupNow tool to initiate a backup job on a specified Cohesity cluster. ```bash # example ./backupNow -v mycluster -u myuser -d mydomain.net -j 'My Backup Job' -w # end example ``` -------------------------------- ### Run My Backup Status Script Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/myBackupStatus/README.md Example of how to execute the 'myBackupStatus.ps1' script with specified parameters. Ensure both script files are in the same folder. ```powershell # example ./myBackupStatus.py -vip mycluster \ -username myuser \ -domain mydomain.net \ -myName vm1 \ -wait # end example ``` -------------------------------- ### Install Python Prerequisites using easy_install Source: https://github.com/bseltz-cohesity/scripts/blob/master/reports/groot/python/grootDataPerObject/README.md Install the required Python modules, 'requests' and 'psycopg2-binary', using the easy_install tool. ```bash easy_install requests easy_install psycopg2-binary ``` -------------------------------- ### AIX Example Execution Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/epic_pure_snapper/README.md Example of how to run the epic_pure_snapper.sh script on an AIX host. This includes all parameters from the Linux example, plus the '-v' parameter for specifying volume groups. ```bash ./epic_pure_snapper.sh -t 0 -k /home/root/.ssh/id_rsa -p puresnap -a 10.1.1.39 -g EpicProtectionGroup26 -i prod -e epicadm -v EpicVolGroup1,EpicVolGroup2,EpicVolGroup3 ``` -------------------------------- ### Install Python Requests using Easy Install Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/generateAndUploadClusterCerts/README.md Install the 'requests' Python module using the easy_install tool. ```bash # or using easy_install sudo easy_install requests ``` -------------------------------- ### Example Command to Run chargebackReport.ps1 Source: https://github.com/bseltz-cohesity/scripts/blob/master/reports/powershell/chargebackReport/README.md This example demonstrates how to execute the chargebackReport.ps1 script with common parameters for generating and emailing a report. ```powershell # example command ./chargebackReport.ps1 -vip mycluster \ -username myusername \ -domain mydomain.net \ -prefix demo,test \ -costPerGB 0.10 \ -sendTo myuser@mydomain.net, anotheruser@mydomain.net \ -smtpServer 192.168.1.95 \ -sendFrom backupreport@mydomain.net # end example ``` -------------------------------- ### Script Execution Output Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/recoverFileScheduled/README.md This is an example of the output you can expect when the script runs, showing connection status, file download, and deletion of old versions. ```text Connected! myfile3 Downloading someFile to /Users/myusername/Downloads/myfile-2019-06-26-09-12-14... Deleting myfile-2019-06-10-09-06-08... Deleting myfile-2019-06-11-09-06-23... ``` -------------------------------- ### AIX Example Parameters Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/epic_pure_ppg_freeze_thaw/README.md Example parameters for running the EPIC freeze/thaw script on an AIX host, including volume groups. ```bash # AIX example parameters -t 0 -i prod -e epicadm -v aixvol1,aixvol2,aixvol3 ``` -------------------------------- ### Start VM Backup Source: https://github.com/bseltz-cohesity/scripts/blob/master/ccs/python/backupNowCcs/README.md Execute the backup script to start a backup of a virtual machine. The object name is specified using the -o flag. ```bash ./backupNowCcs.py -o myvm1 ``` -------------------------------- ### Start Backup of a VM Source: https://github.com/bseltz-cohesity/scripts/blob/master/ccs/powershell/backupNowCcs/README.md Execute the backup script with the region and object name to start a backup of a virtual machine. ```powershell ./backupNowCcs.ps1 -region us-east-2 -objectName myvm1 ``` -------------------------------- ### CRON Job for Starting Cluster Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/powerCycleAzure/README.md Schedule the Cohesity cluster to start automatically at a specific time using a CRON entry. This example starts the cluster at 5 PM daily. ```bash 0 17 * * * /home/myusername/scripts/azurece_control.sh start ``` -------------------------------- ### Download and Setup Scripts Source: https://github.com/bseltz-cohesity/scripts/blob/master/oracle/python/restoreOracleLogs/README.md Download the necessary Python scripts and make them executable. Place both files in the same directory before running. ```bash # download commands curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/oracle/python/restoreOracleLogs/restoreOracleLogs.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity.py chmod +x restoreOracleLogs.py # end download commands ``` -------------------------------- ### Deploy Cohesity Agent Source: https://github.com/bseltz-cohesity/scripts/blob/master/linux/deployLinuxAgent/README.md Example of how to run the deployLinuxAgent tool to install the Cohesity agent on a remote host. Ensure the agent installer file is available. ```bash ./deployLinuxAgent -s myhost1 -u myusername -f ./el-cohesity-agent-6.6.0d_u6-1.x86_64.rpm ``` -------------------------------- ### Run Example with API Key Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/runsExample/README.md Execute the script using an API key for authentication. ```bash # example ./runsExample.sh -v mycluster \ -k 1e62583e-4216-45fc-6377-d56e2c5c3776 # end example ``` -------------------------------- ### Run snowReportStrikes Script Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/snowReportStrikes/README.md Example of how to execute the main PowerShell script with necessary parameters. Ensure all required files are in the same folder. ```powershell # example ./snowReportStrikes.ps1 -vip helios.cohesity.com ` -username myuser ` -domain mydomain.net ` -snowUrl myaccount.service-now.com ` -snowUser mysnowuser ` -snowcreds mycred.xml -strikes 3 # end example ``` -------------------------------- ### Download and Prepare Scripts Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/oldSnapList/README.md Download the main script and the helper module, then make the main script executable. Place both files in the same directory. ```bash # download commands curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/oldSnapList/oldSnapList.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity/pyhesity.py chmod +x oldSnapList.py # end download commands ``` -------------------------------- ### Automate Cluster Start/Stop with CRON Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/powerCycleAWS/README.md Schedule the cluster start and stop commands using CRON entries. This example shows how to start the cluster at 5 PM and stop it at 5 AM daily. ```bash 0 17 * * * /home/myusername/scripts/awsce_control.sh start 0 5 * * * /home/myusername/scripts/awsce_control.sh stop ``` -------------------------------- ### Example: Create an SMB View Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/createSMBView/README.md Execute the createSMBView.py script with parameters to define the new SMB View. This example demonstrates setting various access controls and whitelisting IP addresses. ```bash ./createSMBView.py -v mycluster \ -u myusername \ -d mydomain.net \ -n newview1 \ -w mydomain.net\server1 \ -f mydomain.net\admingroup1 \ -f mydomain.net\admingroup2 \ -r mydomain.net\auditors \ -q 'TestAndDev High' \ -s mystoragedomain \ -a '192.168.1.10, myserver' \ -a 192.168.1.11 ``` -------------------------------- ### Example Inclusions List Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/protectLinux/README.md Populate a text file with the paths you want to include in the backup for the specified servers. ```text /home /var ``` -------------------------------- ### Execute Cluster Start Operation with PowerShell Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/startStopCluster/README.md Run the downloaded script to start the Cohesity cluster. This example demonstrates connecting to a cluster using VIP, username, and domain, and includes the '-start' and '-wait' parameters. ```powershell ./startStopCluster.ps1 -vip mycluster ` -username myusername ` -domain mydomain.net ` -start ` -wait ``` -------------------------------- ### Make a GET API Call to Cohesity Cluster Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/README.md After authentication, use the `api` function to make a GET request to the Cohesity cluster and print the name of the first protection job, including its example output. ```python print(api('get', 'protectionJobs')[0]['name']) VM Backup ``` -------------------------------- ### Download and Setup Scripts Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/refreshNASclone/README.md Use these bash commands to download the `refreshNASclone.py` and `pyhesity.py` scripts and make them executable. ```bash mkdir /home/cohesity/scripts cd /home/cohesity/scripts curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/refreshNASclone/refreshNASclone.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity.py chmod +x refreshNASclone.py ``` -------------------------------- ### Make API Call Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/basic_api/README.md Make a GET request to an API endpoint after authentication. This example retrieves node information. ```python nodes = bapi('get', '/scalemgmt/v2/nodes?fields=:all:') ``` -------------------------------- ### Run Example with Username/Password Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/runsExample/README.md Execute the script using username and password authentication for a local Cohesity user. ```bash # example ./runsExample.sh -v mycluster \ -u admin \ -p Sw0rdFish! # end example ``` -------------------------------- ### Example Output of Recovery Points Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/objectRecoveryPoints/README.md Displays the tabular output format for available recovery points, including job name, start time, expiry time, and days to expiration. ```text ObjectName JobName StartTime ExpiryTime DaysToExpiration myvm VM Backup 4/23/19 11:20:01 PM 4/28/19 11:20:45 PM 5 myvm VM Backup 4/22/19 11:20:00 PM 4/27/19 11:20:47 PM 4 myvm VM Backup 4/21/19 11:20:00 PM 4/26/19 11:20:45 PM 3 myvm VM Backup 4/20/19 11:20:01 PM 4/25/19 11:20:43 PM 2 myvm VM Backup 4/19/19 11:20:01 PM 4/24/19 11:20:47 PM 1 myvm VM Backup 4/18/19 11:20:00 PM 4/28/19 11:20:00 PM 5 myvm VM Backup 4/17/19 11:20:00 PM 4/27/19 11:20:00 PM 4 myvm VM Backup 4/16/19 11:20:01 PM 4/26/19 11:20:01 PM 3 myvm VM Backup 4/15/19 11:20:01 PM 4/25/19 11:20:01 PM 2 myvm VM Backup 4/14/19 11:20:00 PM 4/24/19 11:20:00 PM 1 ``` -------------------------------- ### Get Protection Jobs using API Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/README.md Retrieves a list of all protection jobs configured in Cohesity and displays them in a formatted table. This is a common starting point for managing backup jobs. ```powershell $jobs = api get protectionJobs $jobs | ft ``` -------------------------------- ### Cohesity Agent Deployment Output Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/deployWindowsAgent/README.md This is an example output log from the deployWindowsAgent.ps1 script, showing the progress of agent management on multiple servers, including installation, registration, and service account configuration. ```text Connected! Enter password for mydomain.net\myuser: ******** managing Cohesity Agent on sqlserver1.mydomain.net copying agent installer... installing Cohesity agent... Registering as Cohesity protection source... Setting CohesityAgent Service Logon Account... Registering as SQL protection source... managing Cohesity Agent on sqlserver2.mydomain.net copying agent installer... installing Cohesity agent... Registering as Cohesity protection source... Setting CohesityAgent Service Logon Account... Registering as SQL protection source... ``` -------------------------------- ### Authenticate Helios API Call with Curl Source: https://github.com/bseltz-cohesity/scripts/blob/master/doc/Helios-API-Key-Authentication.md Example of using curl to make a GET request to the Helios API, authenticated with an API Key. Ensure the 'apiKey' header is set correctly. ```bash curl -X GET "https://helios.cohesity.com/v2/mcm-cluster-config/clusters" \ -H "apiKey: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ -H "accept: application/json" ``` -------------------------------- ### Example: Create an S3 View with specified parameters Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/createS3View/README.md This example demonstrates how to execute the createS3View.ps1 script with various parameters. It includes setting the cluster details, view name, access control list (allowList), QoS policy, quota limits, storage domain, and optionally displaying access keys. ```powershell #example ./createS3View.ps1 -vip mycluster \ -username myusername \ -domain mydomain.net \ -viewName newview1 \ -allowList 192.168.1.0/24, 192.168.2.11/32 \ -qosPolicy 'TestAndDev High' \ -quotaLimitGB 20 \ -quotaAlertGB 18 \ -storageDomain mystoragedomain \ -showKeys #end example ``` -------------------------------- ### Execute CCS Source Refresh Script Source: https://github.com/bseltz-cohesity/scripts/blob/master/ccs/powershell/refreshSourceCcs/README.md Place both downloaded files ('refreshSourceCcs.ps1' and 'cohesity-api.ps1') in the same folder and execute the main script with the desired parameters. This example shows how to start a backup for a VM in a specific region. ```powershell ./refreshSourceCcs.ps1 -region us-east-2 -sourceName mysource.mydomain.net ``` -------------------------------- ### Example: Create an S3 View Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/createS3View/README.md Execute the `createS3View.py` script with the required parameters to create a new S3 View. This example demonstrates setting the cluster details, view name, QoS policy, storage domain, and allowed IP addresses. ```bash ./createS3View.py -v mycluster \ -u myusername \ -d mydomain.net \ -n newview1 \ -q 'TestAndDev High' \ -s mystoragedomain \ -a '192.168.1.10, myserver' \ -a 192.168.1.11 ``` -------------------------------- ### Example Server List Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/protectLinux/README.md Populate a text file with the hostnames of the servers you wish to protect. Ensure these servers are registered in Cohesity. ```text server1.mydomain.net server2.mydomain.net ``` -------------------------------- ### Download Onboarding Script and Dependencies Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/onboardADUser/README.md Download the main Python script and the Cohesity REST API helper module. Make the main script executable. ```bash # download commands curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/onboardADUser/onboardADUser.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity.py chmod +x onboardADUser.py # end download commands ``` -------------------------------- ### Install Requests Module using Easy Install (Linux/MacOS) Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/REQUIREMENTS.md Install or upgrade the 'requests' module using the easy_install utility. This is an alternative to pip. ```bash sudo easy_install -U requests ``` -------------------------------- ### Run SQL Job Selections Script Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/sql/powershell/sqlJobSelections/README.md Execute the downloaded script with the specified parameters to generate the report. Ensure all required files are in the same folder. ```powershell # example ./sqlJobSelections.ps1 -vip mycluster \ -username myuser \ -domain mydomain.net # end example ``` -------------------------------- ### Example Command Line for Deploying CVE Cluster Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/deployCVE/README.md This example demonstrates how to run the deployCVEcluster.py script with various parameters to deploy a CVE cluster. Ensure all required files are in the same folder before execution. ```bash ./deployCVEcluster.py -vc 10.2.143.29 \ -vu administrator@vsphere.local \ -vp myvcpassword \ -ds datastore1 \ -ds datastore2 \ -ds datastore3 \ -f ./cohesity-6.1.1d_release-20190507_1eef123c-8tb.ova \ -vh 10.2.137.37 \ -vh 10.2.137.37 \ -vh 10.2.137.37 \ --vmname BSeltz-CVE1 \ --vmname BSeltz-CVE2 \ --vmname BSeltz-CVE3 \ -ip 10.2.143.48 \ -ip 10.2.143.49 \ -ip 10.2.143.50 \ -v 10.2.143.51 \ -v 10.2.143.52 \ -v 10.2.143.53 \ -m 255.255.248.0 \ -g 10.2.136.1 \ -c BSeltz-CVE \ -ntp pool.ntp.org \ -dns 10.2.143.28 \ -e \ --fips \ -cd sa.corp.cohesity.com \ -k ABDC-EFGH-IJKL-MNOP \ --accept_eula ``` -------------------------------- ### Make a GET API Call Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/basic-api/README.md Execute a GET request to a specified API URI after authentication. The 'bapi' function supports GET, POST, PUT, and DELETE methods. ```powershell bapi get "/scalemgmt/v2/nodes?fields=:all:" ``` -------------------------------- ### Install prometheus_client Source: https://github.com/bseltz-cohesity/scripts/blob/master/reports/grafana/Prometheus/ClusterStats/README.md Install the necessary Python module for the Prometheus exporter. ```bash pip3 install prometheus_client ``` -------------------------------- ### Example Usage of unprotectSQLServer Script Source: https://github.com/bseltz-cohesity/scripts/blob/master/linux/unprotectSQLServer/README.md This example demonstrates how to run the script to unprotect SQL servers. It shows how to specify the Cohesity cluster, authentication details, and the servers to unprotect either directly or via a file. ```bash ./unprotectSQLServer -v mycluster \ -u myuser \ -d mydomain.net \ -s server1.mydomain.net \ -s server2.mydomain.net \ -l serverlist.txt ``` -------------------------------- ### Schedule Maintenance Start and End Times Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/maintenance/README.md Use this command to schedule the start and end times for maintenance mode. Provide the desired start and end timestamps in the specified format. ```powershell ./maintenance.ps1 -vip mycluster ` -username myusername ` -domain mydomain.net ` -sourceName mysource.mydomain.net ` -startTime '2025-02-14 17:00:00' ` -edTime '2025-02-15 06:00:00' ``` -------------------------------- ### Install pyVmomi Source: https://github.com/bseltz-cohesity/scripts/blob/master/vmware/python/powerOnVMs/README.md Install the required pyVmomi Python module using pip. ```bash python3 -m pip install pyVmomi ``` -------------------------------- ### Example Script Parameters for Multiple File Sets Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/gpfs_snapper/README.md Provides an example of script parameters for a Cohesity protection group backing up multiple GPFS file sets. Parameters should be a comma-separated list of file set paths without spaces. ```bash fs1/fileset1,fs2/fileset2 ``` -------------------------------- ### Start Cohesity Cloud Edition Cluster Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/powerCycleAzure/README.md Execute the `start` command to power on the Cohesity Cloud Edition cluster in Azure. The script will connect to Azure and Cohesity, then start all cluster services and instances. ```bash ./azurece_control.sh start ``` -------------------------------- ### Download and Prepare the Script Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/extendForCopyTasks/README.md Run these commands to download the necessary Python scripts and make the main script executable. ```bash # Begin download commands curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/extendForCopyTasks/extendForCopyTasks.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity.py chmod +x extendForCopyTasks.py # End download commands ``` -------------------------------- ### Install Requests Module (Linux/macOS) Source: https://github.com/bseltz-cohesity/scripts/blob/master/doc/python/Running These Python Scripts.md Install the 'requests' module using pip for Linux and macOS systems. Ensure you use the correct pip version (pip or pip3) corresponding to your Python installation. ```bash sudo pip install requests # or sudo pip3 install requests # or python -m pip install requests # or python3 -m pip install requests ``` ```bash sudo easy_install -U requests ``` -------------------------------- ### Install influxdb_client Python Module Source: https://github.com/bseltz-cohesity/scripts/blob/master/reports/grafana/InfluxDB/ClusterStats/README.md Command to install the necessary Python module for interacting with InfluxDB. ```bash pip3 install influxdb_client ``` -------------------------------- ### Execute cloneVM Script with Parameters Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/cloneVM/README.md This example demonstrates how to run the downloaded cloneVM.ps1 script with various parameters to clone a VM. It includes connection details, VM identification, and vSphere resource specifications. ```powershell ./cloneVM.ps1 -vip mycluster ` -username myusername ` -domain mydomain.net ` -vmName myvm ` -vCenterName myvcenter.mydomain.net ` -datacenterName mydatacenter ` -computeResource vSphereCluster1 ` -folderName myFolder ` -networkName 'VM Network' ` -poweron ` -prefix clone- ``` -------------------------------- ### Download and Prepare Scripts Source: https://github.com/bseltz-cohesity/scripts/blob/master/remoteAdapter/vm_freeze_thaw/README.md Download the necessary scripts and make them executable. Ensure these are placed on the application host. ```bash # Begin download commands curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/remoteAdapter/vm_freeze_thaw/vm_freeze_thaw.sh curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/jobRunning/jobRunning.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/backupNow/backupNow.py curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/python/pyhesity/pyhesity.py chmod +x vm_freeze_thaw.sh chmod +x jobRunning.py chmod +x backupNow.py # End download commands ``` -------------------------------- ### Install Requests Module (Linux Package Manager) Source: https://github.com/bseltz-cohesity/scripts/blob/master/doc/python/Running These Python Scripts.md Install the 'requests' module using system package managers like yum or apt-get on Linux. This method is suitable for systems where direct pip installation might be restricted. ```bash # yum (RHEL/CentOS) sudo yum install python-requests sudo yum install python3-requests # dnf (Fedora/RHEL 8+) sudo dnf install python-requests sudo dnf install python3-requests # apt-get (Ubuntu/Debian) sudo apt-get install python-requests sudo apt-get install python3-requests ``` -------------------------------- ### Run Drivers Installation Test Script Source: https://github.com/bseltz-cohesity/scripts/blob/master/ccs/siteContinuity/check_failover_eligibility/README.md Execute the Cohesity drivers installation test script on a Linux VM. Ensure the script is run with sudo privileges. The script will attempt to install necessary drivers for VM failover. ```bash sudo ./drivers_installation_test.sh ``` -------------------------------- ### Execute createSMBView Script Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/createSMBView/README.md This example demonstrates how to run the createSMBView.ps1 script with various parameters to create a new SMB view. Ensure both script files are in the same directory. ```powershell #example ./createSMBView.ps1 -vip mycluster \ -username myusername \ -domain mydomain.net \ -viewName newview1 \ -readWrite mydomain.net\server1 \ -fullControl mydomain.net\admingroup1, mydomain.net\admingroup2 \ -qosPolicy 'TestAndDev High' \ -quotaLimitGB 20 \ -quotaAlertGB 18 \ -storageDomain mystoragedomain #end example ``` -------------------------------- ### Start SQL Server Backup (All Databases) Source: https://github.com/bseltz-cohesity/scripts/blob/master/ccs/python/backupNowCcs/README.md Initiate a backup of all databases on a specified SQL Server. The source name is provided using the -s flag. ```bash ./backupNowCcs.py -s sqlserver1.mydomain.net ``` -------------------------------- ### Install boto3 Source: https://github.com/bseltz-cohesity/scripts/blob/master/s3/python/README.md Install the boto3 Python module using pip. This is a required dependency for the S3 scripts. ```bash python3 -m pip install boto3 ``` -------------------------------- ### Example Usage of refreshSource Source: https://github.com/bseltz-cohesity/scripts/blob/master/linux/refreshSource/README.md This example demonstrates how to run the `refreshSource` tool to refresh a specific protection source, providing cluster, user, domain, and source name details. ```bash ./refreshSource -v mycluster \ -u myuser \ -d mydomain.net \ -n myserver1.mydomain.net ``` -------------------------------- ### Install Python Requests Module Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/archiveEndOfMonth/README.md Install the required 'requests' Python module using yum or easy_install. ```bash sudo yum install python-requests ``` ```bash sudo easy_install requests ``` -------------------------------- ### Install ServiceNow PowerShell Module Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/snowReportStrikes/README.md Install the required ServiceNow PowerShell module. Run this command in PowerShell. ```powershell Install-Module servicenow ``` -------------------------------- ### Run Schedule Healer Script Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/scheduleHealer/README.md Example of how to execute the scheduleHealer.py script with cluster connection details. ```bash #example ./scheduleHealer.py -v mycluster \ -u myusername \ -d mydomain.net #end example ``` -------------------------------- ### Run Script - Basic Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/reports/python/recoveryPoints/README.md Execute the recoveryPoints.py script with cluster, username, and domain parameters. ```bash # example ./recoveryPoints.py -v mycluster -u myusername -d mydomain.net # end example ``` -------------------------------- ### Restore Files Output Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/restoreFiles/README.md This is an example of the expected output when the restoreFiles script successfully completes its operation. ```text Connected! Restoring Files... Restore finished with status Success ``` -------------------------------- ### Example Usage of smbPermissions.ps1 Source: https://github.com/bseltz-cohesity/scripts/blob/master/powershell/smbPermissions/README.md This example demonstrates how to run the smbPermissions.ps1 script to set various permissions on a share, including read/write access for a user and full control for admin groups, while also removing 'everyone' permissions. ```powershell #example ./smbPermissions.ps1 -vip mycluster \ -username myusername \ -domain mydomain.net \ -shareName myshare \ -readWrite mydomain.net\user1 \ -fullControl mydomain.net\admingroup1, mydomain.net\admingroup2 \ -remove everyone #end example ``` -------------------------------- ### Run gflagList.py Script Example Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/gflagList/README.md Execute the downloaded script with the required parameters to list gFlags for a specified service on a Cohesity cluster. ```bash # example ./gflagList.py -v mycluster \ -u myuser \ -d mydomain.net \ -s iris # end example ``` -------------------------------- ### Start AWS Cloud Edition Cohesity Cluster Source: https://github.com/bseltz-cohesity/scripts/blob/master/python/powerCycleAWS/README.md Execute the 'start' command to power on the AWS Cloud Edition Cohesity cluster. The script will initiate the EC2 instances and then start all cluster services, waiting for the cluster to become fully available. ```bash ./awsce_control.sh start ``` -------------------------------- ### Download and Make Executable Remote Adapter Script Source: https://github.com/bseltz-cohesity/scripts/blob/master/remoteAdapter/remoteAdapterExample/README.md Download the remote adapter example script from GitHub and make it executable on your host. ```bash # Begin download commands curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/remoteAdapter/remoteAdapterExample/remoteAdapterExample.sh chmod +x remoteAdapterExample.sh # End download commands ``` -------------------------------- ### Download and Make Executable Source: https://github.com/bseltz-cohesity/scripts/blob/master/bash/backupNow/README.md Download the backupNow.sh script from the repository and make it executable. Ensure you have curl installed. ```bash curl -O https://raw.githubusercontent.com/cohesity/community-automation-samples/main/bash/backupNow/backupNow.sh chmod +x backupNow.sh ```