Creating a Command Event

From SEPsesam
Revision as of 13:16, 6 August 2020 by Sta (talk | contribs) (Fixed heading levels and excluded items from print for SBA book.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Other languages:
Deutsch • ‎English

Copyright © SEP AG 1999-2020. All rights reserved.

Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.

Docs latest icon.png Welcome to the latest SEP sesam documentation version 4.4.3/4.4.3 Beefalo V2. For previous documentation version(s), check Documentation archive.


Overview

A command event allows the execution of an arbitrary program on a SEP sesam Client. As of SEP sesam version 4.4.2, new command events can be scheduled to run automatically.

Steps

  1. In the Main Selection -> Scheduling -> Schedules, select the schedule to which you would like to add a command event. Right-click it and select New Command Event. The New Command Event window is displayed.
    Note that if you have not configured a schedule yet, you have to configure it first by clicking the New Schedule button in the Schedules window. For details, see Creating a Schedule.
    New command event Beefalo.jpg
  2. Under the Parameter tab, specify the following settings:
    • Priority: Optionally, define a priority for the command event. SEPuler always executes schedules with higher priority first. The default priority level is 1, which is the lowest priority (the highest is 99). The highest priority level is 99. The only exceptions are schedules with priority 0, which override all other priorities and are always executed. For details, see Event Priority.
    • Blocking date: This should be used together with high priority for special events. If checked, it will block events of the same type of a lower priority, ensuring that the command event is processed when other command events are also scheduled at the same time. See Blocking Events.
    • Name: Enter a name for the new event or search for and select an already existing command event. Searching for command by clicking the Choose button opens a new window, where you can add a new command event, copy an already existing command event, select which existing command event you want to use again by clicking the Select button, and change or delete an existing command event.
      Select command Beefalo.jpg
    • Client: Select a client on which the command will be executed.
    • User: Enter the user name of a user with sufficient access to execute the command on the client.
    • Retention time: Specify for how long (in days) the command event results and logs will be kept.
    • Command: Enter the complete command. In v. < 4.4.3 Beefalo, you can also add here the additional parameters to command, if required.
    • Add to command (available in v. ≥ 4.4.3 Beefalo): Optionally, add additional parameters to command, e.g., sm_sho.
  3. Click OK to add your command event to a schedule. You can review your schedules and assigned events, trigger immediate start of events or delete them by right-clicking the selected schedule/event.
SEP Tip.png Tip

You can also access the configured commands from the Menu bar -> Configuration -> Command.

Setting permission to execute commands

Not every user on a specific client is authorized to execute all commands. Without additional entries authorizing selected users to run specific commands, the commands can only be run from the <SESAM_ROOT>/bin/sesam system directory. If a command should be started from another directory before the regular backup starts, this must be entered/permitted at the target client.

UNIX

Copy the file sesam_cmdusers.allow from the <SESAM_ROOT>/skel directory to /etc on the client and modify the file. You will now be able to enter a line for the user and command using the {user} {command} format. If you use a wildcard (*), all commands will be executed.

No explicit permissions are required to execute SEP sesam commands such as sm_loader.

Windows

To set access rights for the user and command, use the following key: \\HKLM\SOFTWARE\SEP Elektronik GmbH\sesam\CommandEvents\<user>\<command>

Additionally on the client computer the entry CTRLD_Path=ID/bin/sesam;ID/bin/sms in the file ID/var/ini/sm.ini in section [CTRLD_Server] must be extended with the directories where the desired programs reside.

  1. Open the Regedit editor.
  2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\SEP Elektronik GmbH\sesam\ and create a new key called CommandEvents. If it does not already exist, right click and select New Key.
  3. Enter <user> and then <command> with the full path information as the key.

The available commands are:

Command Execution
* all instructions
cmd /c all DOS commands (dir, etc.)
DOS command (e.g., dir) only specific DOS command (e.g., dir)
specific command (e.g., ping) only specific command (e.g., ping)

If there are any other commands present, the last command will be executed. If you use a wildcard (*), all commands will be executed.

Registryentry.JPG

Below is an example of a registry file (*.reg) that allows all command events for the administrator and sesam user:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\SEP Elektronik GmbH\sesam\CommandEvents\sesam\*]
[HKEY_LOCAL_MACHINE\SOFTWARE\SEP Elektronik GmbH\sesam\CommandEvents\Administrator\*]

Information sign.png Note

The most common errors when setting up the desired user permissions and allowed commands are:

  • The necessary entries are not entered in the target client directories, not entered on the server or are entered incorrectly.
  • Instead of entering a command as a key, it is entered as a character string.