Add postgresql service to generateldif script

This commit is contained in:
Benoît S. 2018-09-13 17:30:30 +02:00
parent 81e9b3d33c
commit 8ec4ac02b3
1 changed files with 18 additions and 0 deletions

View File

@ -547,6 +547,24 @@ ServiceVersion: Elasticsearch ${elasticsearch_version}
EOT EOT
fi fi
# PostgreSQL
if is_pkg_installed postgresql; then
postgresql_version=$(get_pkg_version postgresql)
fi
if [ -n "${postgresql_version}" ]; then
cat <<EOT >> "${ldif_file}"
dn: ServiceName=postgresql,${computer_dn}
NagiosEnabled: TRUE
ipServiceProtocol: tcp
objectClass: EvoService
ServiceName: postgresql
ipServicePort: 5432
ServiceType: database
ServiceVersion: PostgreSQL ${elasticsearch_version}
EOT
fi
# test if we have a stdout # test if we have a stdout
if [ -t 1 ]; then if [ -t 1 ]; then
echo "Output is in ${ldif_file}" echo "Output is in ${ldif_file}"