Need help with trying to mod a alert rule using Groovy using perl

Hello, the stock rule just alerts on high tbl space and sends email to support. But it does it for all tbl spaces. Need to exclude from the alerting all table spaces that end in TEMP and all that begin with UNDO. The below syntax is bad according to the checker. I was hoping to use Perl's pattern-binding operator. This is my first attempt at modifying a rule so didnt expect it to work right off. but I don't want to have to itemize each tablespace in a list and then spin through the list in a if statement. Is there a way to get the below code to work? I put my mods to the stock rule in red below.   DBO - Tablespace Used Percentage  (cartridge   DB_ORACLE_UI)

//Custom Rule to exclude tablespaces that don't need to be alerted on
// 072919  sjb  New
condition = (#DBO_allocated_space_used_pct_for_rules# >= registry("DBO_TablespaceStorage-AllocatedUsedPct_High")) && @tablespaceName !~ /TEMP$/ && @tablespaceName !~ /^UNDO/ ;
return DBWC_RacAndSingleInstanceRuleFilter(scope, "DBO - Tablespace Used Percentage", "4", condition);

Parents
  • Hello,

    please change the scope of the rule to exclude tablespaces, do not change the condition.

    See screen shot below. Click on the tab "Rule Definition" and in the bottom you see the rule scope which should DBO_Tablespace. Here you can exclude tables spaces. For example:

    DBO_Tablespace where name != 'TEMP'

    When clicking on the green check mark button you will get a list of all objects in the scope. Here you can check if you where clause is matching properly

    You can use wild cards like %, but then you cannot work with the equal sign "=". The please use "like" or "!like". For example:

    DBO_Tablespace where name !like' TE%'

    Does that help?

    Regards

    Nicola

Reply
  • Hello,

    please change the scope of the rule to exclude tablespaces, do not change the condition.

    See screen shot below. Click on the tab "Rule Definition" and in the bottom you see the rule scope which should DBO_Tablespace. Here you can exclude tables spaces. For example:

    DBO_Tablespace where name != 'TEMP'

    When clicking on the green check mark button you will get a list of all objects in the scope. Here you can check if you where clause is matching properly

    You can use wild cards like %, but then you cannot work with the equal sign "=". The please use "like" or "!like". For example:

    DBO_Tablespace where name !like' TE%'

    Does that help?

    Regards

    Nicola

Children