User Defined Collection in Foglight 5.6.5 for DB2 Database

Hi
I have configured the UDC as per the last mail from Ken Eio. I have attached the screenshot of the UDC.
1) I have created UDC as per UDC_Creation screenshot.
2) When the table went under REORG PENDING status this query ran from the foglight and get the output as UDC_Query_output screenshot in which i will get reorg_pending field as "Y" means Yes the mentioned table in schema_table field is in reorg pending state.
3) Now I have set the Rules from the Add Rule tab in Rules & Notification.
4) Refer Rules_Definition screenshot where I ahve created the rule name.
5) Than I have created variable refer Rules_variables screenshot.
6) I have given the condition as Critical one in Condition, alarms tab refer Conditions Screenshot.
Please let me know whether my condition will throw the critical alram with message and do i will get the mail also for the same? My concern is whenever the table get the output as "Y" than i should get the alarm with DBname Schema name and table name i.e. on which schema.table name need reorg.

Thanks

  • Hello Dalip,

    I will ask:

    1. You wish to see an email generated if your custom rule enters a Critical alarm state.  Have you already set up an email action for the Critical severity?
    2. Have you validated the rule Condition that is shown in the screen shot (by clicking the green check button)?
    3. Have you checked the value of "#status#" using the Run Condition Query window?   I am curious if you considered checking the value of #reorg_pending# from the UDC in that rule condition instead of the "status".  If the value of the reorg_pending column is "Y", is that the condition you are looking for to trigger the critical alarm?   

    Please share your answers to those, as they will assist those who would like to help you in this forum.

    Thank you,

    Tim Fritz

    Dell Software

     

  • Hi Tim,

    1. I have set up an email action for the critical severity but don't know how to set up for UDC.
    2. I have validated the rule condition by clicking on green check button and changed the #status# to #reorg_pending#. Refer attached screenshot.
    3. I have checked the query in run condition query window I got an error message mentioned below:

    com.quest.nitro.service.scripting.errors.noisy.OptionalDataMissingScriptServerException: reorg_pending (script: a644189dc992ab2bf5ba911a58382d67)


  • Yes I am looking for critical alarm to trigger when reorg_pending column as "Y" and I should get an email in my mail box.

  • Hi Dalip,

    Please try the Run Condition Query with just #reorg_pending# as the query.  Does it return a value?

    Thanks,

    Tim Fritz

  • It returned a error messgae:

    com.quest.nitro.service.sl.interfaces.scripting.ScriptingException: com.quest.nitro.service.sl.interfaces.scripting.ScriptUndefinedObservationException: undefined observation (present but empty observed data for topology object b06b31b5-a9a7-43e5-910b-1e7c3b34502e) in query: reorg_pending ----script start------ #reorg_pending# ---- script end ------

  • Hi

    Please try the following:

    1. Replace the return code to: “return condition”, instead of: “return Dbwc_common_SQL_Server_IsNeedToSendAlarm”…
    2. Use the “Run Condition Query” when new data is pushed and an alarm could be triggered (the query will work since there will be data).

    Regards

    Anat

  • Hi Anat,

    I got the below error message:

    com.quest.nitro.service.scripting.errors.noisy.OptionalDataMissingScriptServerException: reorg_pending (script: 6905eb7546bbc0947a498b1d969498de)


  • In reply to dalip.singh:

    Hi Dalip,

    I was having the same trouble with a slightly different query. I was trying to query the state of an oracle job and alert on it.

    My initial SQL query for the UDC was:

    ------------------

    SELECT job_name,

    state,

    CASE state

    WHEN 'SUCCEEDED' THEN '0'

    WHEN 'COMPLETED' THEN '0'

    WHEN 'RUNNING' THEN '0'

    WHEN 'SCHEDULED' THEN '0'

    WHEN 'DISABLED' THEN '0'

    WHEN 'BROKEN' THEN '1'

    WHEN 'RETY SCHEDULED' THEN '1'

    WHEN 'FAILED' THEN '2'

    END AS STATUSTEXT

    FROM dba_scheduler_jobs

    WHERE job_name ='SomeSqlJob'

    -----------------

    I was getting exactly the same errors in the Run Condition Query box when checking for the variable as you were.

    I changed my SQL query to be more specific about the states assigning more specific values so my next (and successful attempt at this) version was:

    ------------------

    SELECT job_name,

    state,

    CASE state

    WHEN 'SUCCEEDED' THEN '1'

    WHEN 'COMPLETED' THEN '2'

    WHEN 'RUNNING' THEN '3'

    WHEN 'SCHEDULED' THEN '4'

    WHEN 'RETY SCHEDULED' THEN '5'

    WHEN 'FAILED' THEN '6'

    WHEN 'BROKEN' THEN '50'

    WHEN 'DISABLED' THEN '99'

    END AS STATUSTEXT

    FROM dba_scheduler_jobs

    WHERE job_name ='SomeSqlJob'

    ------------------

    I then set up my rule conditions as follows:

    Foglight Rule Conditions

    Fatal:

    condition=false;

    if (#statustext# == 6)

    condition=true;

    return condition;

    Critical:

    condition=false;

    if (#statustext# > 6)

    condition=true;

    return condition;

    Warning:

    condition=false;

    if (#statustext# == 5)

    condition=true;

    return condition;

    Normal:

    condition=false;
    if (#statustext# < 5)
    condition=true;
    return condition;

     

    Initially when my query had only run once the condition query returned correct values like true and false. After the query had run a couple of times i started getting scriptserverexception errors.

    Note: When running multiple queries for data you can occiasionally get the following output:

    com.quest.nitro.service.scripting.errors.noisy.OptionalDataMissingScriptServerException: statustext (script: 4350a5e56bd21b33d80ccd024813ceb2)

    This is also seen in different parts of Foglight on agents where an agent has queried a value and the value hasn't changed and is apparently normal behavior. I do need to check this with Quest however.