@@ -60,6 +60,8 @@ def get_checkpoint(type):
60
60
f"{ account_name } _last_{ type } _record" )
61
61
helper .log_debug (
62
62
f"{ s } | Checkpoint value for { type } records is { state } " )
63
+ if (state == None or state == "None" ):
64
+ raise Exception ("State is none" )
63
65
return state
64
66
except :
65
67
# set the state if it's not set
@@ -215,7 +217,9 @@ def write_splunk(index, source, sourcetype, data):
215
217
state = get_checkpoint ('audit' )
216
218
# get the audit records
217
219
RESPONSE = r_intersight (
218
- f"{ endpoint } ?$orderby=ModTime%20asc&$filter=ModTime%20gt%20{ state } " )
220
+ f"{ endpoint } ?$inlinecount=allpages&$orderby=ModTime%20asc&$filter=ModTime%20gt%20{ state } " )
221
+ helper .log_info (
222
+ f"{ s } | Found { RESPONSE .json ()['Count' ]} audit records to retrieve" )
219
223
# process the audit records
220
224
for data in RESPONSE .json ()['Results' ]:
221
225
# pop things we don't need
@@ -252,8 +256,9 @@ def write_splunk(index, source, sourcetype, data):
252
256
state = get_checkpoint ('alarm' )
253
257
# Let's get the alarm records
254
258
RESPONSE = r_intersight (
255
- f"{ endpoint } ?$orderby=ModTime%20asc&$filter=ModTime%20gt%20{ state } " )
256
-
259
+ f"{ endpoint } ?$inlinecount=allpages&$orderby=ModTime%20asc&$filter=ModTime%20gt%20{ state } " )
260
+ helper .log_info (
261
+ f"{ s } | Found { RESPONSE .json ()['Count' ]} alarm records to retrieve" )
257
262
# Process the alarm records
258
263
for data in RESPONSE .json ()['Results' ]:
259
264
data = pop (['AffectedMo' , 'Ancestors' , 'Owners' , 'PermissionResources' ,
0 commit comments