kcsaba
kcsaba

Reputation: 11

How to turn on the audit logging with wsadmin script?

I would like to turn on the audit logging with a wsadmin script. I was able to create the audit notification like this:

AdminTask.createAuditNotification('[-notificationName Log_Notification -sendEmail false -emailList -logToSystemOut true ]')

But I can't create the auditnotification monitor, becasuse it needs to have the notificationRef:

AdminTask.createAuditNotificationMonitor('[-monitorName AuditMonitor -notificationRef WSNotification_1428567470299 -enable true ]')

and if I want to get that ref (AdminTask.getAuditNotificationRef()) to put it in a variable, then it needs to have the monitor configured first (according to the IBM documentation). If I do not configure the notification monitor first, then the getAuditNotificationRef will return with null value. But if I want to configure the monitor, I need the notificationRef :(.

Kind of confusing stuff for me...could anyone help me with this issue?

thanks

Upvotes: 1

Views: 272

Answers (1)

gmvacek
gmvacek

Reputation: 11

Have you looked in the knowledgecenter?
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/txml_7auditnotify.html?lang=en

This shows the following example:

AdminTask.createAuditNotification('-notificationName defaultEmailNotification -logToSystemOut true -sendEmail true -emailList [email protected](smtp-server.mycompany.com) -emailFormat HTML')

AdminTask.createAuditNotificationMonitor('-notificationName defaultEmailNotification -logToSystemOut true -sendEmail true -emailList [email protected](smtp-server.mycompany.com) -emailFormat HTML')

AdminConfig.save()

As you can see, there is no -notificationRef needed.

Regards, Gary

Upvotes: 1

Related Questions