Jump to content

rm4453

Active Members
  • Posts

    166
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rm4453's Achievements

Prodigy

Prodigy (4/7)

8

Reputation

  1. I have attempted lowering the length to 1 less than the serial numbers length, however that did not change anything. The issue I am having with adapting yours is not knowing regex, as I use this same function to parse for most of what is in the input from separate queries. Thus modifying it too much will cause major issues, and require a big rewrite. I believe the real issue with what I posted code wise, as previously mentioned is trying to verify a certain string is not in the string found. I say this as I was able to get it to parse when I did not include that, however it would parse at first found result, which would be array line: AdvCorrServerSerial 0 Which is not the output I need, which is why I added in the verification that the string is not found.
  2. It is reading from user clipboard not text file, and needs the already set requirements, due to the function being used to filter more than just these vars... However I will attempt to adapt what you have suggested in the mean time.
  3. I gave the input, as previously commented, I gave the query which is failing, and commented the data I am looking for it to find on the input data, I gave the function call that doesn't work as well. I will lay it out for you again: Failing Func Call: $retVal = find("Serial", "AdvCorr", 13) Function Code: Func find($toFind, $notThis = '', $reqLength = -1) $found = 0 $finder = 0 If $notThis = '' And $reqLength = -1 Then While $found < 1 And $finder < UBound($splitClip) If StringInStr($splitClip[$finder], $toFind) Then $found = 1 ;~ _ExtMsgBox(0, 4, "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder], 0, $Template_Generator, 0, False) MsgBox("", "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder]) Return $finder EndIf $finder += 1 WEnd ElseIf $notThis <> '' And $reqLength = -1 Then While $found < 1 And $finder < UBound($splitClip) If StringInStr($splitClip[$finder], $toFind) And (Not StringInStr($splitClip[$finder], $notThis)) Then $found = 1 ;~ _ExtMsgBox(0, 4, "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder], 0, $Template_Generator, 0, False) MsgBox("", "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder]) Return $finder EndIf $finder += 1 WEnd Else ;THIS ONE IS NOT WORKING IT LOOPS PAST THE TEXT WANTED WHICH IS: Serial 22197956 While $found < 1 And $finder < UBound($splitClip) ConsoleWrite("ArrayLen: " & UBound($splitClip) - 1 & " Index: " & $finder & " Found: " & $splitClip[$finder] & @CRLF) If StringInStr($splitClip[$finder], $toFind) And StringLen(StringInStr($splitClip[$finder], $toFind)) >= $reqLength And StringInStr($splitClip[$finder], $notThis) = 0 Then $found = 1 ;~ _ExtMsgBox(0, 4, "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder], 0, $Template_Generator, 0, False) MsgBox("", "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder]) Return $finder EndIf $finder += 1 WEnd EndIf ;~ _ExtMsgBox(0, 4, "EMPTY", "NOTHING FOUND CAP'N, 'TWAS LOOKIN' FOR: " & $toFind, 0, $Template_Generator, 0, False) MsgBox("", "EMPTY", "NOTHING FOUND CAP'N, 'TWAS LOOKIN' FOR: " & $toFind) Return -1 EndFunc ;==>find Desired Output: Position In Array Of "Serial 22197956" or " ServerSerial 22197956" Input Data: Field Value Summary Warning Alert: REDACTED Role: Server Alarm type: Memory utilization Message: Memory utilization triggered over 90% at 91 %. Node REDACTED Severity Major Acknowledged Yes LastOccurrence 4/15/21, 10:15 PM Action Address AdvCorrCauseType Unknown AdvCorrServerName AdvCorrServerSerial 0 Agent REDACTED AggregationFirst 4/15/21, 10:15 PM AlertGroup Memory utilization AlertKey REDACTED:REDACTED BSM_Identity CI_ADDomain CI_AltContact CI_App_Name CI_App_Type CI_ApplicationPlatform CI_ApplicationTeam CI_AssignmentGroup CI_Assignment_Groups CI_Back_Office CI_Business_Criticality CI_Business_Owner CI_Business_Service CI_Call_Center CI_Category CI_City CI_Class CI_Client_Facing CI_Comments CI_Contact CI_ContactEmail CI_ContactPhone CI_Contains_PHI CI_Contains_PII CI_Core_App_Name CI_DNS_Name CI_DR_Data_Center CI_DR_Plan CI_DR_Plan_Reason CI_Device_ID 0 CI_Enrichment_Status Enriched CI_GroupID CI_HostedAPPs CI_ID CI_IPAddress REDACTED CI_Integrated_Core_Apps CI_Is_Database CI_Last_DR_Test_Date 0 CI_Model Windows 2008 R2 Server CI_OS_Support_Queue CI_OperatingSystem CI_Owner CI_PDSI_Tower CI_Primary_Data_Center CI_RPO_hours CI_RTO_hours CI_SBU undefined CI_SSAE16_Scope CI_Severtiy CI_SharePoint_Link CI_Source REDACTED CI_State CI_Status CI_SubSBU CI_Tier_2_support_queue CI_Tier_3_support_queue CI_Zip CauseType Unknown CauseWeight 0 Class Solarwinds CloseCode CloseNotes CollectionFirst 0 CorrScore 0 CriticalClient 0 CustomText Customer DisplayFirst 0 Environment EventId ExpireTime Not Set ExtendedAttr FirstOccurrence 4/15/21, 10:15 PM Flash No Grade 0 IBMExtractedType IBMProcessingStage 0 Identifier REDACTED REDACTED:REDACTED Memory utilization REDACTED MTTrapd Probe on REDACTED Problem Server ImpactWeight 0 InternalLast 4/15/21, 10:15 PM JournalSent 0 LocalNodeAlias REDACTED LocalObjRelate 0 LocalPriObj LocalRootObj LocalSecObj LocalTertObj Location undefined Location_lat Location_long LogTicket NoTicket Manager MTTrapd Probe on REDACTED NmosCauseType Unknown NmosDomainName NmosEntityId 0 NmosEventMap NmosManagedStatus Managed NmosObjInst 0 NmosSerial NodeAlias REDACTED NormalisedAlarmCode 0 NormalisedAlarmGroup NormalisedAlarmName OldRow 0 OwnerGID Public OwnerUID REDACTED REDACTED ParentIdentifier ParentServerSerial 0 Parent_CI PhysicalCard PhysicalPort 0 PhysicalSlot 0 Poll 0 ProbeSubSecondId 0 ProcessReq 0 QuietPeriod 0 RE_Parent unknown RE_Resolve 0 RemoteNodeAlias RemoteObjRelate 0 RemotePriObj RemoteRootObj RemoteSecObj RemoteTertObj ScopeID Serial 22197956 ServerName CONDUENT_B ServerSerial 22197956 Service Server ServiceNowErrorCode 0 ServiceNowState 0 ServiceNowSysId ShortDescription Memory utilization triggered over 90% at 91 %. SiteName SourceID 6 StateChange 4/15/21, 10:25 PM SuppressEscl Normal TPCURL TTCreatedBy TTNumber TTPriority 0 Tally 1 TaskList Not in Task List Technology Server Type Problem URL X733CorrNotif X733EventType Not Defined X733ProbableCause Not Defined X733SpecificProb
  4. Remove comments, and remove "ArrayLen: 329 Index: (whatever is here) Found:" and you have the data to be filtered
  5. Hello, I am brain dead, and attempting to remedy a bug found in our software caused by recent updates. The issue is simple: Parse data from clipboard to array (Working) Loop through the array and check if text is found (buggy?) Verify the text found does not contain a certain string (buggy?) Verify string found is above a certain length (buggy?) Here is the comparison statement I have: Func find($toFind, $notThis = '', $reqLength = -1) $found = 0 $finder = 0 If $notThis = '' And $reqLength = -1 Then While $found < 1 And $finder < UBound($splitClip) If StringInStr($splitClip[$finder], $toFind) Then $found = 1 ;~ _ExtMsgBox(0, 4, "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder], 0, $Template_Generator, 0, False) MsgBox("", "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder]) Return $finder EndIf $finder += 1 WEnd ElseIf $notThis <> '' And $reqLength = -1 Then While $found < 1 And $finder < UBound($splitClip) If StringInStr($splitClip[$finder], $toFind) And (Not StringInStr($splitClip[$finder], $notThis)) Then $found = 1 ;~ _ExtMsgBox(0, 4, "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder], 0, $Template_Generator, 0, False) MsgBox("", "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder]) Return $finder EndIf $finder += 1 WEnd Else ;THIS ONE IS NOT WORKING IT LOOPS PAST THE TEXT WANTED WHICH IS: Serial 22197956 While $found < 1 And $finder < UBound($splitClip) ConsoleWrite("ArrayLen: " & UBound($splitClip) - 1 & " Index: " & $finder & " Found: " & $splitClip[$finder] & @CRLF) If StringInStr($splitClip[$finder], $toFind) And StringLen(StringInStr($splitClip[$finder], $toFind)) >= $reqLength And StringInStr($splitClip[$finder], $notThis) = 0 Then $found = 1 ;~ _ExtMsgBox(0, 4, "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder], 0, $Template_Generator, 0, False) MsgBox("", "FOUND", "FOUND THIS CAP'N: " & $splitClip[$finder]) Return $finder EndIf $finder += 1 WEnd EndIf ;~ _ExtMsgBox(0, 4, "EMPTY", "NOTHING FOUND CAP'N, 'TWAS LOOKIN' FOR: " & $toFind, 0, $Template_Generator, 0, False) MsgBox("", "EMPTY", "NOTHING FOUND CAP'N, 'TWAS LOOKIN' FOR: " & $toFind) Return -1 EndFunc ;==>find The query I am inputting is as follows: $retVal = find("Serial", "AdvCorr", 13) I believe the issue lies in the part of the statement which is: StringInStr($splitClip[$finder], $notThis) = 0 Here is an example of the Console Log: ;Anything below not commented is Output ArrayLen: 329 Index: 0 Found: 329 ArrayLen: 329 Index: 1 Found: Field    Value     ArrayLen: 329 Index: 2 Found: ArrayLen: 329 Index: 3 Found: Summary    Warning Alert: REDACTED Role: Server Alarm type: Memory utilization Message: Memory utilization triggered over 90% at 91 %.     ArrayLen: 329 Index: 4 Found: ArrayLen: 329 Index: 5 Found: Node    REDACTED     ArrayLen: 329 Index: 6 Found: ArrayLen: 329 Index: 7 Found: Severity    Major     ArrayLen: 329 Index: 8 Found: ArrayLen: 329 Index: 9 Found: Acknowledged    Yes     ArrayLen: 329 Index: 10 Found: ArrayLen: 329 Index: 11 Found: LastOccurrence    4/15/21, 10:15 PM     ArrayLen: 329 Index: 12 Found: ArrayLen: 329 Index: 13 Found: Action         ArrayLen: 329 Index: 14 Found: ArrayLen: 329 Index: 15 Found: Address         ArrayLen: 329 Index: 16 Found: ArrayLen: 329 Index: 17 Found: AdvCorrCauseType    Unknown     ArrayLen: 329 Index: 18 Found: ArrayLen: 329 Index: 19 Found: AdvCorrServerName         ArrayLen: 329 Index: 20 Found: ArrayLen: 329 Index: 21 Found: AdvCorrServerSerial    0     ArrayLen: 329 Index: 22 Found: ArrayLen: 329 Index: 23 Found: Agent    REDACTED     ArrayLen: 329 Index: 24 Found: ArrayLen: 329 Index: 25 Found: AggregationFirst    4/15/21, 10:15 PM     ArrayLen: 329 Index: 26 Found: ArrayLen: 329 Index: 27 Found: AlertGroup    Memory utilization     ArrayLen: 329 Index: 28 Found: ArrayLen: 329 Index: 29 Found: AlertKey    REDACTED:REDACTED     ArrayLen: 329 Index: 30 Found: ArrayLen: 329 Index: 31 Found: BSM_Identity         ArrayLen: 329 Index: 32 Found: ArrayLen: 329 Index: 33 Found: CI_ADDomain         ArrayLen: 329 Index: 34 Found: ArrayLen: 329 Index: 35 Found: CI_AltContact         ArrayLen: 329 Index: 36 Found: ArrayLen: 329 Index: 37 Found: CI_App_Name         ArrayLen: 329 Index: 38 Found: ArrayLen: 329 Index: 39 Found: CI_App_Type         ArrayLen: 329 Index: 40 Found: ArrayLen: 329 Index: 41 Found: CI_ApplicationPlatform         ArrayLen: 329 Index: 42 Found: ArrayLen: 329 Index: 43 Found: CI_ApplicationTeam         ArrayLen: 329 Index: 44 Found: ArrayLen: 329 Index: 45 Found: CI_AssignmentGroup         ArrayLen: 329 Index: 46 Found: ArrayLen: 329 Index: 47 Found: CI_Assignment_Groups         ArrayLen: 329 Index: 48 Found: ArrayLen: 329 Index: 49 Found: CI_Back_Office         ArrayLen: 329 Index: 50 Found: ArrayLen: 329 Index: 51 Found: CI_Business_Criticality         ArrayLen: 329 Index: 52 Found: ArrayLen: 329 Index: 53 Found: CI_Business_Owner         ArrayLen: 329 Index: 54 Found: ArrayLen: 329 Index: 55 Found: CI_Business_Service         ArrayLen: 329 Index: 56 Found: ArrayLen: 329 Index: 57 Found: CI_Call_Center         ArrayLen: 329 Index: 58 Found: ArrayLen: 329 Index: 59 Found: CI_Category         ArrayLen: 329 Index: 60 Found: ArrayLen: 329 Index: 61 Found: CI_City         ArrayLen: 329 Index: 62 Found: ArrayLen: 329 Index: 63 Found: CI_Class         ArrayLen: 329 Index: 64 Found: ArrayLen: 329 Index: 65 Found: CI_Client_Facing         ArrayLen: 329 Index: 66 Found: ArrayLen: 329 Index: 67 Found: CI_Comments         ArrayLen: 329 Index: 68 Found: ArrayLen: 329 Index: 69 Found: CI_Contact         ArrayLen: 329 Index: 70 Found: ArrayLen: 329 Index: 71 Found: CI_ContactEmail         ArrayLen: 329 Index: 72 Found: ArrayLen: 329 Index: 73 Found: CI_ContactPhone         ArrayLen: 329 Index: 74 Found: ArrayLen: 329 Index: 75 Found: CI_Contains_PHI         ArrayLen: 329 Index: 76 Found: ArrayLen: 329 Index: 77 Found: CI_Contains_PII         ArrayLen: 329 Index: 78 Found: ArrayLen: 329 Index: 79 Found: CI_Core_App_Name         ArrayLen: 329 Index: 80 Found: ArrayLen: 329 Index: 81 Found: CI_DNS_Name         ArrayLen: 329 Index: 82 Found: ArrayLen: 329 Index: 83 Found: CI_DR_Data_Center         ArrayLen: 329 Index: 84 Found: ArrayLen: 329 Index: 85 Found: CI_DR_Plan         ArrayLen: 329 Index: 86 Found: ArrayLen: 329 Index: 87 Found: CI_DR_Plan_Reason         ArrayLen: 329 Index: 88 Found: ArrayLen: 329 Index: 89 Found: CI_Device_ID    0     ArrayLen: 329 Index: 90 Found: ArrayLen: 329 Index: 91 Found: CI_Enrichment_Status    Enriched     ArrayLen: 329 Index: 92 Found: ArrayLen: 329 Index: 93 Found: CI_GroupID         ArrayLen: 329 Index: 94 Found: ArrayLen: 329 Index: 95 Found: CI_HostedAPPs         ArrayLen: 329 Index: 96 Found: ArrayLen: 329 Index: 97 Found: CI_ID         ArrayLen: 329 Index: 98 Found: ArrayLen: 329 Index: 99 Found: CI_IPAddress    REDACTED     ArrayLen: 329 Index: 100 Found: ArrayLen: 329 Index: 101 Found: CI_Integrated_Core_Apps         ArrayLen: 329 Index: 102 Found: ArrayLen: 329 Index: 103 Found: CI_Is_Database         ArrayLen: 329 Index: 104 Found: ArrayLen: 329 Index: 105 Found: CI_Last_DR_Test_Date    0     ArrayLen: 329 Index: 106 Found: ArrayLen: 329 Index: 107 Found: CI_Model    Windows 2008 R2 Server     ArrayLen: 329 Index: 108 Found: ArrayLen: 329 Index: 109 Found: CI_OS_Support_Queue         ArrayLen: 329 Index: 110 Found: ArrayLen: 329 Index: 111 Found: CI_OperatingSystem         ArrayLen: 329 Index: 112 Found: ArrayLen: 329 Index: 113 Found: CI_Owner         ArrayLen: 329 Index: 114 Found: ArrayLen: 329 Index: 115 Found: CI_PDSI_Tower         ArrayLen: 329 Index: 116 Found: ArrayLen: 329 Index: 117 Found: CI_Primary_Data_Center         ArrayLen: 329 Index: 118 Found: ArrayLen: 329 Index: 119 Found: CI_RPO_hours         ArrayLen: 329 Index: 120 Found: ArrayLen: 329 Index: 121 Found: CI_RTO_hours         ArrayLen: 329 Index: 122 Found: ArrayLen: 329 Index: 123 Found: CI_SBU    undefined     ArrayLen: 329 Index: 124 Found: ArrayLen: 329 Index: 125 Found: CI_SSAE16_Scope         ArrayLen: 329 Index: 126 Found: ArrayLen: 329 Index: 127 Found: CI_Severtiy         ArrayLen: 329 Index: 128 Found: ArrayLen: 329 Index: 129 Found: CI_SharePoint_Link         ArrayLen: 329 Index: 130 Found: ArrayLen: 329 Index: 131 Found: CI_Source    REDACTED     ArrayLen: 329 Index: 132 Found: ArrayLen: 329 Index: 133 Found: CI_State         ArrayLen: 329 Index: 134 Found: ArrayLen: 329 Index: 135 Found: CI_Status         ArrayLen: 329 Index: 136 Found: ArrayLen: 329 Index: 137 Found: CI_SubSBU         ArrayLen: 329 Index: 138 Found: ArrayLen: 329 Index: 139 Found: CI_Tier_2_support_queue         ArrayLen: 329 Index: 140 Found: ArrayLen: 329 Index: 141 Found: CI_Tier_3_support_queue         ArrayLen: 329 Index: 142 Found: ArrayLen: 329 Index: 143 Found: CI_Zip         ArrayLen: 329 Index: 144 Found: ArrayLen: 329 Index: 145 Found: CauseType    Unknown     ArrayLen: 329 Index: 146 Found: ArrayLen: 329 Index: 147 Found: CauseWeight    0     ArrayLen: 329 Index: 148 Found: ArrayLen: 329 Index: 149 Found: Class    REDACTED     ArrayLen: 329 Index: 150 Found: ArrayLen: 329 Index: 151 Found: CloseCode         ArrayLen: 329 Index: 152 Found: ArrayLen: 329 Index: 153 Found: CloseNotes         ArrayLen: 329 Index: 154 Found: ArrayLen: 329 Index: 155 Found: CollectionFirst    0     ArrayLen: 329 Index: 156 Found: ArrayLen: 329 Index: 157 Found: CorrScore    0     ArrayLen: 329 Index: 158 Found: ArrayLen: 329 Index: 159 Found: CriticalClient    0     ArrayLen: 329 Index: 160 Found: ArrayLen: 329 Index: 161 Found: CustomText         ArrayLen: 329 Index: 162 Found: ArrayLen: 329 Index: 163 Found: Customer         ArrayLen: 329 Index: 164 Found: ArrayLen: 329 Index: 165 Found: DisplayFirst    0     ArrayLen: 329 Index: 166 Found: ArrayLen: 329 Index: 167 Found: Environment         ArrayLen: 329 Index: 168 Found: ArrayLen: 329 Index: 169 Found: EventId         ArrayLen: 329 Index: 170 Found: ArrayLen: 329 Index: 171 Found: ExpireTime    Not Set     ArrayLen: 329 Index: 172 Found: ArrayLen: 329 Index: 173 Found: ExtendedAttr         ArrayLen: 329 Index: 174 Found: ArrayLen: 329 Index: 175 Found: FirstOccurrence    4/15/21, 10:15 PM     ArrayLen: 329 Index: 176 Found: ArrayLen: 329 Index: 177 Found: Flash    No     ArrayLen: 329 Index: 178 Found: ArrayLen: 329 Index: 179 Found: Grade    0     ArrayLen: 329 Index: 180 Found: ArrayLen: 329 Index: 181 Found: IBMExtractedType         ArrayLen: 329 Index: 182 Found: ArrayLen: 329 Index: 183 Found: IBMProcessingStage    0     ArrayLen: 329 Index: 184 Found: ArrayLen: 329 Index: 185 Found: Identifier    REDACTED REDACTED:REDACTED Memory utilization REDACTED MTTrapd Probe on REDACTED Problem Server     ArrayLen: 329 Index: 186 Found: ArrayLen: 329 Index: 187 Found: ImpactWeight    0     ArrayLen: 329 Index: 188 Found: ArrayLen: 329 Index: 189 Found: InternalLast    4/15/21, 10:15 PM     ArrayLen: 329 Index: 190 Found: ArrayLen: 329 Index: 191 Found: JournalSent    0     ArrayLen: 329 Index: 192 Found: ArrayLen: 329 Index: 193 Found: LocalNodeAlias    REDACTED     ArrayLen: 329 Index: 194 Found: ArrayLen: 329 Index: 195 Found: LocalObjRelate    0     ArrayLen: 329 Index: 196 Found: ArrayLen: 329 Index: 197 Found: LocalPriObj         ArrayLen: 329 Index: 198 Found: ArrayLen: 329 Index: 199 Found: LocalRootObj         ArrayLen: 329 Index: 200 Found: ArrayLen: 329 Index: 201 Found: LocalSecObj         ArrayLen: 329 Index: 202 Found: ArrayLen: 329 Index: 203 Found: LocalTertObj         ArrayLen: 329 Index: 204 Found: ArrayLen: 329 Index: 205 Found: Location    undefined     ArrayLen: 329 Index: 206 Found: ArrayLen: 329 Index: 207 Found: Location_lat         ArrayLen: 329 Index: 208 Found: ArrayLen: 329 Index: 209 Found: Location_long         ArrayLen: 329 Index: 210 Found: ArrayLen: 329 Index: 211 Found: LogTicket    NoTicket     ArrayLen: 329 Index: 212 Found: ArrayLen: 329 Index: 213 Found: Manager    MTTrapd Probe on REDACTED     ArrayLen: 329 Index: 214 Found: ArrayLen: 329 Index: 215 Found: NmosCauseType    Unknown     ArrayLen: 329 Index: 216 Found: ArrayLen: 329 Index: 217 Found: NmosDomainName         ArrayLen: 329 Index: 218 Found: ArrayLen: 329 Index: 219 Found: NmosEntityId    0     ArrayLen: 329 Index: 220 Found: ArrayLen: 329 Index: 221 Found: NmosEventMap         ArrayLen: 329 Index: 222 Found: ArrayLen: 329 Index: 223 Found: NmosManagedStatus    Managed     ArrayLen: 329 Index: 224 Found: ArrayLen: 329 Index: 225 Found: NmosObjInst    0     ArrayLen: 329 Index: 226 Found: ArrayLen: 329 Index: 227 Found: NmosSerial         ArrayLen: 329 Index: 228 Found: ArrayLen: 329 Index: 229 Found: NodeAlias    REDACTED     ArrayLen: 329 Index: 230 Found: ArrayLen: 329 Index: 231 Found: NormalisedAlarmCode    0     ArrayLen: 329 Index: 232 Found: ArrayLen: 329 Index: 233 Found: NormalisedAlarmGroup         ArrayLen: 329 Index: 234 Found: ArrayLen: 329 Index: 235 Found: NormalisedAlarmName         ArrayLen: 329 Index: 236 Found: ArrayLen: 329 Index: 237 Found: OldRow    0     ArrayLen: 329 Index: 238 Found: ArrayLen: 329 Index: 239 Found: OwnerGID    Public     ArrayLen: 329 Index: 240 Found: ArrayLen: 329 Index: 241 Found: OwnerUID    REDACTED REDACTED     ArrayLen: 329 Index: 242 Found: ArrayLen: 329 Index: 243 Found: ParentIdentifier         ArrayLen: 329 Index: 244 Found: ArrayLen: 329 Index: 245 Found: ParentServerSerial    0     ArrayLen: 329 Index: 246 Found: ArrayLen: 329 Index: 247 Found: Parent_CI         ArrayLen: 329 Index: 248 Found: ArrayLen: 329 Index: 249 Found: PhysicalCard         ArrayLen: 329 Index: 250 Found: ArrayLen: 329 Index: 251 Found: PhysicalPort    0     ArrayLen: 329 Index: 252 Found: ArrayLen: 329 Index: 253 Found: PhysicalSlot    0     ArrayLen: 329 Index: 254 Found: ArrayLen: 329 Index: 255 Found: Poll    0     ArrayLen: 329 Index: 256 Found: ArrayLen: 329 Index: 257 Found: ProbeSubSecondId    0     ArrayLen: 329 Index: 258 Found: ArrayLen: 329 Index: 259 Found: ProcessReq    0     ArrayLen: 329 Index: 260 Found: ArrayLen: 329 Index: 261 Found: QuietPeriod    0     ArrayLen: 329 Index: 262 Found: ArrayLen: 329 Index: 263 Found: RE_Parent    unknown     ArrayLen: 329 Index: 264 Found: ArrayLen: 329 Index: 265 Found: RE_Resolve    0     ArrayLen: 329 Index: 266 Found: ArrayLen: 329 Index: 267 Found: RemoteNodeAlias         ArrayLen: 329 Index: 268 Found: ArrayLen: 329 Index: 269 Found: RemoteObjRelate    0     ArrayLen: 329 Index: 270 Found: ArrayLen: 329 Index: 271 Found: RemotePriObj         ArrayLen: 329 Index: 272 Found: ArrayLen: 329 Index: 273 Found: RemoteRootObj         ArrayLen: 329 Index: 274 Found: ArrayLen: 329 Index: 275 Found: RemoteSecObj         ArrayLen: 329 Index: 276 Found: ArrayLen: 329 Index: 277 Found: RemoteTertObj         ArrayLen: 329 Index: 278 Found: ArrayLen: 329 Index: 279 Found: ScopeID         ArrayLen: 329 Index: 280 Found: ArrayLen: 329 Index: 281 Found: Serial    22197956    ;I want this or the one below (they don't always both contain wanted data) ArrayLen: 329 Index: 282 Found: ArrayLen: 329 Index: 283 Found: ServerName    REDACTED_B     ArrayLen: 329 Index: 284 Found: ArrayLen: 329 Index: 285 Found: ServerSerial    22197956    ;I want this or the one above (they don't always both contain wanted data) ArrayLen: 329 Index: 286 Found: ArrayLen: 329 Index: 287 Found: Service    Server     ArrayLen: 329 Index: 288 Found: ArrayLen: 329 Index: 289 Found: ServiceNowErrorCode    0     ArrayLen: 329 Index: 290 Found: ArrayLen: 329 Index: 291 Found: ServiceNowState    0     ArrayLen: 329 Index: 292 Found: ArrayLen: 329 Index: 293 Found: ServiceNowSysId         ArrayLen: 329 Index: 294 Found: ArrayLen: 329 Index: 295 Found: ShortDescription    Memory utilization triggered over 90% at 91 %.     ArrayLen: 329 Index: 296 Found: ArrayLen: 329 Index: 297 Found: SiteName         ArrayLen: 329 Index: 298 Found: ArrayLen: 329 Index: 299 Found: SourceID    6     ArrayLen: 329 Index: 300 Found: ArrayLen: 329 Index: 301 Found: StateChange    4/15/21, 10:25 PM     ArrayLen: 329 Index: 302 Found: ArrayLen: 329 Index: 303 Found: SuppressEscl    Normal     ArrayLen: 329 Index: 304 Found: ArrayLen: 329 Index: 305 Found: TPCURL         ArrayLen: 329 Index: 306 Found: ArrayLen: 329 Index: 307 Found: TTCreatedBy         ArrayLen: 329 Index: 308 Found: ArrayLen: 329 Index: 309 Found: TTNumber         ArrayLen: 329 Index: 310 Found: ArrayLen: 329 Index: 311 Found: TTPriority    0     ArrayLen: 329 Index: 312 Found: ArrayLen: 329 Index: 313 Found: Tally    1     ArrayLen: 329 Index: 314 Found: ArrayLen: 329 Index: 315 Found: TaskList    Not in Task List     ArrayLen: 329 Index: 316 Found: ArrayLen: 329 Index: 317 Found: Technology    Server     ArrayLen: 329 Index: 318 Found: ArrayLen: 329 Index: 319 Found: Type    Problem     ArrayLen: 329 Index: 320 Found: ArrayLen: 329 Index: 321 Found: URL         ArrayLen: 329 Index: 322 Found: ArrayLen: 329 Index: 323 Found: X733CorrNotif         ArrayLen: 329 Index: 324 Found: ArrayLen: 329 Index: 325 Found: X733EventType    Not Defined     ArrayLen: 329 Index: 326 Found: ArrayLen: 329 Index: 327 Found: X733ProbableCause    Not Defined     ArrayLen: 329 Index: 328 Found: ArrayLen: 329 Index: 329 Found: X733SpecificProb ;Anything above not commented is Output
  6. Here is an attached example gif with all blurred out that I can't let you see. I am currently implementing a while wait here: Func ALERT() $wPos = WinGetPos($Template_Generator) WinMove($alertForm, "", $wPos[0] + Int($wPos[2] / 2) - Int(250 / 2), $wPos[1] + Int($wPos[3] / 2) - Int(190 / 2)) GUISetState(@SW_SHOW, $alertForm) GUISetState(@SW_HIDE, $Template_Generator) $alert = "" While $alert = "" Sleep(25) WEnd GUISetState(@SW_HIDE, $alertForm) GUISetState(@SW_SHOW, $Template_Generator) EndFunc ;==>ALERT The above code is what is showing the "AlertForm" which is shown at the end of the gif. As you can see via the gif, it shows up fine, however does not hide itself, and show the generator after select button is pressed. Here is the "AlertForm" GUI code: $alertForm = GUICreate("Alert Type?", 186, 110, 192, 124) $alertType = GUICtrlCreateCombo("", 32, 40, 121, 25) GUICtrlSetData(-1, "APPD|CPU|DISK SPACE|MEMORY|NETWORK DOWN|NETWORK PACKET LOSS|NETWORK RESPONSE|NETWORK UTILIZATION|SERVER DOWN|SITESCOPE|SPLUNK|STORAGE|OTHER") $alertLabel = GUICtrlCreateLabel("Please Select Alert Type:", 32, 18, 123, 17) $alertSub = GUICtrlCreateButton("SELECT", 56, 72, 73, 25) GUISetState(@SW_HIDE) ;~ Yes I know this is bad practice however $alert is called on script startup outside of all funcs / gui / before main prog while loop like such: $alert = "" $nMsg = GUIGetMsg(1) Switch $nMsg[1] Case $Template_Generator Switch $nMsg[0] ;~ STUFF DONE HERE ENDS UP AFTER SEVERAL FUNCTIONS CALLING OTHER FUNCTIONS CALLING ALERT() Endswitch Case $alertForm Switch $nMsg[0] Case $GUI_EVENT_CLOSE ;~ MsgBox("", "", "HERE - EXIT") GUISetState(@SW_SHOW, $Template_Generator) GUISetState(@SW_HIDE, $alertForm) Case $alertSub $alert = GUICtrlRead($alertType) ;~ MsgBox("", "", $alert) Return $alert EndSwitch EndSwitch If I can get the "AlertForm" to hide itself, and the main GUI to continue on without issue, then my issue is resolved - Assuming this happens after the user presses the select button & The var $alert is able to be accessed with the new value from the Main GUI I hope this clarifies, and if there is any further information needed please let me know. I really appreciate all of the help provided thus far.
  7. This is a great suggestion, however I have to do this inside a func (which is nested inside several other funcs where the initial one is triggered from main GUI button press) that is run from the main GUI which means a "case" can't be triggered on the main GUI as far as I know. ESP considering I can't require the user to click a button to spawn the alert type box, otherwise I would just include the combo box inside the main GUI and call it a day. I really appreciate the suggestion though!
  8. I'm half tempted to just spawn another process *the secondary gui* and wait for it to write a file, then read the file, and delete it afterwards...
  9. Not quite how it works the While is while the var = "", the var isn't set until they press the "SELECT" button in the secondary GUI, and right before the While the var is set to "" which is empty var
  10. The part of my code which is a while loop is doing that in another way as the secondary GUI should set the continue var to TRUE, however here is an example checking just the text itself to decide if it should continue: ;~ ALERT SUB BECOMES THIS WITH THE MODICIFACTIONS: Case $alertSub $alert = GUICtrlRead($alertType) ;~ MsgBox("", "", $alert) Return $alert ;~ ALERT BECOMES THIS WITH THE MODIFICATIONS: Func ALERT() $wPos = WinGetPos($Template_Generator) WinMove($alertForm, "", $wPos[0] + Int($wPos[2] / 2) - Int(250 / 2), $wPos[1] + Int($wPos[3] / 2) - Int(190 / 2)) GUISetState(@SW_SHOW, $alertForm) GUISetState(@SW_HIDE, $Template_Generator) $alert = "" While $alert = "" Sleep(25) WEnd GUISetState(@SW_HIDE, $alertForm) GUISetState(@SW_SHOW, $Template_Generator) EndFunc ;==>ALERT *yes I know since alertsub isn't called Return isn't necessary, and the var alert does get updated just a bove it which should trigger moving forward When I do it this way, the program waits, however the secondary
  11. No worries, I appreciate the input, I have already tried that, however I still run into the issue where it doesn't wait for the return before continuing on
  12. Hello, I am attempting to force one of my functions to wait for a secondary GUI to return a variable, or set a variable value to anything other than blank I keep running into the issue of my main GUI continuing on in it's script execution, without waiting for secondary GUI to return / modify the variable. I need the user to be able to select an option from a drop down combo box, that pops over my main GUI. I would use an inputbox, however that does not have an option for a drop down combo box. I am in the middle of a function that is called by my main GUI when I am attempting to do this. I am very new to multi GUI setups, and would appreciate any and all help provided. *Due to NDA on this project I can only share minimal code that I have tried please see below: $alertForm = GUICreate("Alert Type?", 186, 110, 192, 124) $alertType = GUICtrlCreateCombo("", 32, 40, 121, 25) GUICtrlSetData(-1, "APPD|CPU|DISK SPACE|MEMORY|NETWORK DOWN|NETWORK PACKET LOSS|NETWORK RESPONSE|NETWORK UTILIZATION|SERVER DOWN|SITESCOPE|SPLUNK|STORAGE|OTHER") $alertLabel = GUICtrlCreateLabel("Please Select Alert Type:", 32, 18, 123, 17) $alertSub = GUICtrlCreateButton("SELECT", 56, 72, 73, 25) GUISetState(@SW_HIDE) $nMsg = GUIGetMsg(1) Switch $nMsg[1] Case $Template_Generator Switch $nMsg[0] Case $generate CPU() EndSwitch Case $alertForm Switch $nMsg[0] Case $GUI_EVENT_CLOSE ;~ MsgBox("", "", "HERE - EXIT") GUISetState(@SW_SHOW, $Template_Generator) GUISetState(@SW_HIDE, $alertForm) Case $alertSub $alert = GUICtrlRead($alertType) GUISetState(@SW_SHOW, $Template_Generator) GUISetState(@SW_HIDE, $alertForm) ;~ MsgBox("", "", $alert) Return $alert EndSwitch EndSwitch ;~ CPU WILL EVENTUALLY CALL ALERT WITH CURRENT SETUP Func ALERT() $wPos = WinGetPos($Template_Generator) WinMove($alertForm, "", $wPos[0] + Int($wPos[2] / 2) - Int(250 / 2), $wPos[1] + Int($wPos[3] / 2) - Int(190 / 2)) GUISetState(@SW_SHOW, $alertForm) GUISetState(@SW_HIDE, $Template_Generator) $alert = "" MsgBox("", "", WinGetState($Template_Generator)) $continue = False While $continue = False If WinGetState($Template_Generator) < 2 Then ;~ Not quite sure how this works or what number "2" should be for the state of $Template_Generator $continue = True EndIf Sleep(25) WEnd EndFunc ;==>ALERT
  13. Thank You! & that is what was tripping me up on it as well... I'll work from here next shift, and report back if any issues are found. I really appreciate the help & effort!
  14. Desired output from above paste should have been clarified further I am sorry about that here is desired output: "FAKEROUTERNAME_rl01.domain.com Role: Network Message: Device response time on FAKEROUTERNAME_rl01.domain.com triggered over warning threshold at 306 ms" Please note Most times only the following portion will be in that box: Message: Device response time on FAKEROUTERNAME_rl01.domain.com triggered over warning threshold at 306 ms In which cases the desired output would be: "Device response time on FAKEROUTERNAME_rl01.domain.com triggered over warning threshold at 306 ms" The desired output from the following copy & paste directly *box 2 of the page would be: "FAKEROUTERNAME_rl01" Field Value Node FAKEROUTERNAME_rl01.domain.com Sorry It is middle of the night here and I just switched to grave-shift... 😕
  15. Sorry about that I completely forgot to include it: Field Value Summary Critical Alert: FAKEROUTERNAME_rl01.domain.com Role: Network Message: Device response time on FAKEROUTERNAME_rl01.domain.com triggered over warning threshold at 306 ms Please note any of those fields may be copied, and more below... The goal is to copy and only keep what is in the Value field... If it is just a device name remove all text after the last character before the first dot aka example above would be: fakeRoutername_rl01 I hope this makes sense... If any clarification is needed please let me know... The code box above is a direct copy and paste of the first field... Properties for event 14454186 on NCOMS.html
×
×
  • Create New...