#SAPADMIN is more than SAP (Windows Event Viewer)
An SAP Administrator needs to know about more than SAP; they need to know about the ecosystem that their systems run in. By that, I mean things like how to use features of the Operating System and DBMS that their systems run on, to provide value to the system or business owner. For example, you probably know that drivers, services or software in Windows can crash without you even being aware of it happening. Sometimes this can affect your Solution Manager system, another non SAP part of your Landscape, or you may just want to monitor something like an NSP Developer Edition system. Whichever type of system we are talking about, sometimes the first sign of trouble is when you (or even worse someone in the business) needs the system *right now*. What would be useful would be a tool that notifys you when certain activities occur……
The Windows Event Viewer lets you launch a program, send an email (if the server has an email client installed) or provide some other alert that something has occurred. You do this by attaching a task to an Event in the Windows Event Viewer. The hardest part of this is to find your Event within the Event Viewer. Note there are slight differences in the initial screens between Windows XP, Windows 7, Windows 2003 and Windows 2008.
Once you’ve found the Event you want to report on, look in the right hand panel. There you will see an option Attach task to this Event. Selecting this will pop up a window with all of our options.
For example, we can run a program, send an email (if email software is installed on the Server) or display a pop-up alert.
If you want to run a program, there are some very useful command Line and PowerShell utilities that can come in very handy here. I won’t go into much detail as they are well documented on the Microsoft website, but examples include running the program CMD.EXE with either the /c switch to carry out a command string and then stop, or the /k switch to continue afterwards (more details on command line switches).
You can also use the WEVTUTIL command to automatically poll the event viewer for data and perform actions like creating a log to the Administrator or <sid>adm desktop. This would make it easier to send selected data to second level support or SAP. You can also use PowerShell command to automatically generate a Windows System Health Report:
Get-RmsSystemHealthReport -Path <drive>:\Report [-StartTime <start_time>]
[-EndTime <end_time>] -ReportType <report_type
Any tasks you add can be viewed and edited in the Windows Task Scheduler. The important thing to remember is that thinking about what actions to add to events can be a real time-saver when it comes to diagnosing problems in Windows.