cancel
Showing results for 
Search instead for 
Did you mean: 

Offline Clients

H_Sharma
Level 6

Hello Experts,

We have put many clients on offline mode. So is there any command that can show how many clients are in offline?

Because in GUI to check in client attributes its taking time :(

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions

sdo
Moderator
Moderator
Partner    VIP    Certified
unix: bpclient -All -L | grep -i "offline" | wc -l windows bpclient -All -L | find /i /c "offline"

View solution in original post

5 REPLIES 5

Marianne
Level 6
Partner    VIP    Accredited Certified
Read up in Commands manual about bpclient command. Similar to the GUI where you need to select each client name, bpclient command also needs client name. In this case the GUI will probably be faster because you can see the list of client names. PS: If you are managing a large environment, there should be a change control system in place where all changes are recorded along with reasons and expected outcome.

pete_4u2002
Level 5
Employee Accredited

sorry, i misunderstood it for SEP.

sdo
Moderator
Moderator
Partner    VIP    Certified
unix: bpclient -All -L | grep -i "offline" | wc -l windows bpclient -All -L | find /i /c "offline"

H_Sharma
Level 6

c:\Program Files\Veritas\NetBackup\bin\admincmd>bpclient -All -L | find /i /c "o
ffline"
68

its showing only count not the name :)

sdo
Moderator
Moderator
Partner    VIP    Certified

Drop the following in to a file named, e.g., "list-offline-clients.bat", and either double click it, or run it from a DOS/cmd box.

@echo off
setlocal enabledelayedexpansion

set z_path=%~dp0
set z_name=%~n0

set z_file_log=!z_path!!z_name!.log
set z_file_tmp=!z_path!!z_name!.tmp

call :log ""
call :log ""
call :log "Script started..."

set z_bpclient_exe=C:\Program Files\Veritas\NetBackup\bin\admincmd\bpclient.exe

if not exist "!z_bpclient_exe!" (
  call :log "Unable to locate executable `!z_bpclient_exe!`..."
  goto :end
)

"!z_bpclient_exe!" -All -L >"!z_file_tmp!"

set /a z_count_offline=0

for /f "tokens=1,2,3" %%a in ('type "!z_file_tmp!"') do (
  if /i "%%a %%b"=="Client Name:"  set z_client_name=%%c
  if /i "%%a %%b"=="Offline: Yes" (
    set /a z_count_offline+=1
    call :log "Offline client:  !z_client_name!"
  )
)

call :log ""
call :log "Found `!z_count_offline!` offline clients..."

:end
call :log ""
call :log "Script completed..."
echo+
pause
exit /b

:log
(echo !date! !time:~0,8!  %~1)
(echo !date! !time:~0,8!  %~1)>>"!z_file_log!"
goto :eof

HTH.