Skip to content

Commit 80a3096

Browse files
Add Encryption data to Hyperflex inventory records
1 parent fac7ba6 commit 80a3096

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ One for each sourcetype...
113113
| cisco:intersight:tamAdvisoryInstances | `index=* sourcetype=cisco:intersight:tamAdvisoryInstances \| dedup Advisory.Moid \| rename Advisory.BaseScore as CVSSBaseScore \| rename Advisory.AdvisoryId as Id \| rename Advisory.ObjectType as Type \| rename Advisory.Name as Name \| rename Advisory.Severity.Level as Severity \| rename Advisory.CveIds{} as Attached_CVEs \| table source, Name, Id, Type, CVSSBaseScore, Severity, Attached_CVEs` |
114114
| cisco:intersight:computePhysicalSummaries | `index=* sourcetype=cisco:intersight:computePhysicalSummaries RegisteredDevice.ConnectionStatus!=Unclaimed \| dedup Moid \| rename NumCpuCoresEnabled as Cores \| rename TotalMemory as RAM \| eval RAM=RAM/1024 \| rename OperPowerState as Power \| rename AlarmSummary.Critical as Criticals \| rename AlarmSummary.Warning as Warnings \| rename RegisteredDevice.ConnectionStatus as Status \| eval Health=case(Criticals >= 1,"Critical", Warnings >= 1,"Warning", 1=1, "Healthy") \| table source, Power, Status, Health, Name, Model,Serial, Firmware, Cores, RAM`
115115
| cisco:intersight:condHclStatuses | `index=* sourcetype=cisco:intersight:condHclStatuses \| Table source, ManagedObject.Moid, Status, Reason, HardwareStatus, SoftwareStatus, ComponentStatus`
116-
| cisco:intersight:hyperflexClusters | `index=* sourcetype=cisco:intersight:hyperflexClusters \| dedup Moid \| rename Summary.ResiliencyInfo.State as State \| Table source,Name, State, HypervisorType,DeploymentType,DriveType,HxVersion,UtilizationPercentage`
116+
| 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`
117117
| 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`
118118
| cisco:intersight:networkElementSummaries | `index=* sourcetype=cisco:intersight:networkElementSummaries \| dedup Moid \| rename AlarmSummary.Critical as Criticals \| rename AlarmSummary.Warning as Warnings \| table source, Name, Model, Serial, Version, ManagementMode, Criticals, Warnings`
119119
| cisco:intersight:assetTargets | `index=* sourcetype=cisco:intersight:assetTargets \| dedup Moid \| table source, Name, Status, TargetType, ManagementLocation, ConnectorVersion`

input_module_intersight.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,10 @@ def write_splunk(index, source, sourcetype, data):
338338
RESPONSE = r_intersight(
339339
f"{endpoint}?$expand=RegisteredDevice($select=ClaimedByUserName,ClaimedTime,ConnectionStatusLastChangeTime,ConnectionStatus,CreateTime,ReadOnly)&$top={results_per_page}&$skip={str(i)}")
340340
for data in RESPONSE.json()['Results']:
341-
data = pop(['Ancestors', 'PermissionResources','Owners'], data)
342-
data['RegisteredDevice'] = pop(['ClassId', 'ObjectType'], data['RegisteredDevice'])
341+
data = pop(
342+
['Ancestors', 'PermissionResources', 'Owners'], data)
343+
data['RegisteredDevice'] = pop(
344+
['ClassId', 'ObjectType'], data['RegisteredDevice'])
343345
write_splunk(index, account_name,
344346
'cisco:intersight:computePhysicalSummaries', data)
345347
# try to get HCL data also
@@ -413,7 +415,8 @@ def write_splunk(index, source, sourcetype, data):
413415
for data in RESPONSE.json()['Results']:
414416
data = pop(['Ancestors', 'PermissionResources',
415417
'Owners'], data)
416-
data['RegisteredDevice'] = pop(['ClassId', 'ObjectType'], data['RegisteredDevice'])
418+
data['RegisteredDevice'] = pop(
419+
['ClassId', 'ObjectType'], data['RegisteredDevice'])
417420
write_splunk(
418421
index, account_name, 'cisco:intersight:networkElementSummaries', data=data)
419422

@@ -466,13 +469,16 @@ def write_splunk(index, source, sourcetype, data):
466469
results_per_page = 10 # adjust the number of results we pull per API call
467470
for i in range(0, count, results_per_page):
468471
RESPONSE = r_intersight(
469-
f"{endpoint}?$expand=License,RegisteredDevice($select=ClaimedByUserName,ClaimedTime,ConnectionStatusLastChangeTime,ConnectionStatus,CreateTime,ReadOnly)&$top={results_per_page}&$skip={str(i)}")
472+
f"{endpoint}?$expand=Encryption($select=State),License,RegisteredDevice($select=ClaimedByUserName,ClaimedTime,ConnectionStatusLastChangeTime,ConnectionStatus,CreateTime,ReadOnly)&$top={results_per_page}&$skip={str(i)}")
470473
for data in RESPONSE.json()['Results']:
471474
data = pop(['Alarm', 'Ancestors', 'ChildClusters', 'Owners', 'PermissionResources',
472475
'StorageContainers', 'Nodes', 'Health', 'ParentCluster'], data)
473476
data['License'] = pop(
474477
['Ancestors', 'Cluster', 'Owners', 'PermissionResources', 'RegisteredDevice'], data['License'])
475-
data['RegisteredDevice'] = pop(['ClassId', 'ObjectType'], data['RegisteredDevice'])
478+
data['RegisteredDevice'] = pop(
479+
['ClassId', 'ObjectType'], data['RegisteredDevice'])
480+
data['Encryption'] = pop(
481+
['ClassId', 'ObjectType', 'Moid'], data['Encryption'])
476482
write_splunk(index, account_name,
477483
'cisco:intersight:hyperflexClusters', data)
478484

0 commit comments

Comments
 (0)