FVNever.Nightwatch.Notifications
0.1.1
dotnet add package FVNever.Nightwatch.Notifications --version 0.1.1
NuGet\Install-Package FVNever.Nightwatch.Notifications -Version 0.1.1
<PackageReference Include="FVNever.Nightwatch.Notifications" Version="0.1.1" />
<PackageVersion Include="FVNever.Nightwatch.Notifications" Version="0.1.1" />
<PackageReference Include="FVNever.Nightwatch.Notifications" />
paket add FVNever.Nightwatch.Notifications --version 0.1.1
#r "nuget: FVNever.Nightwatch.Notifications, 0.1.1"
#:package FVNever.Nightwatch.Notifications@0.1.1
#addin nuget:?package=FVNever.Nightwatch.Notifications&version=0.1.1
#tool nuget:?package=FVNever.Nightwatch.Notifications&version=0.1.1
Nightwatch 
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.Core | |
| Nightwatch.Notifications | |
| Nightwatch.Resources | |
| Nightwatch.Tool |
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 | Versions 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. |
-
net10.0
- FSharp.Core (>= 10.0.101)
- Funogram.Telegram (>= 9.2.0)
- FVNever.Nightwatch.Core (>= 0.1.1)
- Serilog (>= 4.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FVNever.Nightwatch.Notifications:
| Package | Downloads |
|---|---|
|
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.
[Fixed]
- #56 (https://github.com/ForNeVeR/nightwatch/issues/56): Nightwatch gets canceled immediately after service start.