Sunday 17 November 2013

CA Spectrum Southbound Gateway - settting up a custom trap

I use SBGW quite a lot. there are two flavours of host we use:
 1) where its not modelled in spectrum we would use a eventadmin model as you already know 
2) if it already exists as a systemedge agent you have to do some special stuff. 
 
here is what I do say if I already have a unix systemedge agent for that same ip the trap will come from.
 a) create an eventadmin with a dummy ip address that will never exist in your network 10.1.2.3 or whatever say we call this APPX. note down its model handle. 
 
b) change model handle attribute for sysedge EventModelContainerHandle to other model handle of the APPX. 
Now when you get a sbgw event it will generate vs the EA model but the other events will still generate vs the origional systemedge model. If that is still not happening you have to make sure you have setup your events in a very specific way. 
 
Here is my tried and tested method for all the files to update and what to put in them. (note its not quite what you see in the manual about making a package etc its a short cut way!)
 
Usually you need to do an alert map for traps using special numbers as per the 'template' mentioned in teh southbound gateway guide. So this means editing the alertmap file that you usually get form importing a mib.
 
You need to mess about with it changing some of the trap fields around number 1-17 varbind to map to the 'template' in the manual. These identify special values in the trap that match to name, ip etc. The rest you rename to be >100 (that is the answer to the mystery of why some traps have like systemedge log watcher have varbinds >100!). So I usually find a few I want to map to the template (for example what will be the event model name) and then prefix all the others with 1xx so 1 might be 101, 2 would be 102 etc.
 
I usually put all my new traps in this file: /custom/Events/AlertMap (yes if you imported a mib you need to hunt them down in custom/Alertmap and comment out the old version that don't have SGBW template varbinds) 
 
The parts that are traps with sbgw specific traps I would put in this file also :
/SS/CsVendor/gen_app_gw/EventAdmin/AlertMap
 
then to make sure the changes persist past upgrades copy to a custom file like this 
/SS/CsVendor/gen_app_gw/EventAdmin/AM_components/MYEXAMPLE.aml
 
Each time you upgrade spectrum the cus script will cat all the aml files together to make  /SS/CsVendor/gen_app_gw/EventAdmin/AlertMap 
 
Here is an example of an alertmap for SBGW for oracle enterprise manager which has a trap we wanted to use SBGW for. It has 90+ varbinds but #21 has the device name we want to use for each event model.
So after importing OEM mib you will have them all as #1-90something not 101,102 etc.
 # oraEMNGEvent oraEMNGEventIndex 
1.3.6.1.4.1.111.15.2.0.3 0xfff05100 
1.3.6.1.4.1.111.15.3.1.1.1(101,0)\ 
# oraEMNGEventNotifType 
1.3.6.1.4.1.111.15.3.1.1.2(102,0)\ 
... # oraEMNGEventTargetName 
1.3.6.1.4.1.111.15.3.1.1.21(1,0)\ 
... 
see this row has (1,0) not 121,0 which means this varbind will be the NAME of all those lovely eventModels that will get created in the EA container. all the 100+ ones are just varbinds I will use in the event. 
 
This also means you have to edit any event rules you made off the mib so the 100+ etc map to what the varbinds were before. For traps like this with 90something varbinds that can mean a lot of time in notepad ++ or excel... so I would suggest get your SBGW template sorted first before you spend hours making event policies or all the event varbinds will have to be edited again. 
 
Now we update the eventdisp files.
 
1) EventModel eventdisp
/SS/CsVendor/gen_app_gw/EventDisp 
these events in this file are your full events just like the normal disp 
eg. (once again note the 10x for varbinds) 
0xfff05100 E 0 R { 11,21 } CA.EventCondition, "({v 105} == {S \"Critical\"})" , "0xfff05103 -:-","({v 105} == {S \"Warning\"})" , "0xfff05102 -:-","({v 105} == {S \"Fatal\"})" , "0xfff05104 -:-","default" , "0xfff05105 -:-"
0xfff05102 E 0 A 2, 0xfff05102,11,21 
0xfff05103 E 0 A 3, 0xfff05103,11,21 ...etc 
 
