cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using BSM to Write Alerts from the CAS to Windows Event Log

jacob_gannon
Guide

Hello,

Hoping someone can help me with this...

We've configured the BSM to poll the CAS Alert Log to pick up alerts we've tagged (added tag in the alert description in the console configuration) to put them in the Windows Event Log. Then SCOM can pick them out and create tickets.

We use 2 custom java scripts which were created by someone else in my team but who has since left. These used to work in a different account set up in the same way but for some reason the alerts are not being written to the event log.

The BSM is polling the script as expected, the alert has been triggered and can be seen in the CAS Alert Log Viewer, but it hasn't been written to the even log...

In the BSM, the PollCASAlerts script we've created looks like this:

Base

User - string - admin

Password - string - xxx

PasswordEncrpyed - Boolean - yes

CAS - string - Hostname

Port - string - 80

Protocol - string - http

OpenScript

_JavaScriptLibrary("mojo").init();

var LOGGER = "ATOS OPEN ALERT";

use("atos.alerting");

var props={

                          User : User,

                          Password : Password,

                          PasswordEncrypted : PasswordEncrypted,

                          CAS : CAS,

                          Port : Port,

                          Security : Protocol

};

atos.alerting.testSession(props);

#

Poll Script

_JavaScriptLibrary("mojo").init();

var LOGGER = "ATOS ALERTING";

use("atos.alerting");

var props={

                          User : User,

                          Password : Password,

                          PasswordEncrypted : PasswordEncrypted,

                          CAS : CAS,

                          Port : Port,

                          Security : Protocol

};

atos.alerting.process(props);

 

Tag in Alert Description

ATOS_WINDOWS_EVENT_LOG|

EventID=500|

EventType=WARNING|

Source=Compuware AMD|

 

Any advice would be great! I've attached the 2 scripts we've put int the BSM 12.2\server\lib\js folder which the BSM is polling below.

atos.http2.js

atos.alerting.js

Thanks,

Jacob

2 REPLIES 2

alex_napier
Inactive

Hi Jacob,

There are many things that could be going wrong with this but the place to start is looking into the logs.  server\tmp\CS.log is the main application log file and errors will be written there.  It looks like the author also setup some independent logging, I can't see where that logging goes but the server\config\logging\server_log4j.xml file might hold a clue based on the LOGGER variable used in each script, if not you'd need to add a custom logging scenario for this, there are some details at the end of this post.  

 

regards,

Alex.

jacob_gannon
Guide

Hi Alex,

 

I've noticed an error in the CS.log...

ATOS ALERTING-ERROR: Error running http get – Failed to query the URL, returned code -1   Reason:

JavaScript-ERROR: CSCPT020: Unrecognized scripting error  [Error runnning http getCaused by: Failed to query the URL, returned code:-1   Reason ] )atos.alerting#89)

Will look into this..

 

Thanks,

Jacob