Ignore:
Timestamp:
Mar 4, 2015, 10:28:25 AM (11 years ago)
Author:
Herwig Bauernfeind
Message:

GUITools: SSCC (Ticket #248), SMBMon (TDB Check page), EVFSGUI, shared library updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/guitools/smbmon/smbmon.vrx

    r869 r875  
    9797*/
    9898return
     99/*:VRX         _ChkTDB
     100*/
     101_ChkTDB:
     102
     103ok = SysFileTree(etc'\samba\lock\*.TDB',tdb.,'FO')
     104say etc'\samba\lock\*.TDB  'tdb.0
     105
     106error = 0
     107ok = VRMethod("CN_CHKTDB", "RemoveRecord", "ALL")
     108
     109do I = 1 to tdb.0
     110    RecHandle = VRMethod("CN_CHKTDB", "Addrecord")
     111    TDBFile =left(filespec('N',tdb.I), 22)
     112    ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBFilesFH, TDBFile, ChkTDBIconFH, "$50" )
     113    address cmd '@tdbtool 'tdb.I' check 2>'tdb.I'.err 1>'tdb.I'.out'
     114    out = linein(tdb.I'.out')
     115    ok = stream(tdb.I'.out','c','close')
     116    say out
     117    if pos('integrity is OK',out) > 0 then do /* integrity is ok */
     118        ok = SysFileDelete(tdb.I'.err')
     119        ok = SysFileDelete(tdb.I'.out')
     120        out = left(out,length(out)-1)
     121        TDBRecords = substr(out, pos("and has", out) + 7,)
     122        ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBStatusFH, TDBRecords )
     123
     124        address cmd '@tdbbackup -s.bak 'tdb.I' 2>NUL 1>NUL'
     125    end
     126    else do /* tdb error */
     127        ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBIconFH, "$51" )
     128        error = 1
     129        count = 0
     130        out = ""
     131        do while lines(tdb.I'.err') > 0 & count < 5
     132            errline = linein(tdb.I'.err')
     133            select
     134                /* skip unnecessary lines of log */
     135                when pos("bww ",errline) > 0 then iterate
     136                when pos("fcntl",errline) > 0 then iterate
     137                otherwise do
     138                    out = out||errline'. '
     139                    count = count + 1
     140                end
     141            end
     142        end
     143        ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBStatusFH, out )
     144        ok = stream(tdb.I'.err','c','close')
     145    end
     146
     147/*
     148    call charout , left(filespec('N',tdb.I), 22)
     149    address cmd '@tdbtool 'tdb.I' check 2>'tdb.I'.err 1>'tdb.I'.out'
     150    out = linein(tdb.I'.out')
     151    ok = stream(tdb.I'.out','c','close')
     152    say out
     153    if pos('integrity is OK',out) = 0 then do
     154        call beep 880, 20
     155        address cmd '@tdbbackup -s.bak -v 'tdb.I' 2>NUL 1>NUL'
     156        error = 1
     157        count = 0
     158        do while lines(tdb.I'.err') > 0 & count < 5
     159            errline = linein(tdb.I'.err')
     160            select
     161                /* skip unnecessary lines of log */
     162                when pos("bww ",errline) > 0 then iterate
     163                when pos("fcntl",errline) > 0 then iterate
     164                otherwise do
     165                    say right(copies(' ',22)'Cause: 'errline'!',min(length(errline)+22,79))
     166                    count = count + 1
     167                end
     168            end
     169        end
     170        ok = stream(tdb.I'.err','c','close')
     171    end
     172    else do
     173        ok = SysFileDelete(tdb.I'.err')
     174        ok = SysFileDelete(tdb.I'.out')
     175        address cmd '@tdbbackup -s.bak 'tdb.I' 2>NUL 1>NUL'
     176    end */
     177end
     178
     179return
     180
    99181/*:VRX         _ColumnShow
    100182*/
     
    165247    DStatusFH  = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(146) )
    166248    DPidsFH    = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(130) )
     249
     250    /* chktdb */
     251    ChkTDBFilesFH = VRMethod( "CN_CHKTDB", "AddField", "String", NLVGetMessage(134) )
     252    ChkTDBIconFH  = VRMethod( "CN_CHKTDB", "AddField", "Icon",   NLVGetMessage(146) )
     253    ChkTDBStatusFH= VRMethod( "CN_CHKTDB", "AddField", "String", NLVGetMessage(151) )
    167254
    168255    /* Browse tree */
     
    11621249    ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(17)" ")
    11631250
     1251    w = VRLoad( "TDL_1", VRWindowPath(), "SW_CHKTDB" )
     1252    ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(22)" ")
     1253
    11641254    w = VRLoad( "TDL_1", VRWindowPath(), "SW_SETTINGS" )
    11651255    ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(24)" ")
     1256
     1257
    11661258    IF options.!debug == 1 THEN SAY time()' _TabbedDialogSetup done'
    11671259return
     
    12601352    WPSStartStop = VRGet("CB_WPSStartStop","set")
    12611353    say 'WPSStartStop = "'WPSStartStop'"'
     1354return
     1355
     1356/*:VRX         CN_CHKTDB_ContextMenu
     1357*/
     1358CN_CHKTDB_ContextMenu:
     1359    if VRInfo("Top") < 400 & VRGet("CN_Files", "View") = "Detail" then call _ColumnsMenu "CN_Files"
     1360    else do
     1361        RH = VRInfo("Record")
     1362        OH = VRInfo("Object")
     1363        if RH <> "" then do
     1364            ok = VRMethod( "Contextmenu_Files", "Popup", , , "", "PositionOnItem" )
     1365        end
     1366    end
    12621367return
    12631368
     
    18411946    ok = VRSet("PB_Cancel", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 1))
    18421947
     1948    ok = VRset("GB_CHKTDB","Top",    margin  )
     1949    ok = VRset("GB_CHKTDB","Left",   marginx2)
     1950    ok = VRset("GB_CHKTDB","Width",  pane_width - 760)
     1951    ok = VRset("GB_CHKTDB","Height", pane_height- 1020)
     1952    ok = VRset("CN_CHKTDB","Top",    margin)
     1953    ok = VRset("CN_CHKTDB","Left",   margin)
     1954    ok = VRset("CN_CHKTDB","Width",  pane_width - 760 - marginx2 )
     1955    ok = VRset("CN_CHKTDB","Height", pane_height- 1020- marginx2 )
     1956
    18431957    ok = VRset("GB_USERS","Top",    margin  )
    18441958    ok = VRset("GB_USERS","Left",   marginx2)
     
    20432157
    20442158    say "  CurrentPageNr = "CurrentPageNr
    2045 
    2046     if CurrentPageNr = 2 then do
    2047         ok = VRset("Pict_Throbber", "Visible", 1)
    2048         ok = VRset("TM_Throbber", "Enabled", 1)
    2049         call _RefreshTree
    2050     end
    2051     else call _Refresh
     2159    select
     2160        when CurrentPageNr = 2 then do
     2161            ok = VRset("Pict_Throbber", "Visible", 1)
     2162            ok = VRset("TM_Throbber", "Enabled", 1)
     2163            call _RefreshTree
     2164        end
     2165        when CurrentPageNr = 6 then do
     2166            call _ChkTDB
     2167        end
     2168        otherwise call _Refresh
     2169    end
    20522170    IF options.!debug == 1 then say time()' PB_Refresh_Click() done'
    20532171return
     
    22242342return
    22252343
     2344/*:VRX         SW_CHKTDB_Close
     2345*/
     2346SW_CHKTDB_Close:
     2347    call SW_CHKTDB_Fini
     2348return
     2349
     2350/*:VRX         SW_CHKTDB_Create
     2351*/
     2352SW_CHKTDB_Create:
     2353    call SW_CHKTDB_Init
     2354return
     2355
     2356/*:VRX         SW_CHKTDB_Fini
     2357*/
     2358SW_CHKTDB_Fini:
     2359    window = VRInfo( "Window" )
     2360    call VRDestroy window
     2361    drop window
     2362return
     2363/*:VRX         SW_CHKTDB_Init
     2364*/
     2365SW_CHKTDB_Init:
     2366    window = VRInfo( "Object" )
     2367    if( \VRIsChildOf( window, "Notebook" ) ) then do
     2368        call VRMethod window, "CenterWindow"
     2369        call VRSet window, "Visible", 1
     2370        call VRMethod window, "Activate"
     2371    end
     2372    drop window
     2373return
     2374
    22262375/*:VRX         SW_DAEMONS_Close
    22272376*/
     
    24992648            nop
    25002649        end
    2501         when page = 6 then do /* Settings */
     2650        when page = 6 then do /* chkTDB */
     2651            say "ChkTDB"
     2652            call _ChkTDB
     2653        end
     2654        when page = 7 then do /* Settings */
    25022655            nop
    25032656        end
Note: See TracChangeset for help on using the changeset viewer.