Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Sanity Check Index DDL scrips
Arguments Source

RHN_SYNCH_PROBE_STATE

Arguments:

None

DDL script

Source

Legend: comment string keyword reserved word operator
     1: PROCEDURE rhn_synch_probe_state
     2: is
     3: begin
     4:     update
     5:         rhn_probe_state
     6:     set state = 'PENDING',
     7:         output = 'Awaiting update'
     8:     where last_check < (
     9:         select (
    10:             sysdate - greatest(15 / 60 / 24,
    11:             ((3 * rhn_deployed_probe.check_interval_minutes) / 60 / 24)))
    12:         from rhn_deployed_probe
    13:         where rhn_deployed_probe.recid = rhn_probe_state.probe_id
    14:     );
    15:     update rhn_multi_scout_threshold t
    16:     set (scout_warning_threshold, scout_critical_threshold)=(
    17:         select
    18:             decode(scout_warning_threshold_is_all,0,
    19:                 scout_warning_threshold,count(scout_id)),
    20:             decode(scout_crit_threshold_is_all,0,
    21:                 scout_critical_threshold,count(scout_id))
    22:         from rhn_probe_state p
    23:         where t.probe_id=p.probe_id
    24:           and state in ('OK', 'WARNING', 'CRITICAL')
    25:         group by t.probe_id
    26:     );
    27: end rhn_synch_probe_state;