[SOLVED] Intrusion Detection - Schedule Task

Started by interkrome, February 25, 2016, 07:54:23 AM

Previous topic - Next topic
February 25, 2016, 07:54:23 AM Last Edit: April 08, 2016, 07:59:20 AM by franco
Hi!

How possible to schedule the service (suricata) to be shutdown at certain time then restart it back at certain time?

Managed to update the drop-down option from "update IDS rules" to "reload IDS rules" which before this both showing "update IDS rules".

But, how to add another option in that drop-down menu such as start and stop function of suricata. Any idea?

Hi interkrome,

You can build your own configd actions to do so, development documentation is available here https://docs.opnsense.org/development/examples/helloworld.html?highlight=configd

For example, create a file here:
/usr/local/opnsense/service/conf/actions.d/actions_myactions.conf

Containing something like this:

[stop]
command:/usr/local/etc/rc.d/suricata stop
parameters:
type:script
message:reload suricata rules
description: stop suri



(when a description is available, you should be able to schedule the item from https://<your address>/ui/cron/ )


Don't forget to restart configd after adding new templates:
service configd restart

Next test your action, using:

configctl myactions stop

Regards,

Ad