cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Custom Alert - PostgreSQL user role expires in N days

Description

As a PostgreSQL administrator, you may be responsible for creating user accounts and groups. You may also be responsible for granting and revoking privileges.  The alert will notify you when a user role is about to expire in N days. 

Alert Definition

To create the alert, click on Alerts > Manage Alerts tab and create a Custom Alert of type Custom SQL Alert - Multiple Numeric Return. Configure the alert with values similar to these:

Alert Name: User role expires in N days

Execution Interval: 1 days

Notification Text: Empty

SQL Statement:

select rolname, EXTRACT(DAYS FROM now()-rolvaliduntil) from pg_roles WHERE rolvaliduntil is not null

Execute Against: Monitored Instance

Units: Days

High Threshold: Min 2, Max 15 

Labels (2)
Version history
Revision #:
2 of 2
Last update:
‎08-03-2020 03:51 PM
Updated by: