Skip to content

Commit 038e3a7

Browse files
Added Hitachi storage inventory
1 parent c04143c commit 038e3a7

File tree

4 files changed

+104
-4
lines changed

4 files changed

+104
-4
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ These inventory options are enabled via the multi-select in the input configurat
8888
| Hyperflex | [hyperflex/Clusters][5] | cisco:intersight:hyperflexClusters |
8989
| Hyperflex | [hyperflex/Nodes][8] | cisco:intersight:hyperflexNodes |
9090
| Hyperflex | [hyperflex/StorageContainers][16] | cisco:intersight:hyperflexStorageContainers |
91+
| Hitachi | [storage/HitachiArrays][19] | cisco:intersight:storageHitachiClusters |
92+
| Hitachi | [storage/HitachiControllers][20] | cisco:intersight:storageHitachiControllers |
93+
| Hitachi | [storage/HitachiVolumes][21] | cisco:intersight:storageHitachiVolumes |
9194
| NetApp | [storage/NetAppClusters][11] | cisco:intersight:storageNetAppClusters |
9295
| NetApp | [storage/NetAppNodes][12] | cisco:intersight:storageNetAppNodes |
9396
| NetApp | [storage/NetAppVolumes][17] | cisco:intersight:storageNetAppVolumes |
@@ -116,6 +119,9 @@ These inventory options are enabled via the multi-select in the input configurat
116119
[16]: https://intersight.com/apidocs/apirefs/api/v1/hyperflex/StorageContainers/model/
117120
[17]: https://intersight.com/apidocs/apirefs/api/v1/storage/NetAppVolumes/model/
118121
[18]: https://intersight.com/apidocs/apirefs/api/v1/storage/PureVolumes/model/
122+
[19]: https://intersight.com/apidocs/apirefs/api/v1/storage/HitachiArrays/model/
123+
[20]: https://intersight.com/apidocs/apirefs/api/v1/storage/HitachiControllers/model/
124+
[21]: https://intersight.com/apidocs/apirefs/api/v1/storage/HitachiVolumes/model/
119125

120126
All of the data from this Add-on can be queried in Splunk using the following [SPL](https://docs.splunk.com/Splexicon:SPL):
121127

@@ -152,7 +158,10 @@ One for each sourcetype...
152158
| cisco:intersight:assetDeviceContractInformations | `index=* sourcetype=cisco:intersight:assetDeviceContractInformations StateContract=OK \| dedup Moid \| table source, DeviceType, PlatformType, DeviceId, ContractStatus, ServiceLevel, ServiceEndDate, WarrantyEndDate` |
153159
| cisco:intersight:hyperflexClusters | `index=* sourcetype=cisco:intersight:hyperflexClusters \| dedup Moid \| rename Summary.ResiliencyInfo.State as State \| rename RegisteredDevice.ConnectionStatus as ConnectionStatus \| rename Encryption.State as SoftwareEncryption \| eval SoftwareEncryption=case(isnull(SoftwareEncryption), "NONE", 1=1, replace(SoftwareEncryption, "_", " ")) \| Table source, Name, ConnectionStatus, State, HypervisorType, DeploymentType, DriveType, HxVersion, SoftwareEncryption, UtilizationPercentage` |
154160
| cisco:intersight:hyperflexNodes | `index=* sourcetype=cisco:intersight:hyperflexNodes \| dedup Moid \| rename "Drives{}.Usage" as DriveUsage \| rename "EmptySlotsList{}" as EmptySlots \| eval PersistenceDiskCount=mvcount(mvfilter(match(DriveUsage, "PERSISTENCE"))) \| eval OpenDiskSlots=mvcount(EmptySlots) \| table source, HostName, ModelNumber, SerialNumber, Role, Hypervisor, Status, PersistenceDiskCount, OpenDiskSlots` |
155-
| cisco:intersight:hyperflexStorageContainers | `index=* sourcetype=cisco:intersight:hyperflexStorageContainers \| dedup Moid \| table Cluster.Moid, Name, Type, InUse, EncryptionEnabled, MountStatus, MountSummary, VolumeCount`
161+
| cisco:intersight:hyperflexStorageContainers | `index=* sourcetype=cisco:intersight:hyperflexStorageContainers \| dedup Moid \| table Cluster.Moid, Name, Type, InUse, EncryptionEnabled, MountStatus, MountSummary, VolumeCount` |
162+
| cisco: intersight:storageHitachiArrays | `index=* sourcetype=cisco:intersight:storageHitachiArrays \| dedup Moid \| table Name, Model, Serial, TargetCtl, Ctl1MicroVersion, Ctl2MicroVersion, StorageUtilization.CapacityUtilization` |
163+
| cisco: intersight:storageHitachiControllers | `index=* sourcetype=cisco:intersight:storageHitachiControllers \| dedup Moid \| table Array.Moid, Name, Status` |
164+
| cisco: intersight:storageHitachiVolumes | `index=* sourcetype=cisco:intersight:storageHitachiVolumes \| dedup Moid \| eval SizeTB = round(Size/1024/1024/1024/1024, 2) \| table Name, RaidLevel, RaidType, SizeTB` |
156165
| cisco:intersight:storageNetAppClusters | `index=* sourcetype=cisco:intersight:storageNetAppClusters \| dedup Moid \| rename RegisteredDevice.ConnectionStatus as ConnectionStatus \| eval StorageUtilization.Total=round('StorageUtilization.Total'/1024/1024/1024/1024, 1) \| eval StorageUtilization.Used=round('StorageUtilization.Used'/1024/1024/1024/1024, 1) \| table source, Name, ConnectionStatus, Model, Version, ClusterHealthStatus, StorageUtilization.Used, StorageUtilization.Total, StorageUtilization.CapacityUtilization, ClusterEfficiency.Ratio` |
157166
| cisco:intersight:storageNetAppNodes | `index=* sourcetype=cisco:intersight:storageNetAppNodes \| dedup Moid \| table source, Name, Model, Version, AvgPerformanceMetrics.*` |
158167
| cisco:intersight:storageNetAppVolumes | `index=* sourcetype=cisco:intersight:storageNetAppVolumes \| dedup Moid \| table Array.Moid, Name, State, Type, StorageUtilization.CapacityUtilization, AvgPerformanceMetrics.Latency`

input_module_intersight.py

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,8 @@ def write_splunk(index, source, sourcetype, data):
739739
RESPONSE = r_intersight(
740740
f"{endpoint}?$top={results_per_page}&$skip={str(i)}")
741741
for data in RESPONSE.json()['Results']:
742-
data = pop(['Ancestors', 'DomainGroupMoid', 'ClassId', 'Owners', 'Parent', 'ObjectType', 'PermissionResources', 'SharedScope', 'NaaId', 'RegisteredDevice'], data)
742+
data = pop(['Ancestors', 'DomainGroupMoid', 'ClassId', 'Owners', 'Parent', 'ObjectType',
743+
'PermissionResources', 'SharedScope', 'NaaId', 'RegisteredDevice'], data)
743744
for x in ['Array', 'StorageUtilization']:
744745
data[x] = pop(['ClassId', 'ObjectType'], data[x])
745746
data['Array'] = pop(['link'], data['Array'])
@@ -750,6 +751,85 @@ def write_splunk(index, source, sourcetype, data):
750751
helper.log_debug(
751752
f"{s} | Pure was not selected in the Inventory configuration")
752753

754+
##
755+
# Hitachi Inventory
756+
##
757+
758+
# Hitachi Arrays
759+
endpoint = "storage/HitachiArrays"
760+
if 'hitachi' in opt_inventory and doInventory:
761+
helper.log_debug(f"{s} | Retrieving Hitachi Array Inventory Records")
762+
doHitachiArrays = check_intersight(endpoint)
763+
764+
if 'hitachi' in opt_inventory and doInventory and doHitachiArrays:
765+
RESPONSE = r_intersight(f"{endpoint}?$count=True")
766+
count = RESPONSE.json()['Count']
767+
helper.log_info(
768+
f"{s} | Found {str(count)} Hitachi Array records to retrieve")
769+
results_per_page = 10 # adjust the number of results we pull per API call
770+
for i in range(0, count, results_per_page):
771+
RESPONSE = r_intersight(
772+
f"{endpoint}?$expand=RegisteredDevice($select=ClaimedByUserName,ClaimedTime,ConnectionStatusLastChangeTime,ConnectionStatus,CreateTime,ReadOnly)&$top={results_per_page}&$skip={str(i)}")
773+
for data in RESPONSE.json()['Results']:
774+
data = pop(['Ancestors', 'DomainGroupMoid', 'ClassId', 'DeviceMoId', 'Owners',
775+
'ObjectType', 'PermissionResources', 'SharedScope', 'Uuid'], data)
776+
for x in ['RegisteredDevice', 'StorageUtilization']:
777+
data[x] = pop(['ClassId', 'ObjectType'], data[x])
778+
write_splunk(index, account_name,
779+
'cisco:intersight:storageHitachiArrays', data)
780+
781+
# Hitachi Controllers
782+
endpoint = "storage/HitachiControllers"
783+
if 'hitachi' in opt_inventory and doInventory:
784+
helper.log_debug(
785+
f"{s} | Retrieving Hitachi Controller Inventory Records")
786+
doHitachiControllers = check_intersight(endpoint)
787+
788+
if 'hitachi' in opt_inventory and doInventory and doHitachiControllers:
789+
RESPONSE = r_intersight(f"{endpoint}?$count=True")
790+
count = RESPONSE.json()['Count']
791+
helper.log_info(
792+
f"{s} | Found {str(count)} Hitachi controller records to retrieve")
793+
results_per_page = 10 # adjust the number of results we pull per API call
794+
for i in range(0, count, results_per_page):
795+
RESPONSE = r_intersight(
796+
f"{endpoint}?$top={results_per_page}&$skip={str(i)}")
797+
for data in RESPONSE.json()['Results']:
798+
data = pop(['Ancestors', 'DomainGroupMoid', 'ClassId', 'DeviceMoId', 'Owners',
799+
'Parent', 'ObjectType', 'PermissionResources', 'SharedScope', 'RegisteredDevice'], data)
800+
data['Array'] = pop(['ClassId', 'ObjectType', 'link'], data['Array'])
801+
write_splunk(index, account_name,
802+
'cisco:intersight:storageHitachiControllers', data)
803+
804+
# Hitachi Volumes
805+
endpoint = "storage/HitachiVolumes"
806+
if 'hitachi' in opt_inventory and doInventory:
807+
helper.log_debug(
808+
f"{s} | Retrieving Hitachi Controller Inventory Records")
809+
doHitachiVolumes = check_intersight(endpoint)
810+
811+
if 'hitachi' in opt_inventory and doInventory and doHitachiVolumes:
812+
RESPONSE = r_intersight(f"{endpoint}?$count=True")
813+
count = RESPONSE.json()['Count']
814+
helper.log_info(
815+
f"{s} | Found {str(count)} Hitachi volume records to retrieve")
816+
results_per_page = 10 # adjust the number of results we pull per API call
817+
for i in range(0, count, results_per_page):
818+
RESPONSE = r_intersight(
819+
f"{endpoint}?$top={results_per_page}&$skip={str(i)}")
820+
for data in RESPONSE.json()['Results']:
821+
data = pop(['Ancestors', 'DomainGroupMoid', 'ClassId', 'Owners', 'Parent', 'ObjectType',
822+
'PermissionResources', 'SharedScope', 'RegisteredDevice', 'Pool', 'ParityGroups', 'ParityGroupIds'], data)
823+
for x in ['Array', 'StorageUtilization']:
824+
data[x] = pop(['ClassId', 'ObjectType'], data[x])
825+
data['Array'] = pop(['link'], data['Array'])
826+
write_splunk(index, account_name,
827+
'cisco:intersight:storageHitachiVolumes', data)
828+
829+
if not 'hitachi' in opt_inventory:
830+
helper.log_debug(
831+
f"{s} | Hitachi was not selected in the Inventory configuration")
832+
753833
# Epilogue
754834
end = datetime.now()
755835
elapsed = end - start

splunkbase/details.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ The Add-on leverages the [Cisco Intersight RESTful API](https://intersight.com/a
44

55
| Options | Intersight API | Splunk sourcetype |
66
| --- | --- | --- |
7+
| AAA Audit Records | [aaa/AuditRecords][1] | cisco:intersight:aaaAuditRecords |
8+
| Alarms | [cond/Alarms][2] | cisco:intersight:condAlarms |
79
| Advisories | [tam/AdvisoryInstances][3] | cisco:intersight:tamAdvisoryInstances |
810
| Compute | [compute/PhysicalSummaries][4] | cisco:intersight:computePhysicalSummaries |
911
| Compute | [cond/HclStatuses][9] | cisco:intersight:condHclStatuses |
1012
| Contract | [asset/DeviceContractStatusInformations][10] | cisco:intersight:assetDeviceContractInformations |
1113
| Hyperflex | [hyperflex/Clusters][5] | cisco:intersight:hyperflexClusters |
1214
| Hyperflex | [hyperflex/Nodes][8] | cisco:intersight:hyperflexNodes |
1315
| Hyperflex | [hyperflex/StorageContainers][16] | cisco:intersight:hyperflexStorageContainers |
16+
| Hitachi | [storage/HitachiArrays][19] | cisco:intersight:storageHitachiClusters |
17+
| Hitachi | [storage/HitachiControllers][20] | cisco:intersight:storageHitachiControllers |
18+
| Hitachi | [storage/HitachiVolumes][21] | cisco:intersight:storageHitachiVolumes |
1419
| NetApp | [storage/NetAppClusters][11] | cisco:intersight:storageNetAppClusters |
1520
| NetApp | [storage/NetAppNodes][12] | cisco:intersight:storageNetAppNodes |
1621
| NetApp | [storage/NetAppVolumes][17] | cisco:intersight:storageNetAppVolumes |
@@ -39,6 +44,9 @@ The Add-on leverages the [Cisco Intersight RESTful API](https://intersight.com/a
3944
[16]: https://intersight.com/apidocs/apirefs/api/v1/hyperflex/StorageContainers/model/
4045
[17]: https://intersight.com/apidocs/apirefs/api/v1/storage/NetAppVolumes/model/
4146
[18]: https://intersight.com/apidocs/apirefs/api/v1/storage/PureVolumes/model/
47+
[19]: https://intersight.com/apidocs/apirefs/api/v1/storage/HitachiArrays/model/
48+
[20]: https://intersight.com/apidocs/apirefs/api/v1/storage/HitachiControllers/model/
49+
[21]: https://intersight.com/apidocs/apirefs/api/v1/storage/HitachiVolumes/model/
4250

4351
Further documentation, sample searches, and known issues are all available at [the Github repository](https://github.com/jerewill-cisco/intersight-splunk-addon).
4452

splunkbase/releasenotes.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ If you're wondering what general code cleanup means...
5757

5858
## 1.3.0 - TBD
5959

60-
- Added NetApp, Pure, and Hitachi to Inventory options (Hitachi is not implemented yet)
61-
- Implemented new sourcetypes for Partner (i.e. Non-Cisco) storage inventory
60+
- Added NetApp, Pure, and Hitachi to Inventory options
61+
- Implemented new sourcetypes for storage partner storage inventory
62+
- cisco:intersight:storageHitachArrays
63+
- cisco:intersight:storageHitachiControllers
64+
- cisco:intersight:storageHitachiVolumes
6265
- cisco:intersight:storageNetAppClusters
6366
- cisco:intersight:storageNetAppNodes
6467
- cisco:intersight:storageNetAppVolumes

0 commit comments

Comments
 (0)