@@ -60,6 +60,8 @@ def get_checkpoint(type):
6060 f"{ account_name } _last_{ type } _record" )
6161 helper .log_debug (
6262 f"{ s } | Checkpoint value for { type } records is { state } " )
63+ if (state == None or state == "None" ):
64+ raise Exception ("State is none" )
6365 return state
6466 except :
6567 # set the state if it's not set
@@ -215,7 +217,9 @@ def write_splunk(index, source, sourcetype, data):
215217 state = get_checkpoint ('audit' )
216218 # get the audit records
217219 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" )
219223 # process the audit records
220224 for data in RESPONSE .json ()['Results' ]:
221225 # pop things we don't need
@@ -252,8 +256,9 @@ def write_splunk(index, source, sourcetype, data):
252256 state = get_checkpoint ('alarm' )
253257 # Let's get the alarm records
254258 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" )
257262 # Process the alarm records
258263 for data in RESPONSE .json ()['Results' ]:
259264 data = pop (['AffectedMo' , 'Ancestors' , 'Owners' , 'PermissionResources' ,
0 commit comments