Forum Discussion

1 Reply

  • Hi Prajwal,

    use the iCall script below as a startingpoint...

    sys icall script Report_Empty_Datagroups {
        app-service none
        definition {
            tmsh::cd "/Common"
            foreach datagroup [tmsh::get_config /ltm data-group internal] {
                if { [catch {
                    if { [tmsh::get_field_value $datagroup "records"] ne "" } then {
                         tmsh::log "iCall: The data-group \"[tmsh::get_name $datagroup]\" has records."
                    } 
                }] } then {
                    tmsh::log "iCall: The data-group \"[tmsh::get_name $datagroup]\" is empty"
                }
            }
        }
        description none
        events none
    }
    sys icall handler periodic Report_Empty_Datagroups {
        first-occurrence 2016-08-15:00:00:00
        interval 5
        script Report_Empty_Datagroups
    }
    

    Note: The provided script tries to

    [tmsh::get_field_value]
    the
    record { }
    section of each single data-group. If this command fails the
    [catch]
    exemption is getting fired and you know that the data-group is empty...

    Cheers, Kai