you also need to make sure they are on the end of an EVD file you make for you integration here: 
 /SS/CsVendor/gen_app_gw/EventAdmin/components/MYEXAMPLE.evd 
If you don't next time you upgrade spectrum your changes will get wiped when the cus script runs. 
MAKE EXACTLY THE SAME CHANGES TO THE GENERIC EVENT DISP FILE 
/custom/Events/EventDisp 
*** A WARNING HERE *** DONT TRY AND EDIT THESE EVENTS IN GUI OR THEY WILL GET MESSED UP AND MAKE FILES FURTHER DOWN TREE OF /custom/events/ that will mess things up. 
You should **only ever** have SBGW events in /custom in /custom/Events/EventDisp 
 
next the EventAdmin evendisp files
put pointers to your SBGW events in these files 
SS/CsVendor/gen_app_gw/EventAdmin/EventDisp 
/SS/CsVendor/gen_app_gw/EventAdmin/components/MYEXAMPLEEA.evd 
(this file is just to keep it permanent past the next .cus script) 
These events should just be pointers e.g 
# Oracle OEM 
0xfff05100 
0xfff05102 
0xfff05103 
*** PAY CAREFUL ATTENTION HERE PEOPLE *** if your model is SBGW enabled as per #2 at start of this post above you also need to edit its eventdisp file for systemedge this is:
 /SS/CsVendor/Ctron_Gen_HOST/Host_systemEDGE/EventDisp 
put the same pointers you put in the file above eg. 
# Oracle OEM 
0xfff05100 
0xfff05102 
bear in mind every time you upgrade spectrum from now on this file might get wiped by CA so you always have to manage it carefully!! There is no evd /aml files to preserve your upgrades on this file that I found. 
 
now later on you can edit the pcause and eventformat files in the gui but don't add/remove any SBGW related events except by editing all the files above and reloading spectrum.

Thursday 1 August 2013

ninite saves day again

I had to rebuild my home pc from factory reset image today and ninite (http://ninite.com ) once again saved the day. what a fantastic service this is that you can install all those pesky essential software  items (acrobat, flash, chrome etc etc) from a single batched installer!

Thursday 18 July 2013

Viacode MP Wiki - holy grail of SCOM management packs and overrides

I came across Viacode's management pack wiki today. What an awesome SCOM / Operations manager resource.

Most common management packs are inventoried here with diagrams of class structure (which you can drill down on!), downloadable inventory of the whole managmenet pack and detailed wiki pages for each rule and overrideable property.

Even better is the MP tuner tool which is the tool you always wanted to bulk manage overrides in your SCOM 2007 or 2012.

watch this video and you will see how amazing it truly is! You can even connect it directrly via SQL to the ops manager database for optimal speed and efficiency.

Microsoft why isn't this tool come as standard part of Operations Manager 2012. A 3rd party has built the interface you never did to make overrides manageable!

http://mpwiki.viacode.com/default.aspx?g=mptuner

MP Tuner is a productivity tool that makes SCOM Operations Manager a much better monitoring solution.
  • Override Table. Filterable, sortable and editable grid of existing overrides.
  • Effective Table. Filterable, sortable and editable grid of overrideable parameters’ effective values.
  • Parameter Map. One view editable representation of a parameter overrides for the entire data center.
  • Override Set. Editable set of override values that can be applied to object, class, group or entire data center.
  • Integration with MP Wiki

Monday 18 March 2013

CA Spectrum Procedure Descriptions

I've not been able to find a document describing the functions and parameters for CA Spectrum event procedures. There is a brief description inside the xml for each procedure on the spectroserver so here is a list I extracted by using a ksh script.

xmlfilelist=`ls $SPECROOT/SS/CsVendor/CA/Procedures/*.xml`
for xmlfile in $xmlfilelist ;
    do   
    echo "###########################################################################################"
    echo $xmlfile
    grep -n '<name>' $xmlfile
    echo "procedure description"
    ProcDesStart=`grep -n '<description>' $xmlfile | awk -F: '{print $1}'`
    ProcDesEnd=`grep -n '</description>' $xmlfile | awk -F: '{print $1}'`
    ProcDesLen=$((ProcDesEnd-ProcDesStart))
    sed -e "1,$ProcDesStart d; $ProcDesEnd q" $xmlfile
done


###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Action.xml
22:    <name>Action</name>
procedure description
This procedure is used to send an action to a model.

The parameters are:
1) The model handle of a model to which to send the action
2) An action code
3) A value list with input data, if needed
   This list is converted into a CsAttrValList, with the id's
   set to the position of the input list elements
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/AddHead.xml
22:    <name>AddHead</name>
procedure description
This procedure adds an element to the beginning of a list.

