Skip to main content

NightWatchman Enterprise 7.3

Configuring the 1E NightWatchman Agent

The NightWatchman Agent has four key areas that can be managed:

  • Scheduling power-offs

  • Defining the actions taken to log-off a user

  • Creating or modifying power-off scripts

  • Setting the actions taken to power-off the machine

As the administrator, you can schedule the system to shut down at a certain time on certain days of the week. You, or the end-user, can also request an immediate power-off.

If there are users logged on the system when a power-off is initiated, the log-off action takes place. If not, NightWatchman proceeds directly to the power-off stage.

Note

If a computer is already in standby or hibernate mode, it will not be woken to shut it down.

There are three log-off modes that can be set:

  • Passive – if users are logged on, no attempt will be made to shut down.

  • Active – users are asked if the power-off is allowed to continue.

  • Force – users are notified that a power-off is about to take place and will be logged off once the countdown expires.

You can set a countdown for a power-off, so in Active and Force modes, users see a countdown to the event. In Active mode, the user has the option to cancel the power-off or enable the event by clicking OK. If the user postpones the event, NightWatchman can be set to retry again later.

If the modes are Active or Force, NightWatchman runs the power-off scripts. The four scripts which enable administrators to power down computers are:

To learn more about scripting NightWatchman, see configuring NightWatchman scripts and scripting reference.

NightWatchman power schemes and reporting data

NightWatchman automatically configures the power scheme to enable processor speed and voltage to vary automatically with system usage, specifically for machines using Intel speed step processors or AMD Cool n' Quiet processors. This results in enhanced energy saving on machines with low average utilization (most office productivity machines). On Windows 7, this involves the creation of a new NightWatchman power scheme based on the Balanced Power Scheme.

From the point of installation, NightWatchman reports inventory and power state data for its local computer back to the reporting server. The inventory information includes:

  • the computer name

  • the computer's domain

  • IP address and subnet

  • its network card MAC Address

  • the chassis model, type and manufacturer.

Power state data shows how long the computer is in a particular power state and is used in conjunction with associated typical power consumption information to calculate how much power the computer is consuming throughout the day. Inventory information helps identify the computer and determine any information related to its type, such as its typical power consumption figures.

The NightWatchman Management Center Console lets you define:

  • Location groups – enables you to model your company according to the physical location of the computers. You can report on and apply location specific power settings to computers according to where they reside. For example, if you know of a forthcoming national holiday, you can apply a one-off policy that sets particular power settings for that specific location only. You can also use these groups to apply specific localized tariffs that increase the accuracy of power cost reports.

  • Organization groups – enables you to model your company according to organizational units. You can report on and apply specific power settings to computers according to where they sit in the organization. For example, if you know of an off-site team building exercise for a particular department, you can apply a one-off policy that sets particular power settings for that department only.

NightWatchman pre-event tests

When a scheduled power-down event is triggered (and before the Hibernate, Standby, power-off or Reboot events starts), NightWatchman runs the following tests:

Test

Description

Passive

If logoffaction=Passive, check to see if users are currently logged on to the computer. If found, cancel the scheduled event.

Last man standing

Check to see if the computer is set to be last man standing. If so, cancel the scheduled event.

Note

Windows only test.

User activity

Check for user activity, If found, cancel the scheduled event. This test is not performed if:

  • the power-off has been initiated from the user interface.

  • useractivitymaxidlemins=0

  • logoffaction=Force

Exception list

Check to see if any processes on the process exception list are currently running. If so, cancel the scheduled event.

Configuration Manager running jobs

If Configuration Manager client exists and monitorjobs=ON, check for currently running jobs. If found, cancel the scheduled event.

Note

If the computer is a laptop running on batteries, this test is by-passed and the scheduled event is allowed to proceed regardless.

Configuration Manager pending jobs

If Configuration Manager client exists and monitorjobs=ON and pendingjobwindowmins is set, check for pending jobs. If found, cancel the scheduled event.

Note

