Skip to main content

Hi,

 

Note
● The RestAPI documentation starts from here:
https://docs.datacore.com/RESTSupport-WebHelp/RESTSupport-WebHelp/Welcom
e.htm
● Two headers should be passed in every request:
https://docs.datacore.com/RESTSupport-WebHelp/RESTSupport-WebHelp/Sending
_Requests.htm
○ ServerHost: full computer name or IP address
○ Authorization: Basic UsernamePassword
● URL Structure Request Examples:
https://docs.datacore.com/RESTSupport-WebHelp/RESTSupport-WebHelp/URL_St
ructure_Request_Examples.htm
● Full documentation:
https://docs.datacore.com/RESTSupport-WebHelp/RESTSupport-WebHelp/RESTRe
ferenceGuide.html
Our primary request is to monitor “BytesAllocatedPercentage” of a “Disk Pool”
To monitor it we have to make two step:
● Manually found the ID of the pool we are interested - function “Get Pools”
https://docs.datacore.com/RESTSupport-WebHelp/RESTSupport-WebHelp/RESTRe
ferenceGuide.html#OperationDetails_ID0EAZBI
● Monitor the Performance - function “Get Performance”
https://docs.datacore.com/RESTSupport-WebHelp/RESTSupport-WebHelp/RESTRe
ferenceGuide.html#OperationDetails_ID0ELQBI