The parameters are:
1) A list to which the element should be added
2) A value to add
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/AddTail.xml
22:    <name>AddTail</name>
procedure description
This procedure adds an element to the end of a list.

The parameters are:
1) A list to which the element should be added
2) A value to add
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Add.xml
22:    <name>Add</name>
procedure description
This procedure is used to add two numbers.

The parameters are:
1) A number (also specifying the return value type)
2) Another number

The two numbers will be added together. If two different types are
added together, the return value will have the same type as the first
value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/And.xml
22:    <name>And</name>
procedure description
This procedure implements a logical 'AND'.

The parameters are:
1) A boolean value or expression on the left
2) A boolean value or expression on the right

The right expression will not be evaluated if the left one evaluates
to 'FALSE'.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Append.xml
22:    <name>Append</name>
procedure description
This procedure appends two strings.

The parameters are:
1) A string type value
2) Another string type value

The two strings are appended together, with the first type specifying
the type of the result. Incompatible types will result in an error
message.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/AreAssociated.xml
22:    <name>AreAssociated</name>
procedure description
This procedure returns TRUE if the two input models are associated
with each other via the relation given. The first parameter specifies
the left model, the second the relation id, and the third the model on
the right side of the association.

The parameters are:
1) The model handle of the left side model
2) A relation handle
3) The model handle of the right side model
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Assign.xml
22:    <name>Assign</name>
procedure description
This procedure assigns a value to a variable. The variable must first
have been defined using 'SetVariable'.

The parameters are:
1) The variable name
2) The new value value
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/BitwiseAnd.xml
22:    <name>BitwiseAnd</name>
procedure description
This procedure implements a bitwise 'AND'.

The parameters are:
1) A numerical value
2) Another numerical value

Both values will be bitwise 'and'ed together. Their types need to be
ones supporting bitwise operations (real/doubles do not, for
instance). Types not supporting this operation will result in an error
message.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/BitwiseNot.xml
22:    <name>BitwiseNot</name>
procedure description
This procedure implements a bitwise 'NOT'.

The parameters are:
1) A numerical value

The value will be bitwise inverted. Its type need to be one supporting
bitwise operations (real/doubles do not, for instance). A type not
supporting this operation will result in an error message.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/BitwiseOr.xml
22:    <name>BitwiseOr</name>
procedure description
This procedure implements a bitwise 'OR'.

The parameters are:
1) A numerical value
2) Another numerical value

Both values will be bitwise 'or'ed together. Their types need to be
ones supporting bitwise operations (real/doubles do not, for
instance). Types not supporting this operation will result in an error
message.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/BitwiseXor.xml
22:    <name>BitwiseXor</name>
procedure description
This procedure implements a bitwise 'XOR'.

The parameters are:
1) A numerical value
2) Another numerical value

Both values will be bitwise 'xor'ed together. Their types need to be
ones supporting bitwise operations (real/doubles do not, for
instance). Types not supporting this operation will result in an error
message.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/CreateAttributeValueList.xml
22:    <name>CreateAttributeValueList</name>
procedure description
This procedure creates an empty attribute value list.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/CreateEventAttributeList.xml
22:    <name>CreateEventAttributeList</name>
procedure description
NOTE: Do not use anymore, please use 'CreateEventVariableList' instead!

This procedure creates an empty event attribute list.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/CreateEventVariableList.xml
22:    <name>CreateEventVariableList</name>
procedure description
This procedure creates an empty event variable list.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/CreateEventWithAttributes.xml
22:    <name>CreateEventWithAttributes</name>
procedure description
NOTE: Do not use anymore, please use 'CreateEventWithVariables' instead!

This procedure is used to create an event with attributes for a model.

