Thread: Re: monthly consolidate PG db downtime report

Re: monthly consolidate PG db downtime report

From
Peter Garza
Date:
FYI Pramod. 
I found this on the web using the AI agent. It might help you sir.

Pulling Reports from Postgres Enterprise Manager (PEM) or its Database:
You can pull reports from Postgres Enterprise Manager (PEM) or its database in a few different ways, depending on your needs and technical expertise: 
1. Using the PEM Web Client:
  • Access the PEM Web Interface: Connect to your PEM server via the web interface using a supported browser.
  • Generate System Reports: Navigate to "Management > Reports" to generate built-in reports like Alert History, System Configuration, and Core Usage reports. You can select specific agents/servers, timeframes, and download these reports in HTML or JSON formats.
  • Utilize Capacity Manager: The Capacity Manager allows you to generate reports based on collected metrics (probes) for specific objects (host, server, database, etc.). You can customize the metrics, time range, and even project future resource usage. You can display reports as graphs, tables, or both, and download them as files in HTML or JSON format. 
2. Accessing the PEM Database Directly:
  • Understanding the Architecture: The PEM Server uses a PostgreSQL instance as the data repository for monitored data.
  • Querying the Database: If you need more flexibility or custom reporting, you can directly query the PEM database using SQL. You'll need to know the database schema and table names to access the raw monitoring data collected by PEM Agents.
  • Example: Accessing Probe Data: You can query tables like probe_schedule (in the pem schema) to check probe execution times or tables named after specific probes (e.g., cp_78) to access collected metrics.
  • Caution: Directly accessing and querying the PEM database requires familiarity with SQL and the PEM database schema. Refer to the PEM documentation for details about the database structure. 
3. Using Reporting Tools and Custom Scripting:
  • Leverage Existing Reporting Tools: You can utilize open-source or commercial reporting tools designed for PostgreSQL to connect to the PEM database and create custom reports.
  • Custom Scripting: For highly specific reports or integration with other systems, you can write custom scripts (e.g., using Python) to connect to the PEM database, extract data, and generate reports in your desired format. 
In summary, you have options ranging from using the built-in reporting features in the PEM web client to querying the PEM database directly or using external tools for more advanced reporting and customization. Consider your specific reporting needs and technical expertise when choosing the appropriate method

On Thu, Jul 3, 2025 at 9:15 AM pramod badarkhe <pramodbadarkhe9@gmail.com> wrote:
Hello Everyone, The requirment is to pull the monthly consolidated  DB downtime  report  for all databases which are availble in PEM. Any idea how we can pull the report from PEM or from the PEM database?. PEM DB version is EPAS-16 and total
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
 
ZjQcmQRYFpfptBannerEnd
Hello Everyone,

The requirment is to pull the monthly consolidated  DB downtime  report  for all databases which are availble in PEM.


Any idea how we can pull the report from PEM or from the PEM database?.

PEM DB version is EPAS-16 and total pg clusters are  added to PEM around  500.


Thanks 
Pramod