Foglight agent logs show errors like: FrameworkQueryException: tempdb..fgl_sy2_deltatable not found. or Stored procedure 'sp_fgl_deltaint' not found. Collections such as EngineSummary, ProcedureCache, NetworkIOSummary, and alarms (e.g., Connection_Usage) fail.
tempdb is recreated after an ASE restart; all temp tables in tempdb are lost.sp_fgl_* procedures were created or persist with sa/dbo ownership, or the monitoring account lacks required rights, the agent cannot recreate the tempdb tables or run the procs correctly.rapsAdmin.sql / rapsinstall*.sql) which recreate stored procedures and temp tables if the DB rights and ownership are correct. Restart does not change DB permissions.Navigate to the affected Sybase agent in the Foglight UI.
Click Deactivate to stop the agent cleanly.
1). Log in to the monitored Sybase instance and run the following SQL scripts:
-- Remove temporary tables (use TEMPDB)
use tempdb
go
select name, user_name(uid) as owner from sysobjects where name like 'fgl_%' and type = 'U'
go
if exists (select 1 from sysobjects where name = 'fgl_sy2_deltatable' and type = 'U')
drop table fgl_sy2_deltatable
go
if exists (select 1 from sysobjects where name = 'fgl_processes' and type = 'U')
drop table fgl_processes
go
if exists (select 1 from sysobjects where name = 'fgl_missed_SQLText' and type = 'U')
drop table fgl_missed_SQLText
go
if exists (select 1 from sysobjects where name = 'tmpscc' and type = 'U')
drop table tmpscc
gousesybsystemprocsgo
select name, user_name(uid) as owner from sysobjects where name like 'sp_fgl_%' and type = 'P' order by name
go
-- To generate drop statements (review before running)
select 'drop procedure ' + name from sysobjects where name like 'sp_fgl_%' and type = 'P'
go
-- If you need the procedure body before dropping:
sp_helptext sp_fgl_enginesummary1
go
2). Run the validated drop procedure <name> statements as a user with appropriate privilieges. If the procedures are owner by sa, they must be dropped by a privilged account.
Ensure that the monitoring user (used by the Sybase agent) has mon_role. This avoids improper persistence or ownership of agent objects.
-- Check login/roles (example)
use tempdb
sp_helplogins <monitoring_login>
go
-- To grant (run as DBA/sysadmin)
use master
go
grant role mon_role to <monitoring_login>
go
go
grant create table to <monitoring_login>
go
-- revoke role sa_role from <monitoring_login> -- run only if appropriate
-- go
Go back to the Foglight UI.
Click Activate to restart the agent.
Monitor the agent log for confirmation that stored procedures and temporary tables are recreated:
Installing new stored proceduresCollection EngineSummary started successfully
Navigate to the agent.
Confirm metrics.
If necessary, lower thresholds temporarily to test alert triggering.
Always use a monitoring user with mon_role
Avoid using sa_role for agent users
Ensure objects are cleaned up and recreated after Sybase restarts
If the monitored instance was restarted, temporary objects may be lost. Reactivation of the agent is required.
If stored procedures persist, it may indicate they were created with sa privileges.