How can get uptime to postgres and sql server

Hi. someone can help to get the uptime to postgres and sql server.

I have tried an NQRL statement but I cannot find the parameters or attributes to create it

Would appreciate your help

Best regards

Are they in something like AWS?

hi. i don’t know AWS. but I was able to make the graphics I needed.

i use ProcessSample of infraestructure

Postgres
SELECT percentage(count(*),WHERE state=‘S’) FROM ProcessSample WHERE commandLine like ‘/usr/pgsql-12/bin/postmaster’ SINCE 1 day ago

SQLServer
SELECT percentage(count(*),where state=‘up’) FROM ProcessSample WHERE commandLine like ‘C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\sqlservr.exe’ since 1 day ago