Forum Discussion

albatroz19's avatar
albatroz19
Level 5
2 years ago

Monitoring nbpemreq command

Hi, is there a chance to monitoring nbpemreq -suspend_scheduling operation, in order to avoid someone disable schedule and then forget to reactivate, and we risk to loose new backup? Any suggest ...
  • VerJD's avatar
    VerJD
    2 years ago

    Hi albatroz19 

    You may have to create a script that periodically runs on the server to check if scheduling is suspended (disabled), if it's disabled then resume scheduling (enabled).

    The following KB article shows the outputs you would need to look for...

    To check scheduled backups are suspended / disabled:
    # /usr/openv/netbackup/bin/admincmd/nbpemreq -subsystems screen all | grep -i Scheduling | grep disabled
    Scheduling disabled via external command

    On Linux:
    Here's an example of a bash script for you, that you can use for testing to hopefully accomplish this task:

    #!/bin/bash
    output=$(/usr/openv/netbackup/bin/admincmd/nbpemreq -subsystems screen all | grep -i Scheduling | grep disabled)
    if [[ $output == *"disabled"* ]]; then
        /usr/openv/netbackup/bin/admincmd/nbpemreq -resume_scheduling
    fi

    This script checks the filtered output of the nbpemreq -subsystems screen all command for the word disabled and if it is found, it runs the nbpemreq -resume_scheduling command to resume scheduling.

    You can save this script to a file, for example check_nbpemreq.sh, and make it executable by running the command chmod +x check_nbpemreq.sh. You can then run the script by calling ./check_nbpemreq.sh, or use the Linux cron utility to schedule the Bash script to run at the desired frequency.

    On Windows:
    Otherwise, for any NetBackup Windows server admins, the same thing could be tested with this example batch script:

    @echo off
    for /f "tokens=2" %%a in ('"install_path\Veritas\NetBackup\bin\admincmd\nbpemreq" -subsystems screen all | findstr Scheduling | findstr disabled') do (
    if "%%a"=="disabled" (
    "install_path\Veritas\NetBackup\bin\admincmd\nbpemreq" -resume_scheduling
    )
    )

    Note: Make sure to replace install_path with the actual installation path of NetBackup on your system (e.g. default path C:\Program Files\Veritas).

    You can save this script to a file, for example check_nbpemreq.bat, and run it by double-clicking on the file, calling it from the command prompt, or use the Windows Task Scheduler to run the batch script at the desired frequency. Hope that helps!