The parameters are:
1) The model handle of a model to create the event for
2) An event code
3) An event attribute list
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/CreateEventWithVariables.xml
22:    <name>CreateEventWithVariables</name>
procedure description
This procedure is used to create an event with variable values for a
model.

The parameters are:
1) The model handle of a model to create the event for
2) An event code
3) An event variable list
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/CreateEvent.xml
22:    <name>CreateEvent</name>
procedure description
This procedure is used to create an event for a model.

The parameters are:
1) The model handle of a model to create the event for
2) An event code
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/CreateList.xml
22:    <name>CreateList</name>
procedure description
This procedure creates an empty value list.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/DebugValue.xml
22:    <name>DebugValue</name>
procedure description
This procedure is used to print debugging information about a value.

The parameters are:
1) A text string, printed before the value is printed.
2) Any value

This method will print information about the value passed as the
second parameter to an error log file. To see the output e.g. for
event procedures the .vnmrc event_disp_error_file entry needs to
be set. Other procedure usages may have different setting, please
consult the respective documents.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Divide.xml
22:    <name>Divide</name>
procedure description
This procedure is used to divide one number by another.

The parameters are:
1) A number (also specifying the return value type)
2) Another number

The first number will be divided by the second. If two different
types are divided, the return value will have the same type as
the first value. If the second value is zero, an error message
will be issued and the operation will fail.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/DoesNotEqual.xml
22:    <name>DoesNotEqual</name>
procedure description
This procedure is used to compare two values for non-equality.

The parameters are:
1) A value on the left
2) A value on the right
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Equals.xml
22:    <name>Equals</name>
procedure description
This procedure is used to compare two values for equality.

The parameters are:
1) A value on the left
2) A value on the right
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Exists.xml
22:    <name>Exists</name>
procedure description
This procedure tests if a value exists.

The parameters are:
1) Any value (which may be null)

This procedure tests if its input value exists, returning TRUE if it
does (if it has any value), and FALSE otherwise (if there is no input
value).
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ForEach.xml
22:    <name>ForEach</name>
procedure description
This procedure is useful when you have a list and want to apply an
algorithm to each item in the list, or use each item inside an
algorithm.

The parameters are:
1) A input list containing the list items
2) A variable specification for the loop variable, each value in the
   input list will be assigned to this variable.
3) A variable name for the return variable, initialized with the
   return value from them fourth parameter.
4) A value to initialize the return variable. This could be from
   calling a procedure to perform other initializations.
5) A procedure to run for each item
   To reference the current item, use the 'GetVariable' procedure with
   the name given as first parameter.

Example, assume you have a list of integers in the current event, and
want to have a list of only those which are bigger then 5:
Foreach( GetEventAttributeList( { C CURRENT_EVENT } ),
         { Variable X },
         { Variable retList },
         CreateList(),
         If( Greater( { Variable X },
                      { U 5 } ),
             AssignVariable( { Variable retList },
                             AddTail( { Variable retList },
                                      { Variable X } ) ),
             Nil() ) )

    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/FormatDateTime.xml
22:    <name>FormatDateTime</name>
procedure description
This procedure can be used to get specific parts of a date represented
as a number, counting in seconds from Jan 1st, 1970. The returned
values are text strings.

The parameters are:
1) A date/time value (numbers of seconds since Jan 1st, 1970)
2) A format specifying which part of the date to return
The supported format specifieres are:
  %u   Use gmtime not localtime.  Must appear first in format.
  %%   Literal '%'.
  %d   Day-of-month 01..31.
  %d-  Day-of-month 1..31.
  %D   Date dd/mm/yy.
  %H   Hour-of-day 00..23.
  %h   Same as %m-
  %j   Day-of-year 1..366.
  %m+  Full month name.
  %m-  Abbreviated month name.
  %m*  Month index 1..12.
  %m   Month index 01..12.
  %M   Minute 00..59.
  %S   Second 00..59.
  %T   Time hh:mm:ss.
  %w+  Full weekday name.
  %w-  Abbreviated weekday name.
  %w   Weekday index 1..7.
  %y   Year 00..99.
  %Y   Year 0000..9999.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetConditionAttribute.xml
22:    <name>GetConditionAttribute</name>
procedure description
This procedure is used to get the value of a condition variable.
The condition must be supplied in the environment.

