informEvent to an external script

#1

Is it possible to pass an informEvent to an external script ?
IE: Preset is calls an external script for all Devices matching “Product Class” $x.
External script does $foo depending which informEvent it’s received.

I’m assuming this is doable I just can’t seem to find anything documenting the arguments or examples.

#2

You would use a preset to kick off a provision script. Review the documentation at https://github.com/genieacs/genieacs-gui/wiki/Presets-Tab, https://github.com/genieacs/genieacs/wiki/Example-of-a-Provisioning-Flow and https://github.com/genieacs/genieacs/wiki/Extensions

#3

Thanks for the info. In developing my external provisioning script, I read through those pages and they were all very helpful. I don’t know if I’m over looking something obvious in the docs so apologizes if I am.

If I understand the presets correctly, I need to create multiple presets to perform the same task depending which event occurs.
IE:
Preset #1 Event: 1BOOT – Execute Provision: “CONFIG_RATELIMITS”
Preset #2 Event: M Reboot – Execute Provision: “CONFIG_RATELIMITS”
Preset #3 Event: 1 BOOT, -0 BOOTSTRAP – Execute Provision: “CONFIG_RATELIMITS”

My thought was to send the event as an argument "CONFIG_RATELIMITS ( EVENT ) " to the external script and let it do what I need depending on the event. That way I don’t have multiple presets all running the same external script.
I see the Arguments field next to the Provision Name field on the Presets tab, so I’m wondering if there’s a variable I need to add there in order to pass along the actual event that triggered the preset.

Thanks again!

#4

This preset will execute on every boot - #1 Event: 1BOOT – Execute Provision: “CONFIG_RATELIMITS”

This preset will execute every reboot - Preset #2 Event: M Reboot – Execute Provision: “CONFIG_RATELIMITS”
This preset will only execute on a boot event that is not also a bootstrap - Preset #3 Event: 1 BOOT, -0 BOOTSTRAP – Execute Provision: “CONFIG_RATELIMITS”

The args for presets are in the wiki, I believe in the gui wiki though.

-dan