14.12.2012 Views

Optivity Telephony Manager: System Administration - BT Business

Optivity Telephony Manager: System Administration - BT Business

Optivity Telephony Manager: System Administration - BT Business

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

618 Alarm management<br />

Example:<br />

function counter samplefile(counter n) {<br />

string severity_level;<br />

severity_level := AlarmLevelToString($NormalizedSeverity);// Calling<br />

another function<br />

n:=n+1;<br />

if (n=1) {<br />

send(nf_samplefile,<br />

$DeviceTime,": Device ",$CurrentTrapSource,<br />

" generated a ",$CurrentTrapMajor,".",$CurrentTrapMinor,<br />

" trap with severity level: ",severity_level,",<br />

ErrorCode: ", $ErrorCode, ".");<br />

n:=0;<br />

}<br />

return(n);<br />

}<br />

rule r_samplerul {<br />

if ($CurrentTrapDevice="ITG")<br />

{<br />

count_samplefile:=samplefile(count_samplefile);<br />

}<br />

}<br />

Using the sample script files<br />

You have two methods available for writing scripts. You may have a single script in the<br />

script file and define all of the rules and functions in this one script, or you may have<br />

multiple scripts in the script file and define rules and functions for each script.<br />

Single script<br />

An example of a script file that contains a single script is sample_wizard_script.txt<br />

included with your OTM software. A printout of this script appears in “Sample Alarm<br />

Wizard script file” on page -931 of "Script file summary".” In this example, there is only<br />

one script titled “GeneratedScript.” This script has multiple rules to check for a<br />

condition and perform a defined task when the condition occurs. Typically, if the rule is<br />

satisfied, the script calls a function that initiates an action. The notifications can be<br />

located outside the script, and the function can call the notification from inside the script.<br />

The file sample_wizard_script.txt is a file that has been generated by the Alarm Script<br />

Wizard. You can modify this file manually; however, you cannot open it using the<br />

Alarm Script Wizard once it has been modified. See “Alarm Script Wizard” on<br />

page 624.<br />

553-3001-330 Standard 3.00 August 2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!