ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / Managing HFSQL Client/Server
  • Overview
  • History of incidents/notifications
  • Overview
  • History of notifications displayed in the HFSQL Control Center
  • Accessing the history of notifications through programming
  • Receiving the notifications (by email or WDBal)
  • Overview
  • HFSQL Control Center
  • Programming
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
An HFSQL server can perform several operations that require to send a notification:
  • A server may encounter problems without any user (or developer) noticing anything.
    For example:
    • a scheduled task may fail.
    • an automatic backup may fail.
    • a node may become inactive in an HFSQL cluster, ...
  • A server can also perform operations automatically (automatic update, search for keys to optimize the queries, ...). The implementation and the status report of these operations require a notification.
The HFSQL Control Center is used to:
Remark: These operations are also available through programming.
History of incidents/notifications

Overview

A notification is created for each problem that occurs on the HFSQL server. The characteristics of this notification are as follows:
  • Date and time of incident.
  • Message presenting the incident.
  • Category of incident: Information, Warning, Critical, Error.
    • Information: Information about the events that occurred on the server.
      Example:
      • Automatic update of HFSQL server with reboot.
      • Suggestion for adding keys and composite keys to optimize the execution time of queries.
    • Warning: Events that do not trigger a failure but about which something must be done.
      Example: Resolution of a modification conflict for the replication. If several of them occur, the architecture of the application may have to be changed (otherwise, there is no need to worry).
    • Critical: Failures for which no error can be returned to the user.
      Examples: WLanguage error in a stored procedure used by a scheduled task, failure of the connection to a replicated server, ...
    • Error: Problem regarding the management of Windows cache.
The history of notifications can be viewed:
  • from the HFSQL Control Center.
  • programmatically.

History of notifications displayed in the HFSQL Control Center

The HFSQL Control Center allows you to view the history of incidents that occurred on the sever.
To see this history:
  1. Start the HFSQL Control Center.
  2. Select the requested server.
  3. Display the "Notifications" tab.
  4. The list of notifications sent by the server is displayed. You can:
    • delete a notification.
    • refresh the list.

Accessing the history of notifications through programming

The history of notifications is saved in an HFSQL file found in the system database of the server: "Alert.fic".
This data file can be handled by programming as follows:
PROCEDURE HFCS_RetrieveLastNotifications(sServer, sUser="Admin", sPassword=""): string
// Parameters for connecting to the server whose last notification must be retrieved
ctConnection is Connection
ctConnection.Provider = hAccessHFClientServer
ctConnection.Server = sServer
ctConnection.User = sUser
ctConnection.Password = sPassword
ctConnection.Database = "__System"
 
// By default, don't return anything
RETURN = ""
// Files of server notifications
dsAlert is Data Source
IF HDeclareExternal("Alert.fic", dsAlert, ctConnection) THEN
// Last notification in date
IF HReadLast(sdAlert, Date) THEN
// Retrieves the record
RETURN = HRecordToString(sdAlert)
END
// Frees the declared file
HCancelDeclaration(dsAlert)
// Frees the connection
HCloseConnection (ctConnection)
ELSE
// Failure accessing the server
Error("Error while retrieving the notifications: " + HErrorInfo(hErrFullDetails))
END
Receiving the notifications (by email or WDBal)

Overview

By default, the notifications are found in the HFSQL Control Center. You can also be notified in real time when a problem occurs on the HFSQL server. All you have to do is configure the notification system of the HFSQL server.
This configuration can be performed:
  • via the HFSQL Control Center.
  • programmatically.

HFSQL Control Center

To configure the sending of HFSQL notifications from the HFSQL Control Center:
  1. Start the HFSQL Control Center.
  2. Select the requested server.
  3. In the ribbon, in the "Parameters" group, click "Server configuration".
  4. In the list of possible configurations, click "Notifications". The window for configuring the notifications is displayed:
    Configuration of notifications
  5. Configure the modes for sending notifications:
    • in the "Send by email" tab, specify the characteristics of the SMTP server that will be used to send the notifications by email.
    • in the "Send by messaging (WDBal)" section, specify the characteristics of the database of Control Centers that will be used to send the notifications.
    Remarks:
    • The "Retrieve the computer configuration" button is used retrieve the configuration of the current computer.
    • The database of Control Centers can be in Classic or in Client/Server mode.
  6. Create the recipients of notifications:
    • The button is used to add a recipient for the sending by email. Specify the email address of the recipient and validate.
    • The button is used to add a recipient for the sending via the messaging (WDBal) of Control Centers. Select the relevant recipients and validate.
    • In the list of recipients, for each recipient, select the minimum severity level of the incidents for which you want to send notifications.
  7. Click the "Apply" button to validate the configuration.

Programming

Several WLanguage functions can be used to configure the sending of HFSQL notifications by programming:
HNotifAddCCRecipientAdds recipients for the notifications sent via the Control Centers (WDBal messaging tool).
HNotifAddEmailRecipientAdds recipients for the notifications sent by email.
HNotifConfigureSpecifies and configures the server used to send notifications by the HFSQL server.
HNotifDeleteCCRecipientDeletes the recipients of a notification sent via the Control Centers (WDBal messaging tool).
HNotifDeleteEmailRecipientDeletes the recipients of an email notification.
HNotifListCCRecipientReturns the list of recipients of a notification sent via the Control Centers (WDBal messaging tool).
HNotifListEmailRecipientReturns the list of recipients for a notification by email.
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/26/2023

Send a report | Local help