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 is appreciated.

Thanks and Regards,

 

  • 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!

  • hey

    run a cron or task schedule job to check for this - and if suspended send an email??

    command to use and parse its output

    nbpemreq -subsystems screen 30

     

    • albatroz19's avatar
      albatroz19
      Level 5

      Hi,
      thanks for answer, but we don't use email from primary, and i would not use a crontab job , but monitor something that alert me if the scheduler is paused, like snmp trap.

      Any other suggestion?

      • VerJD's avatar
        VerJD
        Level 4

        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!