FVNever.Nightwatch.Core 0.1.1

dotnet add package FVNever.Nightwatch.Core --version 0.1.1
                    
NuGet\Install-Package FVNever.Nightwatch.Core -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FVNever.Nightwatch.Core" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FVNever.Nightwatch.Core" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="FVNever.Nightwatch.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FVNever.Nightwatch.Core --version 0.1.1
                    
#r "nuget: FVNever.Nightwatch.Core, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FVNever.Nightwatch.Core@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FVNever.Nightwatch.Core&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=FVNever.Nightwatch.Core&version=0.1.1
                    
Install as a Cake Tool

Nightwatch Status Ventis

Nightwatch is a monitoring service intended to monitor daily and nightly activities and notify the administrator if something wrong happens.

Packages

Package NuGet
Nightwatch Nightwatch on nuget.org
Nightwatch.Core Nightwatch on nuget.org
Nightwatch.Notifications Nightwatch on nuget.org
Nightwatch.Resources Nightwatch on nuget.org
Nightwatch.Tool Nightwatch on nuget.org

Configure

Nightwatch could be configured by placing the nightwatch.yml file in the current directory. You may also override the configuration file path by using the command-line arguments, see the Run section of this document.

nightwatch.yml has the following form:

resource-directory: "some/path"
notification-directory: "notifications/path"
log-file: "logs/nightwatch.log"  # optional

Nightwatch searches the resource directory for the configuration files. At start, it will recursively read all the *.yml files in the resource directory, and set them up as periodic tasks. Each configuration file describes a Resource.

Similarly, Nightwatch reads all *.yml files from the notification directory to configure Notification providers. When a resource check fails or recovers, Nightwatch sends notifications via the providers listed in that resource's notifications section, not via all configured providers.

See Resource Documentation for details on available resource types (Shell, HTTP, HTTPS Certificate).

See Notification Documentation for details on available notification providers (Telegram).

Logging Configuration

By default, Nightwatch logs to the console. When running as a Windows service or in environments where console output is not accessible, you can redirect logs to a file:

log-file: "logs/nightwatch.log"

The path can be relative (resolved from the configuration file's directory) or absolute. When this option is not set or empty, logs are written to the console.

Usage

There are two ways to use Nightwatch: install it and run it in service mode, or install it as a package into an F# project and build your own monitoring service based on its API.

Installation in Service Mode

Install .NET SDK 10.0 or later.

Then, install Nightwatch as a global tool:

$ dotnet tool install --global FVNever.Nightwatch.Tool

After installation:

$ nightwatch [--config ./some/path.yml] [--service]

To stop the program, press Ctrl-C.

Add --config ./some/path.yml option to set the configuration file path (nightwatch.yml in the current directory is the default).

Add --service to run in a Windows service mode.

To install the service on Windows, execute the following commands in your shell:

$ sc.exe Nightwatch binpath= "D:\Path\To\nightwatch.exe --config D:\Path\To\nightwatch.yml --service" start= auto
$ sc.exe start Nightwatch

(note the space and quote placement, that's important)

Note: When running as a Windows service, logs are not visible in a console. It is recommended to configure file logging in your nightwatch.yml:

log-file: "D:\\Path\\To\\logs\\nightwatch.log"

Make sure the service account has write permissions to the log directory.

Installation as Package

Install the package FVNever.Nightwatch into a .NET project or an fsx file:

#r "nuget: FVNever.Nightwatch"
exit <| Nightwatch.EntryPoint.FsiMain(fsi.CommandLineArgs, None, None)
// you may override the resources or notification registries via the last two parameters

Read more in the API reference.

Documentation

License

The project is distributed under the terms of the MIT license.

The license indication in the project's sources is compliant with the REUSE specification v3.3.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on FVNever.Nightwatch.Core:

Package Downloads
FVNever.Nightwatch.Notifications

Notification providers for Nightwatch monitoring service. Includes Telegram notification support.

FVNever.Nightwatch.Resources

Resource implementations for Nightwatch monitoring service. Includes HTTP health check and shell command resource.

FVNever.Nightwatch

Nightwatch is a monitoring service intended to monitor various resources and notify the administrator if something wrong happens.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 92 1/11/2026
0.1.0 108 1/11/2026

[Fixed]

- #56 (https://github.com/ForNeVeR/nightwatch/issues/56): Nightwatch gets canceled immediately after service start.