Monitoring incoming request in DB with mode email

Monitoring incoming request in DB with mode email

I want to create notification when I got new request via email in my hostmonitor program. My program can do select via ODBC in servicedesk DB. Email can be send in the night. There is worker that monitoring service (test) and dispatch in the night.

So I need mysql request that return to me count of request with:

-Request mode - email;

-Group - NULL

-Technician - NULL

-Category - NULL

-Status -Open;

-Create time - last 7 days (I think older request I see myself);

When count set to more than 0 (1,2,3 and so) after 10 min of test fail (maybe dispatcher see in that 10 min this request in SDP) I start sound notification, write fail test in log and so.

Please help me with this request. I don't now how to set NULL to request (may be I need to set something else in request).

                  New to ADSelfService Plus?