Manually found the ID the the pollers we are interested
-bash-4.2$ curl -k -u <username>:<password> -H
"ServerHost:<hostaddress>"
https://<hostaddress>/RestService/rest.svc/1.0/pools?server=<hostn
ame> | python -m json.tool
% Total % Received % Xferd Average Speed Time Time
Time Current
Dload Upload Total Spent
Left Speed
100 641 100 641 0 0 4700 0 --:--:-- --:--:--
--:--:-- 4713
-
{
"Alias": "DAT1_Disk_pool_1",
"AutoTieringEnabled": true,
"Caption": "DAT1_Disk_pool_1",
"ChunkSize": {
"Value": 134217728
},
"DeduplicationState": 0,
"Description": null,
"ExtendedCaption": "DAT1_Disk_pool_1 on <hostname>",
"HasEncryption": false,
"Id":
"0C0EB462-D423-41FC-8521-5FAF72FD811A:{0b8bdf98-85fa-11ed-af64-30e
17151f46f}",
"InSharedMode": false,
"Internal": false,
"IsAuthorized": true,
"MaxTierNumber": 3,
"PoolMode": 1,
"PoolStatus": 0,
"PresenceStatus": 1,
"SMPAApproved": false,
"SectorSize": {
"Value": 512
},
"SequenceNumber": 413855939,
"ServerId": "0C0EB462-D423-41FC-8521-5FAF72FD811A",
"SharedPoolId": null,
"SupportsEncryption": true,
"TierReservedPct": 3,
"Type": 0
}
]
Monitor the performance of a poll with a custom Centreon command
Normal command
-bash-4.2$ /usr/lib/centreon/plugins//centreon_protocol_http.pl
--plugin=apps::protocols::http::plugin --mode=json-content
--hostname=<hostaddress> --proto='https' --port='443'
--credentials --username='<user>' --password='<password>' --basic
--urlpath='/RestService/rest.svc/1.0/performance/0C0EB462-D423-41F
C-8521-5FAF72FD811A:{0b8bdf98-85fa-11ed-af64-30e17151f46f}'
--header='Content-Type: application/json' --header='ServerHost:
<hostname>' --lookup='$r0].BytesAllocatedPercentage'
--threshold-value='values' --format-ok='BytesAllocatedPercentage
are ok' --format-warning='BytesAllocatedPercentage are %{values}%'
--format-critical='BytesAllocatedPercentage are %{values}%'
--warning-numeric='35' --critical-numeric='50' --warning-string=''
--critical-string='' --insecure
OK: BytesAllocatedPercentage are ok | 'count'=1;;;0;
'element_1'=29;0:35;0:50;; 'time'=0.067s;;;0;
Debug output
======> request send
GET
https://<hostaddress>:443/RestService/rest.svc/1.0/performance/0C0
EB462-D423-41FC-8521-5FAF72FD811A:%7B0b8bdf98-85fa-11ed-af64-30e17
151f46f%7D
Authorization: Basic ****
User-Agent: centreon::plugins::backend::http::useragent
Content-Type: application/json
ServerHost: <hostname>
======> response done
HTTP/1.1 200 OK
Cache-Control: private
Date: Fri, 26 May 2023 08:47:19 GMT
Server: Microsoft-IIS/10.0
Content-Length: 793
Content-Type: application/json
Access-Control-Allow-Headers: Content-Type, Accept, ServerHost,
Authorization
Access-Control-Allow-Methods: OPTIONS, GET, PUT, POST, DELETE
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 1728000
Client-Date: Fri, 26 May 2023 08:47:20 GMT
Client-Peer: <hostadress>:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /CN=DataCoreSelfSignedCert
Client-SSL-Cert-Subject: /CN=DataCoreSelfSignedCert
Client-SSL-Cipher: ECDHE-RSA-AES256-GCM-SHA384
Client-SSL-Socket-Class: IO::Socket::SSL
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
<{"CollectionTime":"\/Date(-62135596800000)\/","NullCounterMap":0,
"TotalBytesTransferred":0,"TotalBytesRead":0,"TotalBytesWritten":0
,"TotalBytesMigrated":0,"TotalReads":0,"TotalWrites":0,"TotalOpera
tions":0,"BytesAllocated":0,"BytesAvailable":0,"BytesInReclamation
":0,"BytesTotal":0,"PercentAllocated":0,"PercentAvailable":0,"Tota
lReadTime":0,"TotalWriteTime":0,"MaxReadTime":0,"MaxWriteTime":0,"
MaxReadWriteTime":0,"MaxPoolBytes":0,"BytesReserved":0,"BytesAlloc
atedPercentage":0,"BytesReservedPercentage":0,"BytesInReclamationP
ercentage":0,"BytesAvailablePercentage":0,"BytesOverSubscribed":0,
"EstimatedDepletionTime":0,"DeduplicationPoolPercentFreeSpace":0,"
ExpectedDeduplicationPoolUsedSpace":0,"DeduplicationPoolUsedSpace"
:0,"DeduplicationPoolFreeSpace":0,"DeduplicationPoolTotalSpace":0}
]
o{"CollectionTime":"\/Date(-62135596800000)\/","NullCounterMap":0,
"TotalBytesTransferred":0,"TotalBytesRead":0,"TotalBytesWritten":0
,"TotalBytesMigrated":0,"TotalReads":0,"TotalWrites":0,"TotalOpera
tions":0,"BytesAllocated":0,"BytesAvailable":0,"BytesInReclamation
":0,"BytesTotal":0,"PercentAllocated":0,"PercentAvailable":0,"Tota
lReadTime":0,"TotalWriteTime":0,"MaxReadTime":0,"MaxWriteTime":0,"
MaxReadWriteTime":0,"MaxPoolBytes":0,"BytesReserved":0,"BytesAlloc
atedPercentage":0,"BytesReservedPercentage":0,"BytesInReclamationP
ercentage":0,"BytesAvailablePercentage":0,"BytesOverSubscribed":0,
"EstimatedDepletionTime":0,"DeduplicationPoolPercentFreeSpace":0,"
ExpectedDeduplicationPoolUsedSpace":0,"DeduplicationPoolUsedSpace"
:0,"DeduplicationPoolFreeSpace":0,"DeduplicationPoolTotalSpace":0}
]
Lookup XPath $c0].BytesAllocatedPercentage:
Node value: 0
Response time 0.061s

NewDiscussion ongoing

Discussion ongoingNeeds Votes

Needs VotesIn Backlog

In BacklogPlanned

Hi @dbergo,

Thank you for your idea and for the data you provided.

We shall work on this idea soon.


PlannedReleased