diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-05-28 18:41:21 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-06-06 15:26:20 +0000 |
commit | 0bbe8d655df4bc50d70aeef2d3199a73e0af9f03 (patch) | |
tree | f765284c34e9c848ac24f130266d6f9dbd941049 /interface-definitions | |
parent | 47d9eb7e7d8197012ab0aa5e878bd0a3bb83ae33 (diff) | |
download | vyos-1x-0bbe8d655df4bc50d70aeef2d3199a73e0af9f03.tar.gz vyos-1x-0bbe8d655df4bc50d70aeef2d3199a73e0af9f03.zip |
event-handler: T3083: Add simple event-handler
Event-handler allows executing a custom script when in logs it
detects configured "pattern"
A simple implemenation
set system event-handler first pattern '.*ssh2.*'
set system event-handler first script '/config/scripts/hello.sh'
Diffstat (limited to 'interface-definitions')
-rw-r--r-- | interface-definitions/system-event-handler.xml.in | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/interface-definitions/system-event-handler.xml.in b/interface-definitions/system-event-handler.xml.in new file mode 100644 index 000000000..f5d8afabd --- /dev/null +++ b/interface-definitions/system-event-handler.xml.in @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interfaceDefinition> + <node name="system"> + <children> + <tagNode name="event-handler" owner="${vyos_conf_scripts_dir}/system_event_handler.py"> + <properties> + <help>Event handler name</help> + </properties> + <children> + <leafNode name="pattern"> + <properties> + <help>Match pattern (regex)</help> + </properties> + </leafNode> + <leafNode name="script"> + <properties> + <help>Event handler script file</help> + <constraint> + <validator name="script"/> + </constraint> + </properties> + </leafNode> + </children> + </tagNode> + </children> + </node> +</interfaceDefinition> |