Config Info
Name Operationconsole: Autoclose Alarm
Version 1.0

Content

How it works

It use the ODBCTest.exe to execute a INSERT inside the SmartConsole database to add a new status to the adequate message.

Code snippet

In case it might be necessary, here is a part of the ALEV code that is part of the alarm. This code construct dinamically the SQL sentence to execute.

/*building of the SQL sentence */ /************CONSTANTS***********/ /*Criticalness Constants*/ Const CRITICAL := 3; Const WARNING := 2; Const MINOR := 1; Const SUCCESS :=0; Const UNKNOWN := -1; Var CriticalnessTranslations := [CRITICAL:'Critical', WARNING : 'Warning', MINOR : 'Minor', SUCCESS: 'Success', UNKNOWN:'Unknown'] ; /* Building the SQL sentence*/ &SQLSentence:= "insert into SCMSG_MESSAGE_STATUS " ; &SQLSentence:= &SQLSentence + "select SMS_SC_MESSAGE_STATUS_ID+1 " ; &SQLSentence:= &SQLSentence + "SMS_SC_MESSAGE_STATUS_ID," ; &SQLSentence:= &SQLSentence + "SM_SC_MESSAGE_ID SMS_sc_message_ID," ; &SQLSentence:= &SQLSentence + "convert(varchar,getdate(),20) sms_status_date_time," ; &SQLSentence:= &SQLSentence + "2 sms_status," ; &SQLSentence:= &SQLSentence + "'Smartconsole' sms_username," ; &SQLSentence:= &SQLSentence + "'Automatically closed by the Smartconsole,Problem is solved' sms_observations" ; &SQLSentence:= &SQLSentence + " from (select max(SCMSG_MESSAGE_STATUS.SMS_SC_MESSAGE_STATUS_ID) SMS_SC_MESSAGE_STATUS_ID " ; &SQLSentence:= &SQLSentence + " from SCMSG_MESSAGE_STATUS) max_id," ; &SQLSentence:= &SQLSentence + " ( select top 1 SM_SC_MESSAGE_ID" ; &SQLSentence:= &SQLSentence + " from SCMSG_MESSAGE" ; &SQLSentence:= &SQLSentence + " where SM_SYSTEM='" ; &SQLSentence:= &SQLSentence + &SYSTEM + "'" ; &SQLSentence:= &SQLSentence + " and SM_AGENT='" ; &SQLSentence:= &SQLSentence + &AGENTCODE +"' " ; &SQLSentence:= &SQLSentence + " and sm_message_type_id like " ; if (&MessageID MATCH "%&TEMP%->"+ CriticalnessTranslations[&CRITICALNESS]) Then &SQLSentence:= &SQLSentence +"'%->" + &TEMP +"' " ; If ((&MessageID Like "Component:"+ CriticalnessTranslations[&CRITICALNESS])) Then Begin &FIRSTLEVEL Match '%&TEMP%:*' ; &SQLSentence:= &SQLSentence +"'Component:%' and sm_message_text like '"+&TEMP+":%' " ; End; &SQLSentence:= &SQLSentence + " order by SM_MESSAGE_INSERTION_DATE_TIME desc )msg_id" ; 

See also


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: October 18, 2018