The parameter are:
1) The condition name
2) The condition attribute name
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetCount.xml
22:    <name>GetCount</name>
procedure description
This procedure gets the number of elements in a list.

The parameters are:
1) A list value
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetCurrentTime.xml
22:    <name>GetCurrentTime</name>
procedure description
This procedure returns the current date and time (in seconds since Jan
1st, 1970).
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetElement.xml
22:    <name>GetElement</name>
procedure description
This procedure returns a specific element contained in a list.

The parameters are:
1) A list value
2) The position of the element in the list
   The first element has position 1, the position then increases
   for each element. The position of the last on is the same as
   the number of elements in the list, and can be gotten by calling
   'GetCount()' on the list.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetEventAttributeList.xml
22:    <name>GetEventAttributeList</name>
procedure description
NOTE: Do not use anymore, please use 'GetEventVariableList' instead!

This procedure returns a copy of the attribute list of the
current event.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetEventAttribute.xml
22:    <name>GetEventAttribute</name>
procedure description
NOTE: Do not use anymore, please use 'GetEventVariable' instead!

This procedure is used to get the value of an event variable.

The parameter is:
The event variable ID
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetEventVariableList.xml
22:    <name>GetEventVariableList</name>
procedure description
This procedure returns a copy of the variable list of the
current event.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetEventVariable.xml
22:    <name>GetEventVariable</name>
procedure description
This procedure is used to get the value of an event variable.

The parameter is:
1) The event variable ID
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetHour.xml
22:    <name>GetHour</name>
procedure description
This procedure is used to get the hour out of a date value.

The parameters are:
1) A date/time value (numbers of seconds since Jan 1st, 1970)
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetMinute.xml
22:    <name>GetMinute</name>
procedure description
This procedure is used to get the minute out of a date value.

The parameters are:
1) A date/time value (numbers of seconds since Jan 1st, 1970)
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetModelsByAttrValue.xml
22:    <name>GetModelsByAttrValue</name>
procedure description
This procedure returns a list of models having a particular
attribute value for a given attribute id.

The parameter are:
1) An attribute ID
2) An attribute value
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetModelsByRelationId.xml
22:    <name>GetModelsByRelationId</name>
procedure description
This procedure returns a list of models that are associated
to a specific model via a given relation.

The parameter are:
1) A model to which the returned model should be related
2) A relation handle
3) Wether to find parents (left side) or children (right side).
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetModelsByRelationName.xml
22:    <name>GetModelsByRelationName</name>
procedure description
This procedure returns a list of models that are associated
to a specific model via a given relation.

The parameter are:
1) A model to which the returned model should be related
2) A relation name
3) Wether to find parents (left side) or children (right side).
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetOSType.xml
22:    <name>GetOSType</name>
procedure description
This procedure returns the type of operating system the server is
running on.

The currently supported values are either 'Unix' or 'Windows'.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetRegexpList.xml
22:    <name>GetRegexpList</name>
procedure description
This procedure is used to return all patterns matched by a regular
expression, in a list.

The parameters are:
1) An input string
2) A regular expression pattern string

For example, if the string "xxx_a1_yyy_b2_zzz_c3_qqq" is matched by
the following regexp pattern: ".*(a.).*(b.).*(c.).*" the output list
will contain the following string nodes (first one is whole string
matched):
xxx_a1_yyy_b2_zzz_c3_qqq
a1
b2
c3
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GetRegexp.xml
22:    <name>GetRegexp</name>
procedure description
This procedure is used for return a portion of a string
matched by a regular expression pattern.

The parameters are:
1) An input string
2) A regular expression pattern string
3) A number specifying the return part
   0 ... return the whole matched part
   n > 1 return the n-th subpart of the matched expression
         subparts are referenced by enclosing the desired part
         in the regular expression into brackets: ()
         eg: "(critical|major|minor) ERROR"
         will match any of the error combinations and return the full
         string (eg "critical ERROR") for index 1, and just the error
         severity ("critical") for index 1
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/GreaterOrEqual.xml
22:    <name>GreaterOrEqual</name>
procedure description
This procedure is used to test if a value is numerically greater or
equal than another one.

The parameters are:
1) Left side value
2) Right side value

