mirror of
https://github.com/zulip/zulip.git
synced 2026-06-30 21:11:04 +08:00
nagios: Support arbitrary database user and dbname in replication check.
Co-authored-by: Adam Birds <adam.birds@adbwebdesigns.co.uk>
This commit is contained in:
parent
c17f502bb0
commit
ab130ceb35
@ -9,6 +9,10 @@ import re
|
||||
import subprocess
|
||||
from typing import Dict, List
|
||||
|
||||
from scripts.lib.zulip_tools import get_config, get_config_file
|
||||
|
||||
config_file = get_config_file()
|
||||
|
||||
states = {
|
||||
"OK": 0,
|
||||
"WARNING": 1,
|
||||
@ -33,7 +37,10 @@ def run_sql_query(query: str) -> List[List[str]]:
|
||||
"-z", # Separate columns with nulls
|
||||
"-v",
|
||||
"ON_ERROR_STOP=1",
|
||||
"zulip",
|
||||
"-d",
|
||||
get_config(config_file, "postgresql", "database_name", "zulip"),
|
||||
"-u",
|
||||
get_config(config_file, "postgresql", "database_user", "zulip"),
|
||||
"-c",
|
||||
f"SELECT {query}",
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user