Create the SQL Server login/user that the Foglight database agent will use (e.g. FOGLIGHT)
Modify MSSQLPermissionsGrant.sql and specify the user that will be used under the @LoginName. Execute the script as a sysadmin user.
Login as the FOGLIGHT user to be used by the agent via Management Studio. Edit MSSQLPermissionsCheck.sql and specify the user under the @LoginName. Execute MSSQLPermissionsCheck.sql. This will check if the FOGLIGHT user or intended user has the correct permission. A result of '1' means no permission. '0' means permission is good.