The procedure returns if left side value &gt;= right side value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Greater.xml
22:    <name>Greater</name>
procedure description
This procedure is used to test if a value is numerically greater than
another one.

The parameters are:
1) Left side value
2) Right side value

The procedure returns if left side value &gt; right side value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/HasIPAddress.xml
22:    <name>HasIPAddress</name>
procedure description
This procedure returns 'TRUE' if a model has a specified IP address.

The parameter are:
1) A model handle
2) An IP address
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/If.xml
22:    <name>If</name>
procedure description
This procedure is used to execute statements based on an 'if' condition.

The parameters are:
1) A statement (procedure or value) which evaluates to a boolean value.
2) A statement to be executed when the first parameter evaluates to
   'TRUE'.
3) A statement to be executed when the first parameter evaluates to
   'FALSE'.

Supply procedure 'CA.Nil' to either the second or third
parameter if you don't want any procedure to be run in that slot.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/IsPortOf.xml
22:    <name>IsPortOf</name>
procedure description
This procedure returns TRUE if a model (first parameter) is a port of
a device (second parameter).

The parameters are:
1) The model handle of the port model
3) The model handle of the device model
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/LessOrEqual.xml
22:    <name>Less</name>
procedure description
This procedure is used to test if a value is numerically smaller than
another one.

The parameters are:
1) Left side value
2) Right side value

The procedure returns if left side value &lt; right side value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Less.xml
22:    <name>LessOrEqual</name>
procedure description
This procedure is used to test if a value is numerically smaller or
equal than another one.

The parameters are:
1) Left side value
2) Right side value

The procedure returns if left side value &lt;= right side value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Modulo.xml
22:    <name>Modulo</name>
procedure description
This procedure is used to get the remainder when dividing one number
by another.

The parameters are:
1) A number (also specifying the return value type)
2) Another number

The first number will be divided by the second, and the remainder is
returned. If two different  types are divided, the return value will
have the same type as  the first value. If the second value is zero,
an error message will be issued and the operation will fail.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Multiply.xml
22:    <name>Multiply</name>
procedure description
This procedure is used to multiply two numbers.

The parameters are:
1) A number (also specifying the return value type)
2) Another number

The two numbers will be multiplied together. If two different
types are multiplied together, the return value will have the same
type as the first value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Not.xml
22:    <name>Not</name>
procedure description
This procedure implements a logical 'NOT'.

The parameter is:
1) A boolean value or expression
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Or.xml
22:    <name>Or</name>
procedure description
This procedure implements a logical 'OR'.

The parameters are:
1) A boolean value or expression on the left
2) A boolean value or expression on the right

The right expression will not be evaluated if the left one evaluates
to 'TRUE'.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Prog2.xml
22:    <name>Prog2</name>
procedure description
Sequentially run two procedures, returning the value of the second
one.

The parameters are:
1) A procedure
2) Another procedure
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Prog3.xml
22:    <name>Prog3</name>
procedure description
Sequentially run three procedures, returning the value of the third
one.

The parameters are:
1) A procedure, to be evaluated first
2) Another procedure, to be evaluated after the first one
3) A procedure, to be evaluated last, and the who's return value is
the overall return value of the Prog3 procedure invocation.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ReadAttributeInstance.xml
22:    <name>ReadAttributeInstance</name>
procedure description
This procedure is used to get the value of an attribute instance.

The parameter are:
1) The model handle
2) The attribute ID
3) The instance OID.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ReadAttribute.xml
22:    <name>ReadAttribute</name>
procedure description
This procedure is used to get the value of an attribute.

The parameter are:
1) The model handle
2) The attribute ID
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Regexp.xml
22:    <name>Regexp</name>
procedure description
This procedure is used for regular expression matching.
A string value is matched against a regular expression, and
if it matches the procedure returns TRUE.

The parameters are:
1) A string
2) A regular expression pattern string
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/RemHead.xml
22:    <name>RemHead</name>
procedure description
This procedure removes an element from the beginning of a list.

The parameters are:
1) A variable holding a list. The element will be removed from the
   list, and the variable will then hold the list minus the removed
   element.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/RemTail.xml
22:    <name>RemTail</name>
procedure description
This procedure removes an element from the end of a list.

