In version 6.0, Automation rules were introduced that allow automation of a series of actions before certain events.
An example of this is the possibility to quarantine when the device is detected to be compromised or to initiate a Log via API (Webhook) when a particular Event Log is created.
There are two types of actuators (Triggers-triggers) that cannot be configured via the graphical interface, but that we can configure with the CLI, and we will see that the configuration made on the CLI side is then reflected in the GUI.
These methods take effect when the CPU is at very high values or enters Conserve mode with high memory.
To configure them, we will launch the following commands from the CLI.
high cpu low-memory first
config system
automation-trigger
edit "cpu"
set event-type high-cpu
next
edit "memoria"
set event-type low-memory
next
end
Once the trigger is configured, we will create a new Automation rule and associate it with the trigger configured in the previous step.
config system automation-stitch
edit "memoria"
set trigger "memoria"
next
edit "cpu"
set trigger "cpu"
next
end
edit "cpu"
set event-type high-cpu
next
edit "memoria"
set event-type low-memory
next
end
Once the trigger is configured, we will create a new Automation rule and associate it with the trigger configured in the previous step.
config system automation-stitch
edit "memoria"
set trigger "memoria"
next
edit "cpu"
set trigger "cpu"
next
end
After the process is complete, we can see the rules created by the GUI.
Also if we go into one of them, it will allow us to do the rest of the configuration with graphics management.
As an interesting use case, there might be a script that initiates the HA failover imperative when one of the nodes goes into Conserve mode.
For more information:
Yorumlar
Yorum Gönder