I want to configure some automatic actions (send an e-mail or other) to take place when mcfee agent did not communicate with ePO server for example for 2 hours.
How can I do this?
You can create duplicate of default query ''Inactive agents query" with filter of two hours then use this query in the server task. select an action to 'send email'.
I didn't find an action 'send email' in server task. Maybe you mean action 'export queries' and sub-action 'email file'?
No, Create new server with the duplicate query you created. Under sub action, select the option 'email the file'. Please look at screenshot.
Can I configure it not to send email if there is no inactive agents?
No. I don't think so. Server task will get invoked at it's scheduled interval and if there are no inactive machines then email will be sent with blank attachment.