Tüm Makaleler

Eventcreate Kullanımı

Ocak 02, 2012

Windows işletim sistemine ait event log kayıtları merkezi log Yönetimi Sistemleri üzerinde toplanarak ilgili raporlamalar ve aksiyonlar alabiliyoruz. Burada en çok kullanılan yöntemlerden biri olan “event id” bazlı İzleme sürecinde windows event log mimarisi ciddi manada işimizi görmektedir. Windows event log ile işletim sistemi üzerinde oluşan ve izlenmesini istediğimiz tüm aktiviteleri görmemiz mümkündür. Örneğin kullanıcı logon bilgisinin alınması (Event Id:528), log kayıtlarının silinmesi (event ID: 517) v.s. takip etmek mümkündür.

Fakat özel ihtiyaçlarımız olduğu durumda  farklı kaynaklara ve uygulamalara ait aktivite sonuçlarının da event log kayıtlarında olması çoğu zaman hayat kurtarır. Bu noktada  “Eventcreate” windows üzerinde gelen ve ciddi esneklik sağlayan bir komut olarak karşımıza çıkmaktadır. Kullanımı kısaca şu şekildedir;

eventcreate

Kullanılabilecek diğer parameter listeleri şu şekildedir;

/s   Computer   : Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.

/u   Domain \ User   : Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.

/p   Password   : Specifies the password of the user account that is specified in the /u parameter.

/l { APPLICATION | SYSTEM } : Specifies the name of the event log where the event will be created. The valid log names are APPLICATION and SYSTEM.

/so   SrcName   : Specifies the source to use for the event. A valid source can be any string and should represent the application or component that is generating the event.

/t { ERROR | WARNING | INFORMATION | SUCCESSAUDIT | FAILUREAUDIT } : Specifies the type of event to create. The valid types are ERROR, WARNING, INFORMATION, SUCCESSAUDIT, and FAILUREAUDIT.

/id   EventID   : Specifies the event ID for the event. A valid ID is any number from 1 to 65535.

/d   Description   : Specifies the description to use for the newly created event.

/? : Displays help at the command prompt.

 

Örneğin  www.logyonetimi.com  adresine ping atılamadığı zaman “Application” 999 numaralı bir event oluşturalım. Aşağıda gördüğünüz gibi isterseniz  Yazılım içerisinde bu komutu çağırıp kullanabilirsiniz veya .bat v.s. çalıştırılabilir bir dosya içerisine ilgili komut satırı eklenerek çalıştırılması sağlanabilir. Aşağıda yer alan örnekte “Pinger” isimli örnek bir ping test yapan bir uygulama ve ping atamadığı zaman .bat çalıştıran bir uygulama üzerinde  örnekleyelim.

 

eventcreate

Ping atılamadığı durumda çalıştırılabilmesi için ping.bat isimli batch file oluşturuyoruz ve içerisine şu satırı ekliyoruz;

eventcreate /t error /id 999 /l application /d "www.logyonetimi.com  adresine erişilemiyor."

 

eventcreate

 

Ping atılamadığı zaman ping.bat dosyasının çalışması ile event log kayıtlarına aşağıda yer alan log kaydı düşecektir;

 

eventcreate

 

Bu aşamadan sonra gelen log kaydnı mail, sms v.s. log Yönetimi çözümlerinin sağladığı imkanlar doğrultusunda sms  v.b. uyarı gönderebilirsiniz.

 

Eventcreate için kullanabileceğiniz örnek komutlar şu şekildedir;

eventcreate /t error /id 100 /l application /d "Create event in application log"

eventcreate /t information /id 1000 /so winmgmt /d "Create event in WinMgmt source"

eventcreate /t error /id 2001 /so winword /l application /d "new src Winword in application log"

eventcreate /s server /t error /id 100 /l application /d "Remote machine without user credentials"

eventcreate /s server /u user /p password /id 100 /t error /l application /d "Remote machine with user credentials"

eventcreate /s server1 /s server2 /u user /p password /id 100 /t error /so winmgmt /d "Creating events on Multiple remote machines"

eventcreate /s server /u user /id 100 /t warning /so winmgmt /d "Remote machine with partial user credentials"

Osman Doğan

Facebook Twitter DZone It! Digg It! StumbleUpon Technorati Del.icio.us NewsVine Reddit Blinklist Add diigo bookmark

Post a comment

  1. Formatting options