General info
System constist of three parts:
- MySQL database
- PHP interface for
managing MySQL database
- C languagae daemon
The main target for it is making some
actions, when some
rules are meet. Rules are actions are organized in sequences.
Rules
You can give many rules in one sequence. Daemon logs into specified DB
and executes given SQL.
If SQL from all rules give any (non empty) results,
actions are executed.
Actions
SQL text in each action consist of two or more parts:
- SQL query with select
- optional: "{" char and SQL query with
select
- "{" char and action
- optional: as many points 3 as required
System logs into first specified DB and makes SQL query (like specified
in point 1).
If you have any logging details in second specified DB and select
after
first "{" char in SQL text, system makes specified select for
each
result returned from point 1
Each action is done for select results returned from points 1
and 2.
Action can be SQL command or running program on server (can be used for
sending emails and others).
If you want to force daemon to insert column number x from first select
for any action, use daemon_columnx
(daemon_column1 for column 1, daemon_column2 for
column 2, etc.).
If you want to force daemon to insert column number
x from second select for any action, use daemon2_columnx
(daemon2_column1 for column 1, daemon2_column2 for
column 2, etc.)
If you want to run program, insert "daemon_run_program
<parameter1<parameter2<".
Actions - example 1
select txt from a where txt='wartosc'
{
insert into b (bzzz) values ('daemon_column1')
{
insert into b (bzzz) values ('2')
System makes "select txt from a where txt='wartosc'" and for
each result makes
- "insert into b (bzzz) values
('daemon_column1')"
(instead of daemon_column1 there is entered txt column
values)
- "insert into b (bzzz) values ('2')"
Actions - example 2
select * from a where txt='wartosc'
{
daemon_run_program <c:\windows\notepad.exe<d:\ala.txt<
System makes "select * from a where txt='wartosc'" and for each
result
runs c:\windows\notepad.exe with d:\ala.txt parameter