The parameters are:
1) A variable holding a list. The element will be removed from the
   list, and the variable will then hold the list minus the removed
   element.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ReplaceDollarSpecroot.xml
22:    <name>ReplaceDollarSpecroot</name>
procedure description
This procedure replaces '$SPECROOT' in a string with the actual
installation root directory.

The parameters are:
1) A string value
2) A boolean value telling whether any backslashes contained in the
   processed string should be doubled (mainly for Windows, for easier
   use in scripts).
   E.g. c:\usr\spectrum would be returned as c:\\usr\\spectrum if
   this value is set to TRUE.

If the string value contains '$SPECROOT', the returned string will
have this value replaced by the installation root directory. If it
does not contain it, the string is returned unchanged.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ReplaceRegexpList.xml
22:    <name>ReplaceRegexpList</name>
procedure description
This procedure is used to replace all matched patterns in an input
string with user supplied values.

The parameters are:
1) An input string
2) A regular expression pattern string
3) A list containing the replacement values for each matched subpart.

Example:
Input string: "First family: electron electron-neutrino up down"
Regexp: "(First)>.* (e.*) (.*)-.* (.*) (.*)"
List of replacement values:
Second
muon
muon
charm
strange

Will result in the following return string:
"Second family: muon muon-neutrino charm strange"

    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ReplaceRegexp.xml
22:    <name>ReplaceRegexp</name>
procedure description
This procedure is used to replace a matched pattern in an input string
with a user specified text.

The parameters are:
1) An input string
2) A regular expression pattern string
3) A number specifying the matched part to replace
   0 ... replace the whole matched expression
   n > 1 replace the n-th subpart of the whole matched expression
         subparts are referenced by enclosing the desired part
         in the regular expression into brackets: ()
         eg: "(critical|major|minor) ERROR"
         will match any of the error combinations and return the full
         string (eg "critical ERROR") for index 1, and just the error
         severity ("critical") for index 1
4) A string which will replace the desired matched part
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/SetAttributeValue.xml
22:    <name>SetAttributeValue</name>
procedure description
This procedure is used to set a value in an event attribute list.

The parameters are:
1) An attribute value list
2) An attribute ID
3) The value (and type) of the new attribute which should be added to the list
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/SetEventAttribute.xml
22:    <name>SetEventAttribute</name>
procedure description
NOTE: Do not use anymore, please use 'SetEventVariable' instead!

This procedure is used to set the value of an event variable.

The parameters are:
1) An event attribute list
2) An event attribute ID
3) The value of the new event attribute
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/SetEventVariable.xml
22:    <name>SetEventVariable</name>
procedure description
This procedure is used to set the value of an event variable.

The parameters are:
1) An event variable list
2) An event variable ID
3) The value of the new event variable
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/SetVariable.xml
22:    <name>SetVariable</name>
procedure description
This procedure stores a value in a variable for later use.
The variable will be valid as long as the set variable procedure is
active, once the procedure exits the variable is undefined again.
To retrieve a value later, use the variable constant type.
E.g. to get the value for variable X, use: { VARIABLE X }
To give the variable a new value, use 'Assign'

The procedure return value is the value which the called procedure
returns.

The parameters are:
1) The variable name
2) The initial value
3) A procedure to run which will use the variable
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ShiftLeft.xml
22:    <name>ShiftLeft</name>
procedure description
This procedure will shift the bits of its first numerical argument to
the left by the amount specified by the second argument.

The parameters are:
1) A number to be shifted (also specifying the return value type)
2) The number of positions the bits should be shifted to the left

The first number will be shifted to the left by the amount specified
by the second. The first argument needs to be of a type that may be
shifted. The second argument needs to be of an integer/unsigned
integer or equivalent type (might be automatically converted in some
case). If ususable types are used the operation will fail and an error
message is issued.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ShiftRight.xml
22:    <name>ShiftRight</name>
procedure description
This procedure will shift the bits of its first numerical argument to
the right by the amount specified by the second argument.

The parameters are:
1) A number to be shifted (also specifying the return value type)
2) The number of positions the bits should be shifted to the right

