When using underscore “_” in combining variables as part of the alarm message, the underscore is removed
$1 = ServerName
$2 = StatusMessage
We are expecting below result
But instead the following is happening.
SNMPTD probe 3.30
Set a profile with
Enterprise ($E), $TRAP_DESCR - TEST $1_$2
The underscore is stripped out of the alarm message
It seems that when underscore is by itself it becomes stripped.
This is by design. The underscore character is considered a variable add-on which means $1_ and $1 are the same, but any character appended to the $ variable other than this that is non-alphanumeric would work as you would expect.
For instance, $1/ is not same as $1_
Underscore is a valid symbol used in lot of variable names like binary_path, proc_cmd_line, value_last etc. So it cannot be used as a separator otherwise there is no way for probe/UIM components to distinguish whether underscore is part of variable name or it is used just to separate two variables.
Use any other symbol to separate the two variables like Space, Hyphen (-), Colon (:), Dot (.) or Dot followed by underscore (._). All of them are going to work without any issues.
The design is part of a common library which other probes also use like the processes probe. Changing the common library to suit this purpose would affect other probes.