Instance action script with CCC
Prerequisites
Before using the instance action script, ensure that you have completed the steps outlined in Setting up a CCC node
Overview
The `instance_action.script` allows you to perform direct actions such as connecting or disconnecting a registered database instance in dbWatch Control Center.
This is equivalent to right-clicking on an instance in the GUI and choosing “Connect” or “Disconnect”.
Supported Actions
The script supports the following actions:
connect
– Connect a registered, currently disconnected instancedisconnect
– Disconnect a currently connected instance
Parameters
Parameter | Description | Required | Example |
---|---|---|---|
accesspoint | Server IP and port | Optional (default: localhost:7100) | 192.168.1.10:7100 |
domainName | Domain to join | Optional (used if multiple domains) | acme.dbwatch.com |
instanceName | The name of the instance to target | Required | mydb01 |
action | Action to execute: connect or disconnect | Required | connect |
Syntax Example – Connect Instance
ccc.sh instance_action.script action=connect instanceName='mydb01'
This will attempt to connect the instance named mydb01
.
Syntax Example – Disconnect Instance
ccc.sh instance_action.script action=disconnect instanceName='mydb01'
This will disconnect the instance named mydb01
from monitoring.
Advanced Example
You can specify all parameters including domain and server:
ccc.sh instance_action.script action=connect instanceName='mydb01' domainName='acme.dbwatch.com' accesspoint='192.168.3.10:7100'
This will connect mydb01
in the acme.dbwatch.com
domain using the specified server node.
Behind the Scenes
The script executes the following steps:
- Joins the domain using the provided access point and optional token
- Searches for the instance using an FDL-style query
- Issues the action request (connect or disconnect) to the matched node