The first number will be shifted to the right by the amount specified
by the second. The first argument needs to be of a type that may be
shifted. The second argument needs to be of an integer/unsigned
integer or equivalent type (might be automatically converted in some
case). If ususable types are used the operation will fail and an error
message is issued.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Strlen.xml
22:    <name>Strlen</name>
procedure description
This procedure gets the length of a string

The parameters are:
1) A string type value
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Substring.xml
22:    <name>Substring</name>
procedure description
This procedure extracts a substring from a string.

The parameters are:
1) A string value
2) Start of substring index (included), number value
3) End of substring index (excluded), number value

The substring specified by the two indices is returned. If the start
index is greater then the end, the empty string is returned. If either
or both of the indices are beyond the actual string lenght, they are
adjusted accordingly.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/Subtract.xml
22:    <name>Subtract</name>
procedure description
This procedure is used to subtract one number from another.

The parameters are:
1) A number (also specifying the return value type)
2) Another number

The second number will be subtracted from the first. If two different
types are subtracted, the return value will have the same type as
the first value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToBoolean.xml
22:    <name>ToBoolean</name>
procedure description
This procedure tries to convert its parameter value to a boolean value.
The parameters are:
1) A value that will be transformed into a boolean value.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToIpAddr.xml
22:    <name>ToIpAddr</name>
procedure description
This procedure tries to convert its parameter value to an internet address.
The parameters are:
1) A value that will be transformed into an internet address.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToLower.xml
22:    <name>ToLower</name>
procedure description
This procedure converts a string to lowercase.

The parameters are:
1) A string type value

All lowercase characters in the string are converted to lowercase.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToObjectId.xml
22:    <name>ToObjectId</name>
procedure description
This procedure tries to convert its parameter value to an object id.
The parameters are:
1) A value that will be transformed into an object id.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToOctetString.xml
22:    <name>ToOctetString</name>
procedure description
This procedure tries to convert its parameter value to an octet string.
The parameters are:
1) A value that will be transformed into an octet string.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToString.xml
22:    <name>ToString</name>
procedure description
This procedure tries to convert its parameter value into a text string
value.

The parameters are:
1) A value that will be transformed into a text string.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToUInteger.xml
22:    <name>ToUInteger</name>
procedure description
This procedure tries to convert its parameter value into an unsigned
integer value.

The parameters are:
1) A value that can be transformed into an unsigned integer.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/ToUpper.xml
22:    <name>ToUpper</name>
procedure description
This procedure converts a string to uppercase.

The parameters are:
1) A string type value

All lowercase characters in the string are converted to uppercase.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/While.xml
22:    <name>While</name>
procedure description
Execute a procedure as long as a loop procedure returns TRUE.

The parameters are:
1) A procedure to evaluate (loop procedure). The procedure needs to
   return a boolean value. As long as it returns TRUE, the while loop
   is continued.
2) A variable name for the return variable, initialized with the
   return value from them fourth parameter. This can also be used as
   loop variable, if needed.
3) A value to initialize the return variable. This could be from
   calling a procedure to perform other initializations.
4) A procedure to run for each loop

For example, print the values of each item in a list:
SetVariable( { V listVar },
         AddHead( { I 1 },
            AddHead( { I 2 },
              AddHead( { I 3 },
                       CreatList() ) ) ),
         While( Greater( GetCount( { V listVar } ), { I 0 } ),
                { V retVal },
                { I 0 },
                DebugValue( { S \"Value: \" },
                            RemHead( { V listVar } ) ) ) )

    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/WriteAttributeInstance.xml
22:    <name>WriteAttributeInstance</name>
procedure description
This procedure is used to write a value to an attribute instance of a model.

The parameter are:
1) The model handle
2) The attribute ID
3) The instance OID
4) The new attribute value

The type of the new attribute value must be compatible with the
attribute's type, otherwise the operation will fail.
    </description>
###########################################################################################
$SPECROOT/SS/CsVendor/CA/Procedures/WriteAttribute.xml
22:    <name>WriteAttribute</name>
procedure description
This procedure is used to write a value to an attribute of a model.

The parameter are:
1) The model handle
2) The attribute ID
3) The new attribute value

The type of the new attribute value must be compatible with the
attribute's type, otherwise the operation will fail.
    </description>