Jump to content

shivan82

Members
  • Posts

    11
  • Joined

  • Last visited

shivan82's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I've got a similar problem in windows 200 with a nas. Is there with a way to connect to a unc path in a script and pass login credentials?
  2. Here is a bit of the code I've modified to read the latest 20 entries of a an event log that is not full: CODE#include <A3LEventLog.au3> Dim $hEventLog, $aData, $sData Dim $iI, $iJ, $iCount, $aEvent, $logfile, $ioffset, $pad $logfile = FileOpen("temp.txt", 2) $hEventLog = _EventLog_Open("", "System") $hEventLog = _EventLog_Open("", "System") $iCount = _EventLog_Count($hEventLog) _Lib_ConsoleWrite("Record count ......: " & $iCount ) _Lib_ConsoleWrite("Oldest record .....: " & _EventLog_Oldest($hEventLog)) _Lib_ConsoleWrite(@CR) $ioffset = _EventLog_Oldest($hEventLog) $pad = $iCount $iCount = $ioffset + $pad MsgBox(0, "$icount", $iCount) for $iI = $iCount - 20 to $iCount $aEvent = _EventLog_Read($hEventLog) FileWriteLine($logfile, "Record number .....: " & $aEvent[ 1]) FileWriteLine($logfile, "Submitted .........: " & $aEvent[ 2] & " " & $aEvent[ 3]) FileWriteLine($logfile, "Generated .........: " & $aEvent[ 4] & " " & $aEvent[ 5]) FileWriteLine($logfile, "Event ID ..........: " & $aEvent[ 6]) FileWriteLine($logfile, "Type ..............: " & $aEvent[ 8]) FileWriteLine($logfile, "Category ..........: " & $aEvent[ 9]) FileWriteLine($logfile, "Source ............: " & $aEvent[10]) FileWriteLine($logfile, "Computer ..........: " & $aEvent[11]) FileWriteLine($logfile, "Username ..........: " & $aEvent[12]) FileWriteLine($logfile, "Description .......: " & $aEvent[13]) $sData = "" $aData = $aEvent[14] for $iJ = 1 to $aData[0] $sData = $sData & Hex($aData[$iJ], 2) & " " if Mod($iJ, 16) = 0 then $sData = $sData next if $sData <> "" then $sData = $sData _Lib_ConsoleWrite("Data ..............: " & $sData) _Lib_ConsoleWrite(@CR) next _EventLog_Close($hEventLog) Pardon ignorance. I realize now that $icount doesn't control from where the Log reading will begin, it's all in _EventLog_Read($hEventLog), so where do I set this offset? As you can see I've tried to do so with $iCount and $ioffset, but all this does is control the number of events that will be read, not from where to start the reading. Once the offset is worked out, how do I tell _EventLog_Read($hEventLog) to sart from this offset?
  3. It's this bit of code from the example that I'm not quite sure what it does: CODE$sData = "" $aData = $aEvent[14] for $iJ = 1 to $aData[0] $sData = $sData & Hex($aData[$iJ], 2) & " " if Mod($iJ, 16) = 0 then $sData = $sData next if $sData <> "" then $sData = $sData What part of the event log goes into $aEvent[14] ? Why the Hex conversion? When I run the script it gets the oldest entries from my event log, to see the newest do I add _EventLog_Count($hEventLog) + 1 to start again at the top?
  4. I'm trying to use the event log function. What I'm trying to do is scan say the 10 newest entries, if it finds an an 'error' event, it must send that complete entry to a txt file. But I'm not quite sure what to do once the event log is loaded into an array.
  5. Could someone post a few lines of code as an example? Just a simple open X file and search for "Y" text.
  6. Auto3lib has an include for managing the event log, I'm a newb to programming and the example script tells me little. I'm trying my make a simple script that will scan the event logs and email me error events. Could someone help me do this using Auto3lib, or anything else? Thanks Ivan
  7. Bump. any help for above question?
  8. Thanks for that, I'm reading it now. In the meantime, im trying to write a script that compares the current date with the date of a backup file then sends me and error message if the two are different. @YEAR @MDAY @MON How do I get the values of these macros into an array or variable? I've tried @YEAR = $sysdate[0] but I get an error.
  9. Hello all, I'm new here! Could someone help me out making a script that checks the event logs for fatal error messages(red), and does a certain action if such an event does show up(send an e-mail using a command line e-mail editor like blat)? Question 2: I have weekly backups divided into folders by week(ie D:\mon,D:\tue,D:\wed,etc), I need help with a script that checks the day of the week of the current day and according to the weekday goes into a specified folder and makes sure that the date of the files in that folder are the same as the current date. Thanks a mil! Ivan
×
×
  • Create New...