The rate and number of incoming events serve as an important indicator of the state of the system. For example, you can detect when there are too many events, too few, or none at all. Monitoring policies are designed to detect such situations. In a policy, you can specify a lower threshold, an optional upper threshold, and the way the events are counted: by frequency or by total number.
You can use the Search field to look for monitoring policies. The search will be carried out in the following columns: Name, Tenant, Type, Schedule (name of the day and time). To find a policy by searching for a single character, enter that character and press Enter.
The policy must be applied to the event source. You can apply one or more monitoring policies to a source. After applying the policy, you can monitor the status of the source on the List of event sources tab.
Policies for monitoring the sources of events are displayed in the table under Source status → Monitoring policies. You can sort the table by clicking the column header of the relevant setting. The maximum size of the policy list is not limited.
In the Sources column, you can click the Show button to view all event sources to which the policy is applied. When you click this button, you are taken to the List of event sources section, and the table of sources is filtered by the selected policy.
Algorithm of monitoring policies
Monitoring policies are applied to an event source in accordance with the following algorithm:
Depending on the policy type, the number of the event stream is counted as the number of events (for the byCount policy type or policies of different types) or as the number events per second (EPS, for the byEPS policy type). You can look up how the stream is counted for the applied policy in the Stream column on the List of event sources page.
If the event stream from the source crosses the thresholds specified in the monitoring policy, information about this is recorded in the following way:
5
(Type=5
) is generated. The fields of the event are described in the table below.Fields of the monitoring event
Event field name |
Field value |
---|---|
ID |
Unique ID of the event. |
Timestamp |
Event time. |
Type |
Type of the audit event. For the audit event, the value is |
Name |
Name of the monitoring policy. |
DeviceProduct |
|
DeviceCustomString1 |
The value from the |
The generated monitoring event is sent to the following resources:
Adding a monitoring policy
To add a new monitoring policy:
We recommend choosing a name that reflects the configured schedule of the monitoring policy.
If you do not specify the frequency of measurement, the monitoring policy is triggered immediately after the stream is found to cross the threshold.
The Lower limit setting is required.
When specifying the evaluation interval, keep in mind the policy schedule. For example, if you configured the policy to be applied once every few hours, we do not recommend configuring a short interval and causing excessive load on VictoriaMetrics.
To forward notifications, you must configure a connection to the SMTP server.
By default, the basic notification template is selected. You can reset the template selection and switch to the base template by clicking the X icon.
If you want to clear the selection, click the X icon.
The policy applicability interval is inclusive of its bounds; for example, if the end time is set to 23:59, the policy will be applied until 23:59:59.999. The default interval is 00:00 to 23:59. The start time must be earlier than the end time.
You can add any number of periods.
The dates are configured without a year value, so the policy will be applied annually on the specified days until you delete this period. If you want to clear the selection, click the X icon.
The policy applicability interval is inclusive of its bounds; for example, if the end time is set to 23:59, the policy will be applied until 23:59:59.999. The default interval is 00:00 to 23:59. The start time must be earlier than the end time.
You can add any number of periods.
If you applied a schedule by day of the week and by day of the month at the same time, the day-of-the-month policy is applied first.
The monitoring policy will be added.
Editing monitoring policies
The Source status → Monitoring policies section displays the added monitoring policies and their settings that you specified when creating the policy. You can click a policy to display a sidebar with all of its settings. If necessary, you can edit the policy settings in this sidebar.
If a monitoring policy is applied to an event source, if you edit certain policy settings, you may need to update the policy to apply the changes. Every 30 minutes, KUMA checks if any monitoring policies require updating, and if that is the case, it automatically runs a task to update those monitoring policies. You can also run the update task manually by clicking the Update policy button at the top of the table. One task updates all policies that need updating.
The Update policy button becomes active only if some monitoring policies need updating. Information about whether the policy needs updating is displayed in the table of monitoring policies in the Policy update status as one of the following statuses:
In this case, the edited policy settings are applied to event sources after a minute. Changes of the Notification template setting are applied instantly.
The date and time when the policy was last applied to event sources is displayed in the Policy last applied column.
While the policy update task is running, the Update policy button is unavailable for all users. If another user has edited the settings of the policy that necessitate an update, the Update policy button becomes active for you only after you refresh the page or edit the policy or an event source.
Applying monitoring policies
To apply monitoring policies to event sources:
In the lower left part of the table, you can find the number of selected sources and the total number of sources in the table.
After you select the event sources to which you want to apply the monitoring policy, the Enable policy button becomes available on the toolbar.
To select all available policies, you can select the check box in the heading of the first column. You can also use context search by policy name or sort the policies by clicking the heading of the column by which you want to sort the table and selecting Ascending or Descending.
Search and sorting is not available for the Sources, Schedule, Policy update status, Policy last applied columns.
The monitoring policies are applied to the selected event sources; the status of these sources changes to green. The names of the policies applied to the sources are displayed in the Monitoring policy column. A message is also displayed indicating the number of sources to which the policies have been applied. If the monitoring policy is triggered for an event source, the new status of that source is displayed after you manually refresh the page or it is refreshed automatically. We recommend configuring an automatic data refresh period to keep track of changes in the list of sources.
If you have selected more than 100,000 event sources and applied one or more policies to them, these policies are applied only to the first 100,000 sources to which these policies have not yet been applied. If you need to apply policies to the remaining sources, you can do one of the following:
Repeat the action until the policies have been applied to all the sources that you need.
Disabling monitoring policies
To disable monitoring policies for event sources:
In the lower left part of the table, you can find the number of selected sources and the total number of sources in the table. After you select the event sources to which monitoring policies are applied in the list, the Disable policy button becomes available on the toolbar.
You can select several event sources by clicking the check box in the heading of the first column and selecting one of the following options:
To select all available policies, you can select the check box in the heading of the first column. You can also use context search or sort the policies by clicking the heading of the column by which you want to sort the table and selecting Ascending or Descending.
Search and sorting is not available for the Sources, Schedule, Policy update status, Policy last applied columns.
The default selection is For the specified time, and the value is set to 5 minutes.
The monitoring policies are disabled for selected event sources or suspended for the specified time. The status of these sources in the table changes to gray. A message is displayed indicating the number of sources for which the policies have been disabled.
If you have selected more than 100,000 event sources and disabled one or more policies for them, these policies are disabled only for the first 100,000 sources to which these policies are applied. If you need to disable policies for the remaining sources, you can do one of the following:
Repeat the action until the policies have been disabled for all the sources that you need.
Adding a new monitoring policy based on an existing policy
To create a new monitoring policy based on an existing policy:
If necessary, you can find monitoring policies in the list using the Search field. The search will be carried out in the following columns: Name, Tenant, Type, Schedule (name of the day and time). To find a policy by searching for a single character, enter that character and press Enter.
By default, - copy
is appended to the name of the new policy. The rest of the settings are the same as in the policy that you are duplicating.
The monitoring policy is created based on an existing policy.
Deleting monitoring policies
To delete a monitoring policy:
If necessary, you can find monitoring policies in the list using the Search field. The search will be carried out in the following columns: Name, Tenant, Type, Schedule (name of the day and time). To find a policy by searching for a single character, enter that character and press Enter.
The selected monitoring policies are deleted.
You cannot remove predefined monitoring policies or policies that are assigned to data sources.
Page top