If the computer is a laptop running on batteries, this test is by-passed and the scheduled event is allowed to proceed regardless

Nomad in-progress file transfers

Check to see if the computer is acting as the Nomad P2P master. If so, cancel the scheduled event.

Nomad PBA content found

Check to see if the computer has content that Nomad is holding as part of its Peer-Backup Assistant functionality. If so, cancel the scheduled event.

Keep active status

Check the Keep Active status on the NightWatchman user interface. If set, cancel the scheduled event.

Active maintenance window

If a NightWatchman maintenance window is active, cancel the scheduled event.

Because the 1E Agent will cancel a scheduled power down event when there are pending or running Microsoft Configuration Manager jobs, it is recommended to set logoffaction=FORCE when attempting to power down a computer after successfully running a Configuration Manager software distribution Advertisement.

An alternative would be to use the NightWatchman command-line and set a once-off power down with logoffaction set to ACTIVE or PASSIVE to power down the computer at a specific time and let it retry until the Advertisement has finished running.

NightWatchman events

The following takes place when a NightWatchman event is triggered.

Event

Sequence

Hibernate or stand-by

  1. Run the pre-run script (PRERUN on Windows and PreRun.scpt on macOS).

    • If the script returns zero, continue with the event.

    • If the script returns a non-zero value, cancel the event.

  2. Display the countdown dialog.

    • If logoffaction=Active, the user gets the option to postpone the event.

    • If logoffaction=Force, the user has no option of postpone and the event takes place once the countdown expires.

  3. Run the RunAlways script (RUNALWAYS.vbs on Windosw and RunAlways.scpt on macOS).

    • If the script returns zero, continue with the event.

    • If the script returns a non-zero value, cancel the event.

  4. Put the machine into hibernate of standby.

    • The machine suspends

Power-off or reboot

  1. Run the pre-run script (PRERUN.vbs on Windows and PreRun.scpt on macOS)

    • If the script returns zero, continue with the event.

    • If the script returns a non-zero value, cancel the event.

  2. Display the countdown dialog.

    • If logoffaction=Active, the user gets the option to postpone the event.

    • If logoffaction=Force, the user has no option of postpone and the event takes place once the countdown expires.

  3. Run the NightWatchman scripts.

    • Close any open applications and save data.

  4. Run the RunAlways script (RUNALWAYS.vbs on Windows and RunAlways.scpt on macOS).

    • If the script returns zero, continue with the event.

    • If the script returns a non-zero value, cancel the event.

  5. Check for script errors.

    • If logoffaction is set to Force, NightWatchman shuts the machine down regardless of the script errors. If ignoreerrors on Windows or ignorescripterrors on Mac is set and script errors are found, NightWatchman will not power-off or reboot the machine but will lock the it to make it secure.

  6. Log-off all current users.

  7. Once all client sessions have been closed, power-off of reboot the computer.

Resume from a low-power state

  • Run the resume script (RunOnResume.vbs on Windows and RunOnResume.scpt. on macOS).

To learn how to configure NightWatchman or modify its scripts, see configuring NightWatchman. To learn about the switches that control NightWatchman functionality, see command-line switches.

End-user actions

When you enable the NightWatchman system tray interface, the end-user can:

  1. Keep their computer active by opting out of passive or active NightWatchman power-offs for a period of time.

  2. Initiate a local power-off.

  3. View the list of files backed-up during the last log-off process.

You may also want to audit end-user interaction with the NightWatchman backup dialog and resolve issues with backups that occasionally do not appear in the backup list. The 1E Agent tracks basic end-user choices when selecting the Save or Reject options in the Backup Dialog.

For each file that the user chooses to accept or reject, an entry is added to NWMAudit.log, which is created in the per-user NightWatchman data folder. for example, C:\Users\joey.malloy\AppData\Local\1E\NightWatchman.

Each entry indicates the time of the operation, the original document name, whether the user chose to Keep or Reject the file and, where applicable, the name of the file that the backup was saved to.