Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions couchdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ https://support.site24x7.com/portal/en/kb/articles/run-python-plugin-scripts-in-
| bulk_requests | Number of bulk document write requests received |
| temporary_view_reads | Number of temporary (ad-hoc) view reads |
| clients_requesting_changes | Number of clients currently requesting change feeds |
| lru_skips | Number of times the Least Recently Used (LRU) cache was skipped due to full capacity |
| emits | Number of key-value pairs emitted during map function execution |
| vdu_rejects | Number of document updates rejected by the validate_doc_update function |
| view_timeouts | Number of view requests that timed out |
| map_doc | Number of documents processed by map functions |

## Performance
| **Metric Name** | **Description** |
|------------------|------------------|
Expand Down
4 changes: 2 additions & 2 deletions couchdb/couchdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
'view_reads',
'bulk_requests',
'temporary_view_reads',
'clients_requesting_changes'
'clients_requesting_changes','lru_skips','vdu_rejects','map_doc','emits','view_timeouts'
]
},
"Performance": {
Expand Down Expand Up @@ -222,7 +222,7 @@ def collect_couchdb(host, port, user, password):
# -------- HTTP Other Metrics --------
httpd = stats.get('httpd')
if httpd:
for key in ['view_reads','bulk_requests','temporary_view_reads','clients_requesting_changes']:
for key in ['view_reads','bulk_requests','temporary_view_reads','clients_requesting_changes','lru_skips','vdu_rejects','map_doc','emits','view_timeouts']:
if key in httpd:
data[key] = httpd[key].get('value', 0)
else:
Expand Down
96 changes: 91 additions & 5 deletions couchserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,41 @@ Learn more https://www.site24x7.com/plugins/couchbase-monitoring.html
- Download and install the latest version of the [Site24x7 agent](https://www.site24x7.com/app/client#/admin/inventory/add-monitor) in the server where you plan to run the plugin.
- Download and install Python version 3 or higher.

## Create a new user and grant read-only access permission

```bash
curl -u USERNAME:PASSWORD -X PUT \
http://localhost:8091/settings/rbac/users/local/your_username \
-d 'password=your_password&roles=cluster_admin,data_reader[*],query_select[*]'
```
## Verify the new user

Run the following command to check that the user was created successfully:

```bash
curl -u USERNAME:PASSWORD http://localhost:8091/settings/rbac/users/local/your_username
```

### Plugin Installation

- Create a directory named "couchserver"

- Download the below files and place it under the "couchserver" directory.

wget https://raw.githubusercontent.com/site24x7/plugins/master/couchserver/couchserver.py

wget https://raw.githubusercontent.com/site24x7/plugins/master/couchserver/couchserver.py && sed -i "1s|^.*|#! $(which python3)|" couchserver.py
wget https://raw.githubusercontent.com/site24x7/plugins/master/couchserver/couchserver.cfg

- Edit the couchserver.py file with appropriate arguments and Execute the below command to check for the valid JSON output:

python couchserver.py
python3 couchserver.py --host 127.0.0.1 --port 8091 --user your_username --password your_password

#### Linux

- Follow the steps in [this article](https://support.site24x7.com/portal/en/kb/articles/updating-python-path-in-a-plugin-script-for-linux-servers) to update the Python path in the couchserver.py script.

- Place the "couchserver" folder under Site24x7 Linux Agent plugin directory :

Linux -> /opt/site24x7/monagent/plugins/couchserver
Linux -> /opt/site24x7/monagent/plugins

#### Windows

Expand All @@ -41,4 +56,75 @@ https://support.site24x7.com/portal/en/kb/articles/run-python-plugin-scripts-in-

- Move the folder "couchserver" under Site24x7 Windows Agent plugin directory:

Windows -> C:\Program Files (x86)\Site24x7\WinAgent\monitoring\Plugins\couchserver
Windows -> C:\Program Files (x86)\Site24x7\WinAgent\monitoring\Plugins


## Metrics Captured

| Metric Name | Description |
|-----------------------|-----------------------------------------------------------------------------|
| Bucket Items | Total number of documents/items in a bucket. |
| Cmd Get | Number of key-value GET operations performed per second. |
| Curr Items | Current number of active items in memory for the node. |
| Ops Queued | Number of operations currently queued and waiting to be processed. |
| Quota Total HDD | Total disk space quota allocated for Couchbase data. |
| Quota Total Ram Node | Total RAM quota assigned per node. |
| Quota Used Ram | Amount of RAM currently used by all buckets. |
| Quota Used Ram Node | RAM used by buckets on a specific node. |
| Total Bucket Items | Total items across all buckets in the cluster. |
| Total HDD | Total physical disk space available for Couchbase data. |
| Total Ram | Total physical RAM available on the cluster nodes. |
| Used HDD | Amount of disk space currently used by Couchbase data. |
| Used Ram | Amount of RAM currently used across the cluster. |
| Used by Data HDD | Percentage of disk space used specifically by bucket data (excluding indexes and metadata). |

## Bucket

| Metric Name | Description |
|-------------------|-----------------------------------------------------------------------------|
| Bucket Ops | Number of operations (reads, writes, deletes) per second on the bucket. |
| Get Hits | Number of successful GET operations (cache hits) per second. |
| Get Misses | Number of GET operations that did not find the document in memory. |
| Hit Ratio | Percentage of GET operations served from memory cache. |
| Evictions | Number of items removed from memory to free space for new data. |
| Cache Miss Rate | Percentage of GET operations that missed the cache. |
| Create Ops | Number of document creation operations per second. |
| Update Ops | Number of document update operations per second. |
| Bg Fetches | Number of background fetches from disk to memory per second. |
| Data Disk Size | Disk space used by the bucket's data (in MB). |
| Actual Disk Size | Total disk space used by the bucket, including metadata and overhead (in MB).|
| Doc Fragmentation | Percentage of fragmentation in the bucket data files. |
| Write Queue | Number of write operations waiting in the queue to be processed. |
| Bucket Mem Used | Amount of RAM used by this bucket (in MB). |

## Memory

| Metric Name | Description |
|--------------------------------------|-----------------------------------------------------------------------------|
| Mem High Water | Maximum memory used by the node before triggering memory management actions.|
| Mem Low Water | Minimum memory threshold before the node can reclaim memory. |
| Mem Overhead | Memory used internally by Couchbase for metadata and system operations (in MB). |
| Key Value Size | RAM used by key-value data on the node (in MB). |
| Node Cmd Get | Number of GET commands received by the node per second. |
| Node Get Hits | Number of successful GET operations (cache hits) at the node level. |
| Node Items | Number of active items in the node's memory. |
| Node Items Total | Total items including replicas on the node. |
| Node Bg Fetches | Number of background fetches from disk to memory on the node per second. |
| Node Mem Used | RAM used by the node for key-value storage (in MB). |
| Mem Actual Used | Actual RAM used by the node including overhead and active data (in MB). |
| Mem Actual Free | Actual free RAM available on the node (in MB). |
| Page Faults | Number of memory page faults encountered by the node. |
| Virtual Bucket Active Resident Items Ratio | Percentage of active items currently in memory (resident in RAM). |

## Query

| Metric Name | Description |
|-----------------------|-----------------------------------------------------------------------------|
| Query Elapsed Time | Total time taken to process the query, including network and planning (in ms). |
| Query Execution Time | Time taken by the query engine to actually execute the query (in ms). |
| Query Result Count | Number of rows/documents returned by the query. |
| Query Result Size | Size of the query result set (in bytes). |
| Query Service Load | Load on the query service, indicating how busy the query engine is. |

## Sample Image :
<img width="1652" height="756" alt="image" src="https://github.com/user-attachments/assets/f160f86b-037d-4a96-963d-c7170d22bad4" />
5 changes: 5 additions & 0 deletions couchserver/couchserver.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[couchbase_config]
host = "localhost"
port = "8091"
user = "USERNAME"
password = "PASSWORD"
Loading